Skip to content

Commit

Permalink
[Jupyter] Add RBAC (mlrun#85)
Browse files Browse the repository at this point in the history
Co-authored-by: Alon Maor <[email protected]>
  • Loading branch information
eliyahu77 and alonmr authored Dec 3, 2023
1 parent 050c4ad commit fb29edd
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/mlrun-ce/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
version: 0.6.3-rc5
version: 0.6.3-rc6
name: mlrun-ce
description: MLRUn Open Source Stack
home: https://iguazio.com
Expand Down
4 changes: 2 additions & 2 deletions charts/mlrun-ce/templates/jupyter-notebook/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ spec:
labels:
{{- include "mlrun-ce.jupyter.selectorLabels" . | nindent 8 }}
spec:
{{- if .Values.jupyterNotebook.serviceAccount }}
serviceAccount: {{ .Values.jupyterNotebook.serviceAccount }}
{{- if .Values.jupyterNotebook.serviceAccount.name }}
serviceAccount: {{ .Values.jupyterNotebook.serviceAccount.name }}
{{- end }}
securityContext:
runAsUser: 1000
Expand Down
13 changes: 13 additions & 0 deletions charts/mlrun-ce/templates/jupyter-notebook/role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.jupyterNotebook.enabled -}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: jupyter-role-binding
subjects:
- kind: ServiceAccount
name: {{ .Values.jupyterNotebook.serviceAccount.name }}
roleRef:
kind: Role
name: jupyter-role
apiGroup: rbac.authorization.k8s.io
{{- end -}}
51 changes: 51 additions & 0 deletions charts/mlrun-ce/templates/jupyter-notebook/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{- if .Values.jupyterNotebook.enabled -}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: jupyter-role
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- list
- apiGroups:
- metrics.k8s.io
resources:
- pods
verbs:
- list
- get
- apiGroups:
- ""
resources:
- services
verbs:
- list
- get
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- list
- get
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- if .Values.jupyterNotebook.serviceAccount.create -}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.jupyterNotebook.serviceAccount.name }}
{{- end -}}
5 changes: 4 additions & 1 deletion charts/mlrun-ce/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ mlrun:
mode: full

jupyterNotebook:
awsInstall: false
serviceAccount:
create: true
name: mlrun-jupyter
awsInstall: false
fullnameOverride: mlrun-jupyter
name: jupyter-notebook
enabled: true
Expand Down

0 comments on commit fb29edd

Please sign in to comment.