Merge "Set aai&music Cassandra readiness periodSeconds"
[oom.git] / kubernetes / aai / charts / aai-cassandra / templates / statefulset.yaml
index aa3482d..bd62c56 100644 (file)
@@ -1,3 +1,17 @@
+# Copyright © 2018 Amdocs, Bell Canada, AT&T
+#
+# 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: {{ include "common.servicename" . }}
   replicas: {{ .Values.replicaCount }}
   podManagementPolicy: {{ .Values.podManagementPolicy }}
   updateStrategy:
@@ -29,7 +43,6 @@ spec:
         - containerPort: {{ .Values.service.internalPort }}
         - containerPort: {{ .Values.service.internalPort2 }}
         - containerPort: {{ .Values.service.internalPort3 }}
-        - containerPort: {{ .Values.service.internalPort4 }}
         {{- if eq .Values.liveness.enabled true }}
         livenessProbe:
           exec:
@@ -47,7 +60,7 @@ spec:
             - -c
             - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
-          timeoutSeconds: {{ .Values.liveness.periodSeconds }}
+          periodSeconds: {{ .Values.readiness.periodSeconds }}
         lifecycle:
           preStop:
             exec:
@@ -60,7 +73,7 @@ spec:
           - name: HEAP_NEWSIZE
             value: {{ .Values.config.heap.min }}
           - name: CASSANDRA_SEEDS
-            value: "{{- range $i, $e := until $seed_size }}{{ template "common.fullname" $global }}-{{ $i }},{{- end }}"
+            value: "{{- range $i, $e := until $seed_size }}{{ template "common.fullname" $global }}-{{ $i }}.{{ include "common.servicename" $global }},{{- end }}"
           - name: JVM_OPTS
             value: {{ .Values.config.jvmOpts | quote }}
           - name: CASSANDRA_CLUSTER_NAME
@@ -77,9 +90,9 @@ spec:
                 fieldPath: status.podIP
         volumeMounts:
           - name: cassandra-data
-            mountPath: /var/lib/cassandra/data
+            mountPath: /var/lib/cassandra
         resources:
-{{ toYaml .Values.resources | indent 10 }}
+{{ include "common.resources" . | indent 10 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
@@ -112,4 +125,8 @@ spec:
         resources:
           requests:
             storage: {{ .Values.persistence.size | quote }}
+        selector:
+          matchLabels:
+            app: {{ include "common.name" . }}
+            release: "{{ .Release.Name }}"
   {{- end }}