# Copyright 2023 Iguazio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: jupyter-role rules: - apiGroups: - "" resources: - pods - pods/exec - pods/log - services - serviceaccounts - secrets verbs: - '*' - apiGroups: - kubeflow.org resources: - mpijobs verbs: - '*' - apiGroups: - sparkoperator.k8s.io resources: - sparkapplications - scheduledsparkapplications verbs: - '*' --- apiVersion: v1 kind: ServiceAccount metadata: name: jupyter --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: jupyter-mlrun-executor roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: jupyter-role subjects: - kind: ServiceAccount name: jupyter --- apiVersion: apps/v1 kind: Deployment metadata: name: jupyter-notebook labels: app: jupyter-notebook spec: replicas: 1 selector: matchLabels: app: jupyter-notebook template: metadata: labels: app: jupyter-notebook spec: containers: - name: jupyter-notebook image: mlrun/jupyter:1.6.1 env: - name: MLRUN_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name: MLRUN_DBPATH value: "http://mlrun-api:8080" - name: MLRUN_ARTIFACT_PATH value: "/home/jovyan/data" # Uncomment for Vault support # - name: MLRUN_SECRET_STORES__VAULT__ROLE # value: "user:mlrun-api" # - name: MLRUN_SECRET_STORES__VAULT__URL # value: 'Your vault URL here' volumeMounts: - mountPath: /home/jovyan/data name: storage ports: - containerPort: 8888 command: ["start-notebook.sh"] args: - --ip="0.0.0.0" - --port=8888 - --NotebookApp.token='' - --NotebookApp.password='' - --NotebookApp.default_url="/lab" volumes: - name: storage persistentVolumeClaim: claimName: nfs-pvc serviceAccountName: jupyter --- kind: Service apiVersion: v1 metadata: name: jupyter-notebook spec: type: NodePort selector: app: jupyter-notebook ports: - protocol: TCP nodePort: 30040 port: 8888 targetPort: 8888