X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fcassandra%2Ftemplates%2Fstatefulset.yaml;h=471f88f735f1f7ae67ec52b501a779e440bb58e7;hb=a18e6f219d98a7b13ffd29d15c0345dce8ea2464;hp=2f262ca149d802ee619aad71302625e78c4336e0;hpb=284aa85f5b5b3ad1b13f07d6fee3ed163a22eb13;p=oom.git diff --git a/kubernetes/common/cassandra/templates/statefulset.yaml b/kubernetes/common/cassandra/templates/statefulset.yaml index 2f262ca149..471f88f735 100644 --- a/kubernetes/common/cassandra/templates/statefulset.yaml +++ b/kubernetes/common/cassandra/templates/statefulset.yaml @@ -1,3 +1,4 @@ +{{/* # Copyright © 2018 Amdocs, AT&T, Bell Canada # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,43 +12,27 @@ # 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 +apiVersion: apps/v1 kind: StatefulSet -metadata: - name: {{ include "common.fullname" . }} - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ include "common.release" . }} - heritage: {{ .Release.Service }} +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: - selector: - matchLabels: - app: {{ include "common.name" . }} - release: {{ include "common.release" . }} + selector: {{- include "common.selectors" . | nindent 4 }} serviceName: {{ include "common.servicename" . }} replicas: {{ .Values.replicaCount }} podManagementPolicy: {{ .Values.podManagementPolicy }} updateStrategy: type: {{ .Values.updateStrategy.type }} template: - metadata: - labels: - app: {{ include "common.name" . }} - release: {{ include "common.release" . }} - name: {{ include "common.name" . }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: hostNetwork: {{ .Values.hostNetwork }} containers: - name: {{ include "common.name" . }} - image: {{ .Values.image }} + image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - ports: - {{- range $index, $ports := .Values.service.ports }} - - containerPort: {{ $ports.port }} - {{- end }} + ports: {{ include "common.containerPorts" . | nindent 8 }} volumeMounts: - name: {{ include "common.fullname" . }}-data mountPath: /var/lib/cassandra @@ -65,7 +50,7 @@ spec: {{- if eq .Values.liveness.enabled true }} livenessProbe: exec: - command: + command: - /bin/bash - -c - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }' @@ -115,14 +100,6 @@ spec: value: {{ default "GossipingPropertyFileSnitch" .Values.config.endpoint_snitch | quote }} - name: CASSANDRA_AUTHENTICATOR value: {{ default "PasswordAuthenticator" .Values.config.authenticator | quote }} - {{- if (include "common.serviceMesh" .) }} - - name: CASSANDRA_LISTEN_ADDRESS - value: "127.0.0.1" - - name: CASSANDRA_BROADCAST_ADDRESS - valueFrom: - fieldRef: - fieldPath: status.podIP - {{- end }} - name: POD_IP valueFrom: fieldRef: @@ -135,15 +112,12 @@ spec: {{- else }} command: ["/bin/sh", "-c", "PID=$(pidof java) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"] {{- end }} - resources: -{{ toYaml .Values.resources | indent 10 }} + resources: {{ toYaml .Values.resources | nindent 10 }} {{- if .Values.nodeSelector }} - nodeSelector: -{{ toYaml .Values.nodeSelector | indent 8 }} + nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} {{- end -}} {{- if .Values.affinity }} - affinity: -{{ toYaml .Values.affinity | indent 8 }} + affinity: {{ toYaml .Values.affinity | nindent 8 }} {{- end }} volumes: - name: localtime