-
Notifications
You must be signed in to change notification settings - Fork 415
/
heketi-deployment.yaml
229 lines (216 loc) · 8.15 KB
/
heketi-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
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
225
226
227
228
229
###############################################################################
# Licensed Materials - Property of IBM
# 5737-E67
# (C) Copyright IBM Corporation 2016, 2018 All Rights Reserved
# US Government Users Restricted Rights - Use, duplication or disclosure
# restricted by GSA ADP Schedule Contract with IBM Corp.
################################################################################
{{- include "sch.config.init" (list . "glusterfs.sch.chart.config.values") }}
{{- $heketideployName := .sch.chart.components.heketideploy.name }}
{{- $heketitopocmName := .sch.chart.components.heketitopocm.name }}
{{- $heketicfgcmName := .sch.chart.components.heketicfgcm.name }}
{{- $heketicertsecretName := .sch.chart.components.heketicertsecret.name }}
kind: Deployment
apiVersion: apps/v1
metadata:
name: {{ include "sch.names.fullCompName" (list . $heketideployName) }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "sch.metadata.labels.standard" (list . $heketideployName) | indent 4 }}
glusterfs: "heketi-deployment"
version: "{{ .Values.heketi.image.tag }}"
annotations:
description: Defines how to deploy Heketi
spec:
replicas: 1
selector:
matchLabels:
app: {{ include "sch.names.appName" (list .) }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
glusterfs: "heketi-pod"
template:
metadata:
name: {{ include "sch.names.fullCompName" (list . $heketideployName) }}
labels:
app: {{ include "sch.names.appName" (list .) }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
chart: "{{ .Chart.Name }}"
glusterfs: "heketi-pod"
version: "{{ .Values.heketi.image.tag }}"
annotations:
productName: "Heketi"
productID: "Heketi_{{ .Values.heketi.image.tag }}_free_00000"
productVersion: "{{ .Values.heketi.image.tag }}"
prometheus.io/scheme: "https"
prometheus.io/scrape: "{{ .Values.prometheus.enabled }}"
prometheus.io/path: "{{ .Values.prometheus.path }}"
prometheus.io/port: "{{ .Values.prometheus.port }}"
scheduler.alpha.kubernetes.io/critical-pod: ""
spec:
#serviceAccountName: default
{{- if .Values.podPriorityClass }}
priorityClassName: "{{ .Values.podPriorityClass }}"
{{- end }}
initContainers:
- image: "{{ .Values.preValidation.image.repository }}:{{ .Values.preValidation.image.tag }}"
imagePullPolicy: "{{ .Values.preValidation.image.pullPolicy }}"
name: init-gluster-check
command: ["/gluster-check/is_gluster_daemon_up.sh"]
volumeMounts:
- name: topology
mountPath: "/gluster-check"
- image: "{{ .Values.heketi.image.repository }}:{{ .Values.heketi.image.tag }}"
imagePullPolicy: "{{ .Values.heketi.image.pullPolicy }}"
name: init-heketi
command: ["/topology/heketi-topology-load.sh"]
env:
- name: HEKETI_EXECUTOR
value: kubernetes
- name: HEKETI_FSTAB
value: "/var/lib/heketi/fstab"
- name: HEKETI_SNAPSHOT_LIMIT
value: '14'
- name: HEKETI_KUBE_GLUSTER_DAEMONSET
value: "y"
- name: HEKETI_IGNORE_STALE_OPERATIONS
value: "true"
- name: HEKETI_KUBE_DB_SECRET_NAME
value: "{{ .Values.heketi.backupDbSecret }}"
- name: HEKETI_CLI_SERVER
value: "https://localhost:8080"
ports:
- containerPort: 8080
volumeMounts:
- name: "heketi-db-secret"
mountPath: "/backupdb"
- name: config
mountPath: "/etc/heketi"
- name: topology
mountPath: "/topology"
- name: heketi-tls-cert
mountPath: "/tls-cert"
- image: "{{ .Values.heketi.image.repository }}:{{ .Values.heketi.image.tag }}"
imagePullPolicy: "{{ .Values.heketi.image.pullPolicy }}"
name: verify-topology
command: ["/topology/heketi-topology-verify.sh"]
env:
- name: HEKETI_EXECUTOR
value: kubernetes
- name: HEKETI_FSTAB
value: "/var/lib/heketi/fstab"
- name: HEKETI_SNAPSHOT_LIMIT
value: '14'
- name: HEKETI_KUBE_GLUSTER_DAEMONSET
value: "y"
- name: HEKETI_IGNORE_STALE_OPERATIONS
value: "true"
- name: HEKETI_KUBE_DB_SECRET_NAME
value: "{{ .Values.heketi.backupDbSecret }}"
- name: HEKETI_CLI_SERVER
value: "https://localhost:8080"
ports:
- containerPort: 8080
volumeMounts:
- name: "heketi-db-secret"
mountPath: "/backupdb"
- name: config
mountPath: "/etc/heketi"
- name: topology
mountPath: "/topology"
- name: heketi-tls-cert
mountPath: "/tls-cert"
containers:
- image: "{{ .Values.heketi.image.repository }}:{{ .Values.heketi.image.tag }}"
imagePullPolicy: "{{ .Values.heketi.image.pullPolicy }}"
name: heketi
env:
- name: HEKETI_EXECUTOR
value: kubernetes
- name: HEKETI_FSTAB
value: "/var/lib/heketi/fstab"
- name: HEKETI_SNAPSHOT_LIMIT
value: '14'
- name: HEKETI_KUBE_GLUSTER_DAEMONSET
value: "y"
- name: HEKETI_IGNORE_STALE_OPERATIONS
value: "true"
- name: HEKETI_CLI_SERVER
value: "https://localhost:8080"
- name: HEKETI_MAX_INFLIGHT_OPERATIONS
value: "{{ .Values.heketi.maxInFlightOperations }}"
- name: HEKETI_ADMIN_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.heketi.authSecret }}
key: admin_password
- name: HEKETI_KUBE_DB_SECRET_NAME
value: "{{ .Values.heketi.backupDbSecret }}"
ports:
- containerPort: 8080
volumeMounts:
- name: "heketi-db-secret"
mountPath: "/backupdb/heketi.db.gz"
subPath: heketi.db.gz
- name: config
mountPath: "/etc/heketi"
- name: heketi-tls-cert
mountPath: "/tls-cert"
readinessProbe:
timeoutSeconds: 3
initialDelaySeconds: 10
httpGet:
path: "/hello"
port: 8080
scheme: HTTPS
livenessProbe:
timeoutSeconds: 3
initialDelaySeconds: 30
httpGet:
path: "/hello"
port: 8080
scheme: HTTPS
resources:
{{ toYaml .Values.heketi.resources| indent 12 }}
volumes:
- name: topology
configMap:
name: {{ include "sch.names.fullCompName" (list . $heketitopocmName) }}
defaultMode: 0744
- name: heketi-db-secret
secret:
defaultMode: 420
secretName: "{{ .Values.heketi.backupDbSecret }}"
- name: config
configMap:
name: {{ include "sch.names.fullCompName" (list . $heketicfgcmName) }}
defaultMode: 420
items:
- key: heketi.json
path: heketi.json
- name: heketi-tls-cert
secret:
defaultMode: 420
{{- if .Values.heketi.tls.generate }}
secretName: {{ include "sch.names.fullCompName" (list . $heketicertsecretName) }}
{{- else }}
secretName: {{ .Values.heketi.tls.secretName }}
{{- end }}
items:
- key: tls.key
path: tls.key
- key: tls.crt
path: tls.crt
nodeSelector:
{{ .Values.nodeSelector.key }}: {{ .Values.nodeSelector.value }}
affinity:
{{- include "nodeaffinity" . | indent 6 }}
tolerations:
- key: dedicated
operator: Exists
- key: CriticalAddonsOnly
operator: Exists
{{- with .Values.tolerations }}
{{ toYaml . | indent 8 }}
{{- end }}