1 # Copyright © 2018 Amdocs, AT&T, Bell Canada
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.
17 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
19 selector: {{- include "common.selectors" . | nindent 4 }}
20 serviceName: {{ include "common.servicename" . }}
21 replicas: {{ .Values.replicaCount }}
22 podManagementPolicy: {{ .Values.podManagementPolicy }}
24 type: {{ .Values.updateStrategy.type }}
26 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
28 hostNetwork: {{ .Values.hostNetwork }}
30 - name: {{ include "common.name" . }}
31 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
32 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33 ports: {{ include "common.containerPorts" . | nindent 8 }}
35 - name: {{ include "common.fullname" . }}-data
36 mountPath: /var/lib/cassandra
38 mountPath: /etc/localtime
40 - name: cassandra-entrypoint
41 mountPath: /docker-entrypoint.sh
42 subPath: docker-entrypoint.sh
43 {{- range $key, $value := .Values.configOverrides }}
44 - name: cassandra-config-{{ $key | replace "." "-" }}
45 mountPath: /etc/cassandra/{{ $key }}
48 {{- if eq .Values.liveness.enabled true }}
54 - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
55 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
56 periodSeconds: {{ .Values.liveness.periodSeconds }}
57 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
58 successThreshold: {{ .Values.liveness.successThreshold }}
59 failureThreshold: {{ .Values.liveness.failureThreshold }}
66 - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
67 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
68 periodSeconds: {{ .Values.readiness.periodSeconds }}
69 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
70 successThreshold: {{ .Values.readiness.successThreshold }}
71 failureThreshold: {{ .Values.readiness.failureThreshold }}
73 {{- $seed_size := default 1 .Values.replicaCount | int -}}
75 - name: CASSANDRA_SEEDS
76 {{- if .Values.hostNetwork }}
77 value: {{ required "You must fill \".Values.config.seeds\" with list of Cassandra seeds when hostNetwork is set to true" .Values.config.seeds | quote }}
79 value: "{{- range $i, $e := until $seed_size }}{{ template "common.fullname" $global }}-{{ $i }}.{{ template "common.servicename" $global }}.{{ $global.Release.Namespace }}.svc.{{ $global.Values.config.cluster_domain }}{{- if (lt ( add1 $i ) $seed_size ) }},{{- end }}{{- end }}"
82 value: {{ .Values.config.heap.max }}
84 value: {{ .Values.config.heap.min }}
86 value: {{ .Values.config.jvmOpts | quote }}
87 - name: CASSANDRA_CLUSTER_NAME
88 value: {{ .Values.config.clusterName | quote }}
90 value: {{ .Values.config.dataCenter | quote }}
91 - name: CASSANDRA_RACK
92 value: {{ .Values.config.rackName | quote }}
93 - name: CASSANDRA_AUTO_BOOTSTRAP
94 value: {{ .Values.config.autoBootstrap | quote }}
95 - name: CASSANDRA_START_RPC
96 value: {{ default "true" .Values.config.start_rpc | quote }}
97 - name: CASSANDRA_ENDPOINT_SNITCH
98 value: {{ default "GossipingPropertyFileSnitch" .Values.config.endpoint_snitch | quote }}
99 - name: CASSANDRA_AUTHENTICATOR
100 value: {{ default "PasswordAuthenticator" .Values.config.authenticator | quote }}
104 fieldPath: status.podIP
108 {{- if not .Values.persistence.enabled }}
109 command: ["/bin/sh", "-c", "exec nodetool decommission"]
111 command: ["/bin/sh", "-c", "PID=$(pidof java) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"]
114 {{ toYaml .Values.resources | indent 10 }}
115 {{- if .Values.nodeSelector }}
117 {{ toYaml .Values.nodeSelector | indent 8 }}
119 {{- if .Values.affinity }}
121 {{ toYaml .Values.affinity | indent 8 }}
127 {{- range $key, $value := .Values.configOverrides }}
128 - name: cassandra-config-{{ $key | replace "." "-" }}
130 name: {{ include "common.fullname" . }}-configOverrides
132 - name: cassandra-entrypoint
134 name: {{ include "common.fullname" . }}-entrypoint
136 {{- if not .Values.persistence.enabled }}
137 - name: {{ include "common.fullname" . }}-data
140 volumeClaimTemplates:
142 name: {{ include "common.fullname" . }}-data
144 name: {{ include "common.fullname" . }}
145 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
146 release: "{{ include "common.release" . }}"
147 heritage: "{{ .Release.Service }}"
150 {{- if .Values.backup.enabled }}
155 storageClassName: {{ include "common.storageClass" . }}
158 storage: {{ .Values.persistence.size | quote }}