Merge "Upgrade APPC to use common mariadb galera charts"
[oom.git] / kubernetes / common / mariadb-galera / templates / statefulset.yaml
index b8ba75e..20a0349 100644 (file)
@@ -1,3 +1,17 @@
+# Copyright © 2018 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 apiVersion: apps/v1beta1
 kind: StatefulSet
 metadata:
@@ -9,7 +23,7 @@ metadata:
     release: "{{ .Release.Name }}"
     heritage: "{{ .Release.Service }}"
 spec:
-  serviceName: {{ include "common.fullname" . }}
+  serviceName: {{ .Values.service.name }}
   replicas: {{ .Values.replicaCount }}
   template:
     metadata:
@@ -34,8 +48,8 @@ spec:
       imagePullSecrets:
       - name: {{ include "common.namespace" . }}-docker-registry-key
       containers:
-        - name: {{ include "common.fullname" . }}
-          image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
+        - name: {{ include "common.name" . }}
+          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
           env:
             - name: POD_NAMESPACE
@@ -93,10 +107,9 @@ spec:
 {{- if .Values.persistence.enabled }}
           - mountPath: /var/lib/mysql
             name: {{ include "common.fullname" . }}-data
-            subPath: data
       initContainers:
         - name: mariadb-galera-prepare
-          image: {{ .Values.global.repository | default .Values.repository }}/{{ .Values.imageInit }}
+          image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}"
           command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"]
           volumeMounts:
             - name: {{ include "common.fullname" . }}-data
@@ -104,16 +117,13 @@ spec:
   volumeClaimTemplates:
   - metadata:
       name: {{ include "common.fullname" . }}-data
-      annotations:
-  {{- if .Values.persistence.storageClass }}
-        volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
-  {{- else }}
-        volume.alpha.kubernetes.io/storage-class: default
-  {{- end }}
+      labels:
+        name: {{ include "common.fullname" . }}
     spec:
       accessModes:
       - {{ .Values.persistence.accessMode | quote }}
+      storageClassName: {{ include "common.fullname" . }}-data
       resources:
         requests:
           storage: {{ .Values.persistence.size | quote }}
-{{- end }}
\ No newline at end of file
+{{- end }}