[COMMON] add pre upgrade script for mariadb-galera
[oom.git] / kubernetes / aaf / charts / aaf-sms / charts / aaf-sms-quorumclient / templates / statefulset.yaml
1 # Copyright 2018 Intel Corporation, Inc
2 # Modifications © 2020 AT&T
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 apiVersion: apps/v1beta1
17 kind: StatefulSet
18 metadata:
19   name: {{ include "common.fullname" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ include "common.release" . }}
25     heritage: {{ .Release.Service }}
26 spec:
27   replicas: {{ .Values.replicaCount }}
28   serviceName:
29   template:
30     metadata:
31       labels:
32         app: {{ include "common.name" . }}
33         release: {{ include "common.release" . }}
34     spec:
35       imagePullSecrets:
36       - name: "{{ include "common.namespace" . }}-docker-registry-key"
37 {{- if .Values.persistence.enabled }}
38       initContainers:
39         - name: fix-permission
40           command:
41             - /bin/sh
42           args:
43             - -c
44             - |
45               chmod -R 775 /quorumclient/auth
46               chown -R 100:1000 /quorumclient/auth
47           image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
48           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49           volumeMounts:
50             - mountPath: /quorumclient/auth
51               name: {{ include "common.fullname" . }}-data
52 {{- end }}
53       containers:
54       - image: "{{ include "common.repository" . }}/{{ .Values.image }}"
55         name: {{ include "common.name" . }}
56         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57         command: ["/quorumclient/bin/quorumclient"]
58         workingDir: /quorumclient/
59         volumeMounts:
60           - mountPath: /etc/localtime
61             name: localtime
62             readOnly: true
63           - mountPath: /quorumclient/config.json
64             name: {{ include "common.name" .}}
65             subPath: config.json
66 {{- if .Values.persistence.enabled }}
67           - mountPath: /quorumclient/auth
68             name: {{ include "common.fullname" . }}-data
69 {{- end }}
70         resources:
71 {{ include "common.resources" . | indent 10 }}
72         {{- if .Values.nodeSelector }}
73         nodeSelector:
74 {{ toYaml .Values.nodeSelector | indent 10 }}
75         {{- end -}}
76         {{- if .Values.affinity }}
77         affinity:
78 {{ toYaml .Values.affinity | indent 10 }}
79         {{- end }}
80       volumes:
81       - name: localtime
82         hostPath:
83           path: /etc/localtime
84       - name : {{ include "common.name" . }}
85         configMap:
86           name: {{ include "common.fullname" . }}
87           items:
88           - key: config.json
89             path: config.json
90             mode: 0755
91 {{- if .Values.persistence.enabled }}
92   volumeClaimTemplates:
93   - metadata:
94       name: {{ include "common.fullname" . }}-data
95       labels:
96         name: {{ include "common.fullname" . }}
97         chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
98         release: "{{ include "common.release" . }}"
99         heritage: "{{ .Release.Service }}"
100     spec:
101       accessModes:
102       - {{ .Values.persistence.accessMode | quote }}
103       storageClassName: {{ include "common.storageClass" . }}
104       resources:
105         requests:
106           storage: {{ .Values.persistence.size | quote }}
107 {{- end }}