apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Release.Name }}-jupyterlab labels: tier: aihub-dag component: jupyterlab release: {{ .Release.Name }} spec: selector: matchLabels: tier: aihub-dag component: jupyterlab release: {{ .Release.Name }} template: metadata: {{- with .Values.jupyterlab.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: tier: aihub-dag component: jupyterlab release: {{ .Release.Name }} date: "{{ now | unixEpoch }}" spec: {{- with .Values.jupyterlab.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml .Values.jupyterlab.podSecurityContext | nindent 8 }} containers: - name: {{ .Release.Name }}-jupyterlab securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.jupyterlab.image.repository }}:{{ .Values.jupyterlab.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.jupyterlab.image.pullPolicy }} ports: - name: http containerPort: 8888 protocol: TCP volumeMounts: - name: jupyterlab-data mountPath: /workspace subPath: {{ .Values.jupyterlab.config.workspace }} - name: {{ .Release.Name }}-jupyterlab-config mountPath: /root/.jupyter/jupyter_lab_config.py subPath: jupyter_lab_config.py livenessProbe: initialDelaySeconds: 30 #延迟加载时间 periodSeconds: 30 #重试时间间隔 timeoutSeconds: 5 failureThreshold: 3 successThreshold: 1 httpGet: path: {{ .Values.jupyterlab.config.baseUrl }}/lab port: http readinessProbe: initialDelaySeconds: 30 #延迟加载时间 periodSeconds: 5 #重试时间间隔 timeoutSeconds: 5 failureThreshold: 3 successThreshold: 1 httpGet: path: {{ .Values.jupyterlab.config.baseUrl }}/lab port: http resources: {{- toYaml .Values.jupyterlab.resources | nindent 12 }} volumes: - name: jupyterlab-data persistentVolumeClaim: claimName: jupyterlab-data0 - name: {{ .Release.Name }}-jupyterlab-config configMap: name: {{ .Release.Name }}-jupyterlab-config {{- with .Values.jupyterlab.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.jupyterlab.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.jupyterlab.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.jupyterlab.hostAliases }} hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.jupyterlab.hostAliases "context" $) | nindent 8 }} {{- end }}