-
Notifications
You must be signed in to change notification settings - Fork 3
/
statefulset.yaml
224 lines (223 loc) · 7.92 KB
/
statefulset.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "actinia.fullname" . }}
labels:
{{- include "actinia.labels" . | nindent 4 }}
spec:
serviceName: {{ include "actinia.fullname" . }}
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "actinia.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "actinia.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "actinia.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: download-data
image: alpine:3.13
command: ["/bin/sh","/mnt/init-data.sh"]
volumeMounts:
- name: temp
mountPath: /mnt/download
- name: init-configmap
mountPath: /mnt/
{{- if .Values.persistence.useExistingClaim }}
- name: existingclaim
mountPath: /actinia_core/grassdb/
subPath: {{ .Values.persistence.grassdb.subPath }}
{{- else }}
- name: grassdb
mountPath: /actinia_core/grassdb/
{{- if .Values.persistence.grassdb.subPath }}
subPath: {{ .Values.persistence.grassdb.subPath }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ['sh']
args: ['/src/start/start.sh']
env:
- name: DEFAULT_CONFIG_PATH
value: /etc/default/actinia-config/actinia.cfg
- name: REDIS_SERVER_PW
{{- if .Values.config.redis.password }}
value: {{ .Values.config.redis.password }}
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "actinia.fullname" . }}-redis
key: redis-password
{{- end }}
ports:
- name: actinia-tcp
containerPort: 8088
protocol: TCP
livenessProbe:
httpGet:
path: /api/v3/health_check
port: actinia-tcp
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 10
readinessProbe:
httpGet:
path: /api/v3/health_check
port: actinia-tcp
timeoutSeconds: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: startup
mountPath: /src/start
- name: config
mountPath: /etc/default/actinia-config
- name: secret
mountPath: /mnt/pgpass/
- name: actinia-worker-workspace
mountPath: /actinia_core/workspace/
{{- if .Values.persistence.customVolume.enabled }}
- name: customvolume
mountPath: {{ .Values.persistence.customVolume.mountPath }}
readOnly: {{ .Values.persistence.customVolume.readOnly }}
subPath: {{ .Values.persistence.customVolume.subPath }}
{{- end }}
{{- if .Values.persistence.useExistingClaim }}
- name: existingclaim
mountPath: /actinia_core/grassdb/
subPath: {{ .Values.persistence.grassdb.subPath }}
- name: existingclaim
mountPath: /actinia_core/userdata/
subPath: {{ .Values.persistence.userdata.subPath }}
- name: existingclaim
mountPath: /actinia_core/resources/
subPath: {{ .Values.persistence.resources.subPath }}
- name: existingclaim
mountPath: /mnt/geodata/
subPath: {{ .Values.persistence.geodata.subPath }}
{{- else }}
- name: grassdb
mountPath: /actinia_core/grassdb/
{{- if .Values.persistence.grassdb.subPath }}
subPath: {{ .Values.persistence.grassdb.subPath }}
{{- end }}
- name: userdata
mountPath: /actinia_core/userdata/
{{- if .Values.persistence.userdata.subPath }}
subPath: {{ .Values.persistence.userdata.subPath }}
{{- end }}
- name: resources
mountPath: /actinia_core/resources/
{{- if .Values.persistence.resources.subPath }}
subPath: {{ .Values.persistence.resources.subPath }}
{{- end }}
- name: geodata
mountPath: /mnt/geodata/
{{- if .Values.persistence.geodata.subPath }}
subPath: {{ .Values.persistence.geodata.subPath }}
{{- end }}
{{- end }}
volumes:
- name: temp
emptyDir: {}
{{- if .Values.persistence.customVolume.enabled }}
- name: customvolume
persistentVolumeClaim:
claimName: {{ .Values.persistence.customVolume.claimName }}
{{- end }}
- name: init-configmap
configMap:
name: {{ include "actinia.fullname" . }}
items:
- key: init-data.sh
path: init-data.sh
{{- if .Values.persistence.enabled }}
{{- if .Values.persistence.useExistingClaim }}
- name: existingclaim
persistentVolumeClaim:
claimName: {{ .Values.persistence.claimName }}
{{- else }}
- name: grassdb
persistentVolumeClaim:
claimName: {{ include "actinia.fullname" . }}-grassdb
- name: userdata
persistentVolumeClaim:
claimName: {{ include "actinia.fullname" . }}-userdata
- name: resources
persistentVolumeClaim:
claimName: {{ include "actinia.fullname" . }}-resources
- name: geodata
persistentVolumeClaim:
claimName: {{ include "actinia.fullname" . }}-geodata
{{- end }}
{{- else }}
- name: grassdb
emptyDir: {}
- name: userdata
emptyDir: {}
- name: resources
emptyDir: {}
- name: geodata
emptyDir: {}
- name: actinia-worker-workspace
emptyDir: {}
{{- end }}
- name: startup
configMap:
name: {{ include "actinia.fullname" . }}
items:
- key: start.sh
path: start.sh
- name: config
configMap:
name: {{ include "actinia.fullname" . }}
items:
- key: actinia-core-config
path: actinia.cfg
- name: secret
secret:
secretName: {{ include "actinia.fullname" . }}
items:
- key: .pgpass
path: .pgpass
- key: .grass8
path: .grass8
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: actinia-worker-workspace
spec:
accessModes:
- {{ .Values.persistence.actiniaWorkerWorkspace.accessMode }}
{{- if not ( eq .Values.persistence.actiniaWorkerWorkspace.storageClassName "default" ) }}
storageClassName: {{ .Values.persistence.actiniaWorkerWorkspace.storageClassName }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.actiniaWorkerWorkspace.storageSize }}
{{- end }}