Skip to content

Commit

Permalink
add support for clustor role
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisommore committed Nov 11, 2022
1 parent 2d3e378 commit 60a3584
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion charts/roles/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 19 additions & 9 deletions charts/roles/templates/role.yml
Original file line number Diff line number Diff line change
@@ -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"]
14 changes: 12 additions & 2 deletions charts/roles/templates/rolebinding.yml
Original file line number Diff line number Diff line change
@@ -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}}
3 changes: 0 additions & 3 deletions eks/README.md

This file was deleted.

0 comments on commit 60a3584

Please sign in to comment.