summaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mariadb-galera/resources/create-deployment.yml
diff options
context:
space:
mode:
authortringuyen <tri.nguyen@tatacommunications.com>2020-04-01 17:51:06 +0000
committertringuyen <tri.nguyen@tatacommunications.com>2020-06-05 05:01:56 +0000
commiteb9eb59171a43d25fb012aaad0a1d37ca86bc2bf (patch)
treeaa88cc401491d5251abfe9193ab5fd6163d4ffae /kubernetes/common/mariadb-galera/resources/create-deployment.yml
parentaf7fd0ed77933189c1f2263e078c38e4c65f4c86 (diff)
[COMMON] add pre upgrade script for mariadb-galera
When upgrading from a version to another, it may be impossible to do it "simply" because of changes in immutable properties of statefulsets. We change that here by creating a temporary deployment which will hold the whole databases during the time the old statefulset gets destroyed and the new one gets created. Issue-ID: OOM-2316 Signed-off-by: tringuyen <tri.nguyen@tatacommunications.com> Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com> Change-Id: I318d72830d5002f50597e23e0753e292f8b47c53
Diffstat (limited to 'kubernetes/common/mariadb-galera/resources/create-deployment.yml')
-rw-r--r--kubernetes/common/mariadb-galera/resources/create-deployment.yml50
1 files changed, 50 insertions, 0 deletions
diff --git a/kubernetes/common/mariadb-galera/resources/create-deployment.yml b/kubernetes/common/mariadb-galera/resources/create-deployment.yml
new file mode 100644
index 0000000000..61bfc78945
--- /dev/null
+++ b/kubernetes/common/mariadb-galera/resources/create-deployment.yml
@@ -0,0 +1,50 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata: {{- include "common.resourceMetadata" (dict "suffix" "upgrade-deployment" "dot" .) | nindent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ include "common.fullname" . }}
+ template:
+ metadata:
+ labels:
+ app: {{ include "common.fullname" . }}
+ spec:
+ containers:
+ - name: {{ include "common.name" . }}
+ image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+ ports:
+ - containerPort: {{ .Values.service.internalPort }}
+ name: {{ .Values.service.portName }}
+ - containerPort: {{ .Values.service.sstPort }}
+ name: {{ .Values.service.sstPortName }}
+ - containerPort: {{ .Values.service.replicationPort }}
+ name: {{ .Values.service.replicationName }}
+ - containerPort: {{ .Values.service.istPort }}
+ name: {{ .Values.service.istPortName }}
+ env:
+ - name: POD_NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ - name: MYSQL_USER
+ valueFrom:
+ secretKeyRef:
+ key: login
+ name: {{ include "common.fullname" . }}-temp-upgrade-usercred
+ - name: MYSQL_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ key: password
+ name: {{ include "common.fullname" . }}-temp-upgrade-usercred
+ - name: MYSQL_DATABASE
+ value: {{ default "" .Values.config.mysqlDatabase | quote }}
+ - name: MYSQL_ROOT_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ key: password
+ name: {{ include "common.fullname" . }}-temp-upgrade-root
+ subdomain: {{ .Values.service.name }}
+ hostname: {{ .Values.nameOverride }}-upgrade-deployment \ No newline at end of file