jupyterlab
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "jupyterlab.name" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "jupyterlab.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ include "jupyterlab.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "jupyterlab.labels" . | nindent 8 }}
|
||||
spec:
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
fsGroup: 100
|
||||
{{- if .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: jupyterlab
|
||||
image: {{ include "jupyterlab.image" . | quote }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
command:
|
||||
{{- include "jupyterlab.command" . | nindent 12 }}
|
||||
ports:
|
||||
- containerPort: 8888
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: NVIDIA_DRIVER_CAPABILITIES
|
||||
value: "compute,utility"
|
||||
resources:
|
||||
limits:
|
||||
cpu: {{ .Values.resources.limits.cpu | quote }}
|
||||
memory: {{ .Values.resources.limits.memory | quote }}
|
||||
{{- if .Values.resources.gpu }}
|
||||
nvidia.com/gpu: {{ .Values.resources.gpu | quote }}
|
||||
{{- end }}
|
||||
requests:
|
||||
cpu: {{ .Values.resources.requests.cpu | quote }}
|
||||
memory: {{ .Values.resources.requests.memory | quote }}
|
||||
{{- if .Values.resources.gpu }}
|
||||
nvidia.com/gpu: {{ .Values.resources.gpu | quote }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: 8888
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 27
|
||||
volumeMounts:
|
||||
- name: localtime
|
||||
mountPath: /etc/localtime
|
||||
readOnly: true
|
||||
- name: startup-script
|
||||
mountPath: /usr/local/bin/start-notebook.d/startup-script.sh
|
||||
subPath: startup-script.sh
|
||||
{{- if .Values.homeVolume.enabled }}
|
||||
- name: home-volume
|
||||
mountPath: {{ include "jupyterlab.homeDir" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.dataVolume.enabled }}
|
||||
- name: data-volume
|
||||
mountPath: {{ include "jupyterlab.dataDir" . }}
|
||||
{{- end }}
|
||||
{{- range .Values.groupVolumes }}
|
||||
- name: gv-{{ .claimName }}
|
||||
mountPath: {{ .mountPath }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: localtime
|
||||
hostPath:
|
||||
path: /usr/share/zoneinfo/Asia/Seoul
|
||||
- name: startup-script
|
||||
configMap:
|
||||
name: {{ include "jupyterlab.configMapName" . }}
|
||||
defaultMode: 0755
|
||||
{{- if .Values.homeVolume.enabled }}
|
||||
- name: home-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "jupyterlab.homePvcName" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.dataVolume.enabled }}
|
||||
- name: data-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "jupyterlab.dataPvcName" . }}
|
||||
{{- end }}
|
||||
{{- range .Values.groupVolumes }}
|
||||
- name: gv-{{ .claimName }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .claimName }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user