1 # Copyright © 2018 Amdocs, Bell Canada, AT&T
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 apiVersion: apps/v1beta1
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
26 serviceName: {{ include "common.servicename" . }}
27 replicas: {{ .Values.replicaCount }}
28 podManagementPolicy: {{ .Values.podManagementPolicy }}
30 type: {{ .Values.updateStrategy.type }}
34 app: {{ include "common.name" . }}
35 release: {{ .Release.Name }}
36 name: {{ include "common.name" . }}
39 - name: {{ include "common.name" . }}
40 image: {{ .Values.image }}
41 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 - containerPort: {{ .Values.service.internalPort }}
44 - containerPort: {{ .Values.service.internalPort2 }}
45 - containerPort: {{ .Values.service.internalPort3 }}
46 {{- if eq .Values.liveness.enabled true }}
52 - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
53 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
54 periodSeconds: {{ .Values.liveness.periodSeconds }}
61 - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
62 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
63 periodSeconds: {{ .Values.readiness.periodSeconds }}
67 command: ["/bin/sh", "-c", "PID=$(pidof java) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"]
69 {{- $seed_size := default 1 .Values.replicaCount | int -}}
72 value: {{ .Values.config.heap.max }}
74 value: {{ .Values.config.heap.min }}
75 - name: CASSANDRA_SEEDS
76 value: "{{- range $i, $e := until $seed_size }}{{ template "common.fullname" $global }}-{{ $i }}.{{ include "common.servicename" $global }},{{- end }}"
78 value: {{ .Values.config.jvmOpts | quote }}
79 - name: CASSANDRA_CLUSTER_NAME
80 value: {{ .Values.config.clusterName | quote }}
82 value: {{ .Values.config.dataCenter | quote }}
83 - name: CASSANDRA_RACK
84 value: {{ .Values.config.rackName | quote }}
85 - name: CASSANDRA_AUTO_BOOTSTRAP
86 value: {{ .Values.config.autoBootstrap | quote }}
90 fieldPath: status.podIP
92 - name: cassandra-data
93 mountPath: /var/lib/cassandra
95 {{ include "common.resources" . | indent 10 }}
96 {{- if .Values.nodeSelector }}
98 {{ toYaml .Values.nodeSelector | indent 8 }}
100 {{- if .Values.affinity }}
102 {{ toYaml .Values.affinity | indent 8 }}
108 {{- if not .Values.persistence.enabled }}
109 - name: cassandra-data
112 volumeClaimTemplates:
116 app: {{ template "common.fullname" . }}
117 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
118 release: "{{ .Release.Name }}"
119 heritage: "{{ .Release.Service }}"
121 volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass }}
124 - {{ .Values.persistence.accessMode | quote }}
127 storage: {{ .Values.persistence.size | quote }}
130 app: {{ include "common.name" . }}
131 release: "{{ .Release.Name }}"