X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fportal%2Fcharts%2Fportal-cassandra%2Ftemplates%2Fdeployment.yaml;h=2040794074bcb9cf16d84aa0b6a67b80b02c679f;hb=adcb8dc1051d0767a0930c7bab37523d6dcbbf11;hp=91c4fa4140fe55680345f842e629e17eab042896;hpb=a57d055fa31650fcdeadc8514a1f9f551be395c0;p=oom.git diff --git a/kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml b/kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml index 91c4fa4140..2040794074 100644 --- a/kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml +++ b/kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml @@ -1,4 +1,5 @@ # Copyright © 2017 Amdocs, Bell Canada +# Modifications Copyright © 2018 AT&T # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,7 +33,7 @@ spec: spec: containers: - name: {{ include "common.name" . }} - image: {{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }} + image: "{{ include "common.repository" . }}/{{ .Values.image }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} ports: - containerPort: {{ .Values.service.internalPort }} @@ -40,38 +41,46 @@ spec: - containerPort: {{ .Values.service.internalPort3 }} - containerPort: {{ .Values.service.internalPort4 }} - containerPort: {{ .Values.service.internalPort5 }} - {{- if eq .Values.liveness.enabled true }} + {{ if eq .Values.liveness.enabled true }} livenessProbe: - tcpSocket: - port: {{ .Values.service.internalPort }} + exec: + command: + - /bin/bash + - -c + - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }' initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} periodSeconds: {{ .Values.liveness.periodSeconds }} - {{end -}} + {{ end }} readinessProbe: - tcpSocket: - port: {{ .Values.service.internalPort }} + exec: + command: + - /bin/bash + - -c + - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }' initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} periodSeconds: {{ .Values.readiness.periodSeconds }} env: - name: CASSUSER value: "{{ .Values.config.cassandraUsername }}" - name: CASSPASS + value: "{{ .Values.config.cassandraPassword }}" + - name: JVM_OPTS + value: "{{ .Values.config.cassandraJvmOpts }}" + - name: POD_IP valueFrom: - secretKeyRef: - name: {{ template "common.fullname" . }} - key: db-root-password + fieldRef: + fieldPath: status.podIP volumeMounts: - mountPath: /etc/localtime name: localtime readOnly: true - name: cassandra-docker-entrypoint-initdb - mountPath: /docker-entrypoint-initdb.d/zzz_portal.cql - subPath: portal.cql - - name: cassandra-docker-entrypoint-initdb - mountPath: /docker-entrypoint-initdb.d/zzz_portalsdk.cql - subPath: portalsdk.cql + mountPath: /docker-entrypoint-initdb.d/aaa_portal_single.cql + subPath: portal_single.cql + - name: {{ include "common.fullname" . }}-data + mountPath: /var/lib/cassandra/data resources: -{{ toYaml .Values.resources | indent 12 }} +{{ include "common.resources" . | indent 12 }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 10 }} @@ -87,5 +96,12 @@ spec: - name: localtime hostPath: path: /etc/localtime + {{- if .Values.persistence.enabled }} + - name: {{ include "common.fullname" . }}-data + persistentVolumeClaim: + claimName: {{ include "common.fullname" . }} + {{- else }} + emptyDir: {} + {{- end }} imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key"