2 # Copyright © 2018 Amdocs, AT&T, Bell Canada
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
21 selector: {{- include "common.selectors" . | nindent 4 }}
22 serviceName: {{ include "common.servicename" . }}
23 replicas: {{ .Values.replicaCount }}
24 podManagementPolicy: {{ .Values.podManagementPolicy }}
26 type: {{ .Values.updateStrategy.type }}
28 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
30 hostNetwork: {{ .Values.hostNetwork }}
32 - name: {{ include "common.name" . }}
33 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
34 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
35 ports: {{ include "common.containerPorts" . | nindent 8 }}
37 - name: {{ include "common.fullname" . }}-data
38 mountPath: /var/lib/cassandra
40 mountPath: /etc/localtime
42 - name: cassandra-entrypoint
43 mountPath: /docker-entrypoint.sh
44 subPath: docker-entrypoint.sh
45 {{- range $key, $value := .Values.configOverrides }}
46 - name: cassandra-config-{{ $key | replace "." "-" }}
47 mountPath: /etc/cassandra/{{ $key }}
50 {{- if eq .Values.liveness.enabled true }}
56 - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
57 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
58 periodSeconds: {{ .Values.liveness.periodSeconds }}
59 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
60 successThreshold: {{ .Values.liveness.successThreshold }}
61 failureThreshold: {{ .Values.liveness.failureThreshold }}
68 - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
69 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
70 periodSeconds: {{ .Values.readiness.periodSeconds }}
71 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
72 successThreshold: {{ .Values.readiness.successThreshold }}
73 failureThreshold: {{ .Values.readiness.failureThreshold }}
75 {{- $seed_size := default 1 .Values.replicaCount | int -}}
77 - name: CASSANDRA_SEEDS
78 {{- if .Values.hostNetwork }}
79 value: {{ required "You must fill \".Values.config.seeds\" with list of Cassandra seeds when hostNetwork is set to true" .Values.config.seeds | quote }}
81 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 }}"
84 value: {{ .Values.config.heap.max }}
86 value: {{ .Values.config.heap.min }}
88 value: {{ .Values.config.jvmOpts | quote }}
89 - name: CASSANDRA_CLUSTER_NAME
90 value: {{ .Values.config.clusterName | quote }}
92 value: {{ .Values.config.dataCenter | quote }}
93 - name: CASSANDRA_RACK
94 value: {{ .Values.config.rackName | quote }}
95 - name: CASSANDRA_AUTO_BOOTSTRAP
96 value: {{ .Values.config.autoBootstrap | quote }}
97 - name: CASSANDRA_START_RPC
98 value: {{ default "true" .Values.config.start_rpc | quote }}
99 - name: CASSANDRA_ENDPOINT_SNITCH
100 value: {{ default "GossipingPropertyFileSnitch" .Values.config.endpoint_snitch | quote }}
101 - name: CASSANDRA_AUTHENTICATOR
102 value: {{ default "PasswordAuthenticator" .Values.config.authenticator | quote }}
106 fieldPath: status.podIP
110 {{- if not .Values.persistence.enabled }}
111 command: ["/bin/sh", "-c", "exec nodetool decommission"]
113 command: ["/bin/sh", "-c", "PID=$(pidof java) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"]
115 resources: {{ toYaml .Values.resources | nindent 10 }}
116 {{- if .Values.nodeSelector }}
117 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
119 {{- if .Values.affinity }}
120 affinity: {{ toYaml .Values.affinity | nindent 8 }}
126 {{- range $key, $value := .Values.configOverrides }}
127 - name: cassandra-config-{{ $key | replace "." "-" }}
129 name: {{ include "common.fullname" . }}-configOverrides
131 - name: cassandra-entrypoint
133 name: {{ include "common.fullname" . }}-entrypoint
135 {{- if not .Values.persistence.enabled }}
136 - name: {{ include "common.fullname" . }}-data
139 volumeClaimTemplates:
141 name: {{ include "common.fullname" . }}-data
143 name: {{ include "common.fullname" . }}
144 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
145 release: "{{ include "common.release" . }}"
146 heritage: "{{ .Release.Service }}"
149 {{- if .Values.backup.enabled }}
154 storageClassName: {{ include "common.storageClass" . }}
157 storage: {{ .Values.persistence.size | quote }}