-
Notifications
You must be signed in to change notification settings - Fork 221
/
deployment.yaml
143 lines (141 loc) · 4.94 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
{{- if .Values.deployment.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: enterprise-gateway
namespace: {{ .Release.Namespace }}
labels:
gateway-selector: enterprise-gateway
app: enterprise-gateway
component: enterprise-gateway
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- range $key, $val := .Values.global.commonLabels }}
{{ $key }}: "{{ $val }}"
{{- end }}
spec:
replicas: {{ .Values.deployment.replicas }}
selector:
matchLabels:
gateway-selector: enterprise-gateway
template:
metadata:
labels:
gateway-selector: enterprise-gateway
app: enterprise-gateway
component: enterprise-gateway
{{- range $key, $val := .Values.global.commonLabels }}
{{ $key }}: "{{ $val }}"
{{- end }}
spec:
# Created by this chart.
serviceAccountName: {{ .Values.deployment.serviceAccountName }}
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }}
{{- if .Values.kernelspecs.image }}
initContainers:
- name: kernelspecs
image: {{ .Values.kernelspecs.image }}
imagePullPolicy: {{ .Values.kernelspecs.imagePullPolicy }}
args: ["cp", "-r", "/kernels", "/usr/local/share/jupyter"]
volumeMounts:
- name: image-kernelspecs
mountPath: "/usr/local/share/jupyter/kernels"
{{- end }}
containers:
- name: enterprise-gateway
image: {{ .Values.image }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
env:
- name: EG_PORT
{{ with index .Values.service.ports 0 }}
value: !!str {{ .port }}
{{- end }}
- name: EG_RESPONSE_PORT
{{ with index .Values.service.ports 1 }}
value: !!str {{ .port }}
{{- end }}
- name: EG_NAMESPACE
value: {{ .Release.Namespace }}
- name: EG_KERNEL_CLUSTER_ROLE
value: {{ .Values.kernel.clusterRole }}
- name: EG_SHARED_NAMESPACE
value: {{ if .Values.kernel.shareGatewayNamespace }}"True"{{ else }}"False"{{ end }}
- name: EG_MIRROR_WORKING_DIRS
value: {{ if .Values.mirrorWorkingDirs }}"True"{{ else }}"False"{{ end }}
- name: EG_CULL_IDLE_TIMEOUT
value: !!str {{ .Values.kernel.cullIdleTimeout }}
- name: EG_CULL_CONNECTED
value: {{ if .Values.kernel.cullConnected }}"True"{{ else }}"False"{{ end }}
- name: EG_LOG_LEVEL
value: {{ .Values.logLevel }}
- name: EG_KERNEL_LAUNCH_TIMEOUT
value: !!str {{ .Values.kernel.launchTimeout }}
- name: EG_KERNEL_INFO_TIMEOUT
value: !!str {{ .Values.kernel.infoTimeout }}
- name: EG_ALLOWED_KERNELS
value: {{ toJson .Values.kernel.allowedKernels | squote }}
- name: EG_DEFAULT_KERNEL_NAME
value: {{ .Values.kernel.defaultKernelName }}
# Optional authorization token passed in all requests
{{- if .Values.authToken }}
- name: EG_AUTH_TOKEN
value: {{ .Values.authToken }}
{{- end }}
{{- if .Values.deployment.extraEnv }}
{{- range $key, $val := .Values.deployment.extraEnv }}
- name: {{ $key }}
value: |-
{{ $val | indent 12 }}
{{- end }}
{{- end }}
ports:
{{ with index .Values.service.ports 0 }}
- containerPort: {{ .port }}
{{- end }}
{{ with index .Values.service.ports 1 }}
- containerPort: {{ .port }}
{{- end }}
{{- if .Values.deployment.resources }}
resources:
{{- toYaml .Values.deployment.resources | nindent 10 }}
{{- end }}
{{- if .Values.nfs.enabled }}
volumeMounts:
- name: nfs-kernelspecs
mountPath: "/usr/local/share/jupyter/kernels"
volumes:
- name: nfs-kernelspecs
nfs:
server: {{ .Values.nfs.internalServerIPAddress }}
path: "/usr/local/share/jupyter/kernels"
{{- else if .Values.kernelspecsPvc.enabled }}
volumeMounts:
- name: pvc-kernelspecs
mountPath: "/usr/local/share/jupyter/kernels"
volumes:
- name: pvc-kernelspecs
persistentVolumeClaim:
claimName: {{ .Values.kernelspecsPvc.name }}
{{- else if .Values.kernelspecs.image }}
volumeMounts:
- name: image-kernelspecs
mountPath: "/usr/local/share/jupyter/kernels"
volumes:
- name: image-kernelspecs
emptyDir:
medium: Memory
{{- end }}
{{- if .Values.deployment.tolerations }}
tolerations:
{{- toYaml .Values.deployment.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.deployment.nodeSelector }}
nodeSelector:
{{- toYaml .Values.deployment.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.deployment.affinity }}
affinity:
{{- toYaml .Values.deployment.affinity | nindent 8 }}
{{- end }}
{{- end }}