X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fmariadb-galera%2Ftemplates%2Fstatefulset.yaml;h=c3cb4aaaf4c8cc89ffb0ad420d49f1182d467de8;hb=05942430664ddd4a35f830c5e7488ecd4122c83d;hp=5f96ee658e7be75911614ab2f040b6ae2b9d0f2b;hpb=13ffd5d63520ff08d7a3abdf035bbcb38b55e50c;p=oom.git diff --git a/kubernetes/common/mariadb-galera/templates/statefulset.yaml b/kubernetes/common/mariadb-galera/templates/statefulset.yaml index 5f96ee658e..c3cb4aaaf4 100644 --- a/kubernetes/common/mariadb-galera/templates/statefulset.yaml +++ b/kubernetes/common/mariadb-galera/templates/statefulset.yaml @@ -1,4 +1,4 @@ -# Copyright © 2018 Amdocs, Bell Canada +# Copyright © 2019 Amdocs, Bell Canada, Orange # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,12 +23,15 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - serviceName: {{ include "common.fullname" . }} + serviceName: {{ .Values.service.name }} replicas: {{ .Values.replicaCount }} template: metadata: labels: app: {{ include "common.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" annotations: pod.alpha.kubernetes.io/initialized: "true" spec: @@ -40,7 +43,7 @@ spec: {{- if .Values.externalConfig }} - name: config configMap: - name: {{ include "common.fullname" . }}-externalConfig + name: {{ include "common.fullname" . }}-external-config {{- end}} - name: localtime hostPath: @@ -48,7 +51,7 @@ spec: imagePullSecrets: - name: {{ include "common.namespace" . }}-docker-registry-key containers: - - name: {{ include "common.fullname" . }} + - name: {{ include "common.name" . }} image: "{{ include "common.repository" . }}/{{ .Values.image }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}} env: @@ -73,19 +76,20 @@ spec: key: db-root-password ports: - containerPort: {{ .Values.service.internalPort }} - name: {{ .Values.service.name }} + name: {{ .Values.service.portName }} - containerPort: {{ .Values.service.sstPort }} - name: {{ .Values.service.sstName }} + name: {{ .Values.service.sstPortName }} - containerPort: {{ .Values.service.replicationPort }} name: {{ .Values.service.replicationName }} - containerPort: {{ .Values.service.istPort }} - name: {{ .Values.service.istName }} + name: {{ .Values.service.istPortName }} readinessProbe: exec: command: - /usr/share/container-scripts/mysql/readiness-probe.sh initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} periodSeconds: {{ .Values.readiness.periodSeconds }} + timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} {{- if eq .Values.liveness.enabled true }} livenessProbe: exec: @@ -95,7 +99,7 @@ spec: timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} {{- end }} resources: -{{ toYaml .Values.resources | indent 12 }} +{{ include "common.resources" . | indent 12 }} volumeMounts: {{- if .Values.externalConfig }} - mountPath: /etc/config @@ -107,10 +111,10 @@ spec: {{- if .Values.persistence.enabled }} - mountPath: /var/lib/mysql name: {{ include "common.fullname" . }}-data - subPath: data initContainers: - - name: mariadb-galera-prepare + - name: {{ include "common.name" . }}-prepare image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}} command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"] volumeMounts: - name: {{ include "common.fullname" . }}-data @@ -118,15 +122,15 @@ 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" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" spec: accessModes: - {{ .Values.persistence.accessMode | quote }} + storageClassName: {{ include "common.storageClass" . }} resources: requests: storage: {{ .Values.persistence.size | quote }}