X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fmariadb-galera%2Ftemplates%2Fstatefulset.yaml;h=6dc5a7aad61ec686086c455c16b2de5ab6b5b6bb;hb=91fc6a9db5da0ab60325e1f83b3f6310e185044a;hp=b8ba75e52c824f2971d2845fbb3c0c322b0b4dc3;hpb=b2e4ea650381d9e109c23a9fe51980655500fb29;p=oom.git diff --git a/kubernetes/common/mariadb-galera/templates/statefulset.yaml b/kubernetes/common/mariadb-galera/templates/statefulset.yaml index b8ba75e52c..6dc5a7aad6 100644 --- a/kubernetes/common/mariadb-galera/templates/statefulset.yaml +++ b/kubernetes/common/mariadb-galera/templates/statefulset.yaml @@ -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,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: @@ -26,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: @@ -34,8 +51,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 @@ -59,13 +76,13 @@ 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: @@ -81,7 +98,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 @@ -93,10 +110,10 @@ 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 }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}} command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"] volumeMounts: - name: {{ include "common.fullname" . }}-data @@ -104,16 +121,19 @@ 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.fullname" . }}-data resources: requests: storage: {{ .Values.persistence.size | quote }} -{{- end }} \ No newline at end of file + selector: + matchLabels: + name: {{ include "common.fullname" . }} +{{- end }}