Skip to content

Commit

Permalink
Adding permissions for "nodes" resources to the helm chart (#2091) (#…
Browse files Browse the repository at this point in the history
…2093)

* Adding permissions for Nodes
  • Loading branch information
kky-fury committed Jul 15, 2024
1 parent 8c91d78 commit 2bf00fc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
19 changes: 19 additions & 0 deletions charts/fdb-operator/templates/rbac/rbac_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,22 @@ rules:
- update
- patch
- delete
{{- if .Values.nodeReadClusterRole }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "fdb-operator.fullname" . }}-clusterrole
labels:
{{- include "fdb-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- watch
- list
{{- end }}

16 changes: 16 additions & 0 deletions charts/fdb-operator/templates/rbac/rbac_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,19 @@ subjects:
{{- if .Values.globalMode.enabled }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- if .Values.nodeReadClusterRole }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "fdb-operator.fullname" . }}-clusterrolebinding
labels:
{{- include "fdb-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "fdb-operator.fullname" . }}-clusterrole
subjects:
- kind: ServiceAccount
name: {{ include "fdb-operator.serviceAccountName" . }}
{{- end }}
1 change: 1 addition & 0 deletions charts/fdb-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ initContainerSecurityContext:
drop:
- all
readOnlyRootFilesystem: true
nodeReadClusterRole: true

0 comments on commit 2bf00fc

Please sign in to comment.