Newer
Older
metadata:
name: {{ include "jupyter-control-notebook-chart.fullname" . }}
labels:
{{- include "jupyter-control-notebook-chart.labels" . | nindent 4 }}
spec:
serviceName: "jupyter-notebook"
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "jupyter-control-notebook-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "jupyter-control-notebook-chart.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ .Values.serviceAccountName | quote }}
{{- end }}
securityContext:
initContainers:
- name: fix-permissions
image: baltig.infn.it:4567/epics-containers/container-init
command:
- sh
- -c
- |
mountdir=/home/jovyan
cd $mountdir
url="{{ .Values.gitRepoConfig.url }}"
echo "ID: $id git $url"
if [ -n "$url" ]; then
clone_dir=$(basename "$url" .git)
echo "* git directory $clone_dir"
cd $clone_dir
git pull --recurse-submodules
else
if [ -n "{{ .Values.gitRepoConfig.branch }}" ]; then
git clone -b {{ .Values.gitRepoConfig.branch }} {{ .Values.gitRepoConfig.url }} --recurse-submodules
git clone {{ .Values.gitRepoConfig.url }} --recurse-submodules
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: jupyter-data
mountPath: /home/jovyan/work
{{- range .Values.nfsMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- end }}
stdin: {{ .Values.image.stdinOpen }}
tty: {{ .Values.image.tty }}
{{- if .Values.epicsConfiguration.name }}
envFrom:
- configMapRef:
name: {{ .Values.epicsConfiguration.name }}
{{- end }}
env:
- name: NOTEBOOK_ARGS
value: "--PasswordIdentityProvider.hashed_password={{ .Values.hashedpass }}"
- name: JUPYTER_SERVER_URL
value: "http://127.0.0.1:8888"
{{- if .Values.epicsConfiguration.gateway }}
- name: EPICS_CA_ADDR_LIST
value: {{ .Values.epicsConfiguration.gateway | quote }}
- name: EPICS_CA_AUTO_ADDR_LIST
value: "NO"
{{- end }}
{{- range .Values.nfsMounts }}
- name: {{ .name | upper }}_SERVER
value: {{ .server | quote }}
- name: {{ .name | upper }}_SERVER_PATH
value: {{ .path | quote }}
- name: {{ .name | upper }}_DIR
value: {{ .mountPath | quote }}
{{- end }}
ports:
- name: http
containerPort: 8888
protocol: TCP
command:
- sh
- -c
- |
mkdir -p {{ .mountPath }}/{{ include "jupyter-control-notebook-chart.fullname" . }}
echo "Starting Notebook"
{{- range .Values.pip }}
echo "installing {{.}}"
pip install {{.}}
{{- end }}
tini -g -- start.sh /usr/local/bin/start-notebook.py
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
- name: {{ .name }}
nfs:
server: {{ .server }}
path: {{ .path }}
- name: jupyter-data
persistentVolumeClaim:
claimName: {{ .Values.dataVolume.claim }}