Newer
Older
{{- $fullName := include "library-chart.fullname" . -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "library-chart.fullname" . }}
labels:
{{- include "library-chart.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
serviceName: {{ include "library-chart.fullname" . }}
selector:
matchLabels:
{{- include "library-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- if .Values.git.enabled }}
checksum/git: {{ include (print $.Template.BasePath "/configmap-git.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.s3.enabled }}
checksum/s3: {{ include (print $.Template.BasePath "/configmap-s3.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.vault.enabled }}
checksum/vault: {{ include (print $.Template.BasePath "/configmap-vault.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.proxyRepository.enabled }}
checksum/proxyRepository: {{ include (print $.Template.BasePath "/configmap-proxy-repository.yaml") . | sha256sum }}
{{- end }}
{{- if not (empty (trim (include "library-chart.configMapMLFlow" .)))}}
checksum/mlflow: {{ include (print $.Template.BasePath "/configmap-mlflow.yaml") . | sha256sum }}
{{- end }}
{{- if not (empty (trim (include "library-chart.configMapHive" .)))}}
checksum/hive: {{ include (print $.Template.BasePath "/configmap-hive.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.podAnnotations }}
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
labels:
{{- include "library-chart.selectorLabels" . | nindent 8 }}
spec:
volumes:
- name: home
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "library-chart.fullname" .) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.discovery.hive }}
- name: hive-config
configMap:
name: {{ include "library-chart.configMapNameHive" . }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "library-chart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
subdomain: {{ include "library-chart.fullname" . }}
hostname: jupyter
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- if .Values.service.image.custom.enabled }}
image: "{{ .Values.service.image.custom.version }}"
{{- else }}
image: "{{ .Values.service.image.version }}"
{{- end }}
command: ["/bin/sh","-c"]
args: ["{{ .Values.init.standardInitPath }} jupyter lab --no-browser --ip '0.0.0.0' --LabApp.token='$(PASSWORD)' --ContentsManager.allow_hidden=True"]
imagePullPolicy: {{ .Values.service.image.pullPolicy }}
env:
- name: KUBERNETES_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: IMAGE_NAME
{{- if .Values.service.image.custom.enabled }}
value: "{{ .Values.service.image.custom.version }}"
{{- else }}
value: "{{ .Values.service.image.version }}"
{{- end }}
- name: NB_USER
value: {{ .Values.environment.user }}
- name: PASSWORD
value: {{ .Values.security.password }}
- name: PROJECT_USER
value: {{ .Values.environment.user }}
- name: PROJECT_GROUP
value: {{ .Values.environment.group }}
- name: ROOT_PROJECT_DIRECTORY
value: /home/{{ .Values.environment.user }}/work
{{- if .Values.init.regionInit }}
- name: REGION_INIT_SCRIPT
value: {{ .Values.init.regionInit }}
{{- end }}
{{- if .Values.init.personalInit }}
- name: PERSONAL_INIT_SCRIPT
value: {{ .Values.init.personalInit }}
{{- end }}
{{- if .Values.init.personalInitArgs }}
- name: PERSONAL_INIT_ARGS
value: {{ .Values.init.personalInitArgs }}
{{- end }}
{{- if .Values.environment.root }}
- name: GRANT_SUDO
value: "yes"
{{- end }}
envFrom:
{{- if .Values.s3.enabled }}
- configMapRef:
name: {{ include "library-chart.configMapNameS3" . }}
{{- end }}
{{- if .Values.vault.enabled }}
- configMapRef:
name: {{ include "library-chart.configMapNameVault" . }}
{{- end }}
{{- if .Values.git.enabled }}
- configMapRef:
name: {{ include "library-chart.configMapNameGit" . }}
{{- end }}
{{- if .Values.proxyRepository.enabled }}
- configMapRef:
name: {{ include "library-chart.configMapNameProxyRepository" . }}
{{- end }}
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{{- if not (empty (trim (include "library-chart.configMapMLFlow" .)))}}
- configMapRef:
name: {{ include "library-chart.configMapNameMLFlow" . }}
{{- end }}
ports:
- name: http
containerPort: 8888
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
startupProbe:
httpGet:
path: /
port: http
{{- toYaml .Values.startupProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /home/{{ .Values.environment.user}}/work
name: home
{{- if .Values.discovery.hive }}
- name: hive-config
mountPath: /opt/hive/conf/hive-site.xml
subPath: hive-site.xml
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}