jupyterlab-deployment.yaml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ .Release.Name }}-jupyterlab
  5. labels:
  6. tier: aihub-dag
  7. component: jupyterlab
  8. release: {{ .Release.Name }}
  9. spec:
  10. selector:
  11. matchLabels:
  12. tier: aihub-dag
  13. component: jupyterlab
  14. release: {{ .Release.Name }}
  15. template:
  16. metadata:
  17. {{- with .Values.jupyterlab.podAnnotations }}
  18. annotations:
  19. {{- toYaml . | nindent 8 }}
  20. {{- end }}
  21. labels:
  22. tier: aihub-dag
  23. component: jupyterlab
  24. release: {{ .Release.Name }}
  25. date: "{{ now | unixEpoch }}"
  26. spec:
  27. {{- with .Values.jupyterlab.imagePullSecrets }}
  28. imagePullSecrets:
  29. {{- toYaml . | nindent 8 }}
  30. {{- end }}
  31. securityContext:
  32. {{- toYaml .Values.jupyterlab.podSecurityContext | nindent 8 }}
  33. containers:
  34. - name: {{ .Release.Name }}-jupyterlab
  35. securityContext:
  36. {{- toYaml .Values.securityContext | nindent 12 }}
  37. image: "{{ .Values.jupyterlab.image.repository }}:{{ .Values.jupyterlab.image.tag | default .Chart.AppVersion }}"
  38. imagePullPolicy: {{ .Values.jupyterlab.image.pullPolicy }}
  39. ports:
  40. - name: http
  41. containerPort: 8888
  42. protocol: TCP
  43. volumeMounts:
  44. - name: jupyterlab-data
  45. mountPath: /workspace
  46. subPath: {{ .Values.jupyterlab.config.workspace }}
  47. - name: {{ .Release.Name }}-jupyterlab-config
  48. mountPath: /root/.jupyter/jupyter_lab_config.py
  49. subPath: jupyter_lab_config.py
  50. livenessProbe:
  51. initialDelaySeconds: 30 #延迟加载时间
  52. periodSeconds: 30 #重试时间间隔
  53. timeoutSeconds: 5
  54. failureThreshold: 3
  55. successThreshold: 1
  56. httpGet:
  57. path: {{ .Values.jupyterlab.config.baseUrl }}/lab
  58. port: http
  59. readinessProbe:
  60. initialDelaySeconds: 30 #延迟加载时间
  61. periodSeconds: 5 #重试时间间隔
  62. timeoutSeconds: 5
  63. failureThreshold: 3
  64. successThreshold: 1
  65. httpGet:
  66. path: {{ .Values.jupyterlab.config.baseUrl }}/lab
  67. port: http
  68. resources:
  69. {{- toYaml .Values.jupyterlab.resources | nindent 12 }}
  70. volumes:
  71. - name: jupyterlab-data
  72. persistentVolumeClaim:
  73. claimName: jupyterlab-data0
  74. - name: {{ .Release.Name }}-jupyterlab-config
  75. configMap:
  76. name: {{ .Release.Name }}-jupyterlab-config
  77. {{- with .Values.jupyterlab.nodeSelector }}
  78. nodeSelector:
  79. {{- toYaml . | nindent 8 }}
  80. {{- end }}
  81. {{- with .Values.jupyterlab.affinity }}
  82. affinity:
  83. {{- toYaml . | nindent 8 }}
  84. {{- end }}
  85. {{- with .Values.jupyterlab.tolerations }}
  86. tolerations:
  87. {{- toYaml . | nindent 8 }}
  88. {{- end }}
  89. {{- if .Values.jupyterlab.hostAliases }}
  90. hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.jupyterlab.hostAliases "context" $) | nindent 8 }}
  91. {{- end }}