Skip to content

Commit

Permalink
implement roles
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk committed Jan 11, 2025
1 parent abb1922 commit 5d73431
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/operator-wandb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,18 @@ settingsMigrationHook:
install: false
service:
enabled: false
role:
create: true
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- update
- patch
env:
SMH_FILE_STORE:
value: '{{ (include "wandb.bucket" . | fromYaml).url }}'
Expand Down
12 changes: 12 additions & 0 deletions charts/wandb-base/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.role.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "wandb-base.fullname" .}}
labels:
{{- include "wandb-base.labels" . | nindent 4 }}
rules:
{{- with .Values.role.rules }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/wandb-base/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.role.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "wandb-base.fullname" . }}
labels:
{{- include "wandb-base.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "wandb-base.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: {{ include "wandb-base.fullname" . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
4 changes: 4 additions & 0 deletions charts/wandb-base/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ serviceAccount:
annotations: {}
name: ""

role:
create: false
rules: []

podAnnotations: {}
podLabels: {}

Expand Down

0 comments on commit 5d73431

Please sign in to comment.