diff --git a/charts/roles/Chart.yaml b/charts/roles/Chart.yaml index ddc7194..9174c60 100644 --- a/charts/roles/Chart.yaml +++ b/charts/roles/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.2 +version: 0.1.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/roles/templates/role.yml b/charts/roles/templates/role.yml index c856315..163d506 100644 --- a/charts/roles/templates/role.yml +++ b/charts/roles/templates/role.yml @@ -1,18 +1,28 @@ apiVersion: rbac.authorization.k8s.io/v1 +{{- if .Values.namespace }} kind: Role +{{- else }} +kind: ClusterRole +{{- end }} metadata: name: {{.Values.name}} +{{- if .Values.namespace }} namespace: {{.Values.namespace}} +{{- end }} rules: - apiGroups: ["", "apps", "networking.k8s.io"] resources: - [ - "pods", - "deployments", - "ingresses", - "services", - "statefulsets", - "secrets", - "replicasets" - ] + - "pods" + - "deployments" + - "ingresses" + - "services" + - "statefulsets" + - "secrets" + - "replicasets" +{{- if .Values.namespace }} +{{- else }} + - "pods/log" + - "namespaces" + - "pods/portforward" +{{- end }} verbs: ["get", "patch", "create", "watch", "list", "delete","update"] diff --git a/charts/roles/templates/rolebinding.yml b/charts/roles/templates/rolebinding.yml index 9c1aab7..2ebd27c 100644 --- a/charts/roles/templates/rolebinding.yml +++ b/charts/roles/templates/rolebinding.yml @@ -1,13 +1,23 @@ apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding +{{- if .Values.namespace }} +kind: RoleBinding +{{- else }} +kind: ClusterRoleBinding +{{- end }} metadata: name: {{.Values.name}} +{{- if .Values.namespace }} namespace: {{.Values.namespace}} +{{- end }} roleRef: apiGroup: rbac.authorization.k8s.io +{{- if .Values.namespace }} kind: Role +{{- else }} + kind: ClusterRole name: {{.Values.name}} +{{- end }} subjects: - apiGroup: rbac.authorization.k8s.io - kind: User + kind: User name: {{.Values.name}} diff --git a/eks/README.md b/eks/README.md deleted file mode 100644 index 6265cbe..0000000 --- a/eks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -```bash -kubectl edit cm -n kube-system aws-auth -``` \ No newline at end of file