jupyterlab-deployment.yaml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {{- if .Values.jupyterlab.install.enabled }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ .Release.Name }}-jupyterlab
  6. labels:
  7. tier: aihub-spark
  8. component: jupyterlab
  9. release: {{ .Release.Name }}
  10. spec:
  11. selector:
  12. matchLabels:
  13. tier: aihub-spark
  14. component: jupyterlab
  15. release: {{ .Release.Name }}
  16. template:
  17. metadata:
  18. {{- with .Values.jupyterlab.podAnnotations }}
  19. annotations:
  20. {{- toYaml . | nindent 8 }}
  21. {{- end }}
  22. labels:
  23. tier: aihub-spark
  24. component: jupyterlab
  25. release: {{ .Release.Name }}
  26. date: "{{ now | unixEpoch }}"
  27. spec:
  28. {{- with .Values.jupyterlab.imagePullSecrets }}
  29. imagePullSecrets:
  30. {{- toYaml . | nindent 8 }}
  31. {{- end }}
  32. securityContext:
  33. {{- toYaml .Values.jupyterlab.podSecurityContext | nindent 8 }}
  34. containers:
  35. - name: {{ .Release.Name }}-jupyterlab
  36. securityContext:
  37. {{- toYaml .Values.securityContext | nindent 12 }}
  38. image: "{{ .Values.jupyterlab.image.repository }}:{{ .Values.jupyterlab.image.tag | default .Chart.AppVersion }}"
  39. imagePullPolicy: {{ .Values.jupyterlab.image.pullPolicy }}
  40. ports:
  41. - name: http
  42. containerPort: 8888
  43. protocol: TCP
  44. volumeMounts:
  45. - name: jupyterlab-data
  46. mountPath: /workspace
  47. - name: {{ .Release.Name }}-sparkmagic-config
  48. mountPath: /root/.sparkmagic/config.json
  49. subPath: config.json
  50. - name: {{ .Release.Name }}-jupyterlab-config
  51. mountPath: /root/.jupyter/jupyter_lab_config.py
  52. subPath: jupyter_lab_config.py
  53. resources:
  54. {{- toYaml .Values.jupyterlab.resources | nindent 12 }}
  55. volumes:
  56. - name: {{ .Release.Name }}-sparkmagic-config
  57. configMap:
  58. name: {{ .Release.Name }}-sparkmagic-config
  59. - name: {{ .Release.Name }}-jupyterlab-config
  60. configMap:
  61. name: {{ .Release.Name }}-jupyterlab-config
  62. {{- if .Values.jupyterlab.persistence.enabled }}
  63. - name: jupyterlab-data
  64. persistentVolumeClaim:
  65. claimName: jupyterlab-data
  66. {{- else }}
  67. - name: jupyterlab-data
  68. emptyDir: {}
  69. {{- end }}
  70. {{- with .Values.jupyterlab.nodeSelector }}
  71. nodeSelector:
  72. {{- toYaml . | nindent 8 }}
  73. {{- end }}
  74. {{- with .Values.jupyterlab.affinity }}
  75. affinity:
  76. {{- toYaml . | nindent 8 }}
  77. {{- end }}
  78. {{- with .Values.jupyterlab.tolerations }}
  79. tolerations:
  80. {{- toYaml . | nindent 8 }}
  81. {{- end }}
  82. {{- end }}