4 name: {{ template "cassandra.fullname" . }}
6 app: {{ template "cassandra.name" . }}
7 chart: {{ template "cassandra.chart" . }}
8 release: {{ .Release.Name }}
9 heritage: {{ .Release.Service }}
13 app: {{ template "cassandra.name" . }}
14 release: {{ .Release.Name }}
15 serviceName: {{ template "cassandra.fullname" . }}
16 replicas: {{ .Values.config.cluster_size }}
17 podManagementPolicy: {{ .Values.podManagementPolicy }}
19 type: {{ .Values.updateStrategy.type }}
23 app: {{ template "cassandra.name" . }}
24 release: {{ .Release.Name }}
25 {{- if .Values.podLabels }}
26 {{ toYaml .Values.podLabels | indent 8 }}
28 {{- if .Values.podAnnotations }}
30 {{ toYaml .Values.podAnnotations | indent 8 }}
33 hostNetwork: {{ .Values.hostNetwork }}
34 {{- if .Values.selector }}
35 {{ toYaml .Values.selector | indent 6 }}
37 {{- if .Values.securityContext.enabled }}
39 fsGroup: {{ .Values.securityContext.fsGroup }}
40 runAsUser: {{ .Values.securityContext.runAsUser }}
42 {{- if .Values.affinity }}
44 {{ toYaml .Values.affinity | indent 8 }}
46 {{- if .Values.tolerations }}
48 {{ toYaml .Values.tolerations | indent 8 }}
51 {{- if .Values.exporter.enabled }}
52 - name: cassandra-exporter
53 image: "{{ .Values.exporter.image.repo }}:{{ .Values.exporter.image.tag }}"
55 - name: CASSANDRA_EXPORTER_CONFIG_listenPort
56 value: {{ .Values.exporter.port | quote }}
58 value: {{ .Values.exporter.jvmOpts | quote }}
61 containerPort: {{ .Values.exporter.port }}
67 port: {{ .Values.exporter.port }}
71 port: {{ .Values.exporter.port }}
72 initialDelaySeconds: 20
75 - name: {{ template "cassandra.fullname" . }}
76 image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}"
77 imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
78 {{- if .Values.commandOverrides }}
79 command: {{ .Values.commandOverrides }}
81 {{- if .Values.argsOverrides }}
82 args: {{ .Values.argsOverrides }}
85 {{ toYaml .Values.resources | indent 10 }}
87 {{- $seed_size := default 1 .Values.config.seed_size | int -}}
89 - name: CASSANDRA_SEEDS
90 {{- if .Values.hostNetwork }}
91 value: {{ required "You must fill \".Values.config.seeds\" with list of Cassandra seeds when hostNetwork is set to true" .Values.config.seeds | quote }}
93 value: "{{- range $i, $e := until $seed_size }}{{ template "cassandra.fullname" $global }}-{{ $i }}.{{ template "cassandra.fullname" $global }}.{{ $global.Release.Namespace }}.svc.{{ $global.Values.config.cluster_domain }}{{- if (lt ( add1 $i ) $seed_size ) }},{{- end }}{{- end }}"
96 value: {{ default "8192M" .Values.config.max_heap_size | quote }}
98 value: {{ default "200M" .Values.config.heap_new_size | quote }}
99 - name: CASSANDRA_ENDPOINT_SNITCH
100 value: {{ default "SimpleSnitch" .Values.config.endpoint_snitch | quote }}
101 - name: CASSANDRA_CLUSTER_NAME
102 value: {{ default "Cassandra" .Values.config.cluster_name | quote }}
104 value: {{ default "DC1" .Values.config.dc_name | quote }}
105 - name: CASSANDRA_RACK
106 value: {{ default "RAC1" .Values.config.rack_name | quote }}
107 - name: CASSANDRA_START_RPC
108 value: {{ default "false" .Values.config.start_rpc | quote }}
112 fieldPath: status.podIP
113 {{- range $key, $value := .Values.env }}
114 - name: {{ $key | quote }}
115 value: {{ $value | quote }}
119 command: [ "/bin/sh", "-c", "nodetool status" ]
120 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
121 periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
122 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
123 successThreshold: {{ .Values.livenessProbe.successThreshold }}
124 failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
127 command: [ "/bin/sh", "-c", "nodetool status | grep -E \"^UN\\s+${POD_IP}\"" ]
128 initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
129 periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
130 timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
131 successThreshold: {{ .Values.readinessProbe.successThreshold }}
132 failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
141 containerPort: {{ default 9042 .Values.config.ports.cql }}
143 containerPort: {{ default 9160 .Values.config.ports.thrift }}
144 {{- if .Values.config.ports.agent }}
146 containerPort: {{ .Values.config.ports.agent }}
150 mountPath: /var/lib/cassandra
151 {{- range $key, $value := .Values.configOverrides }}
152 - name: cassandra-config-{{ $key | replace "." "-" }}
153 mountPath: /etc/cassandra/{{ $key }}
156 {{- if not .Values.persistence.enabled }}
160 command: ["/bin/sh", "-c", "exec nodetool decommission"]
162 terminationGracePeriodSeconds: {{ default 30 .Values.podSettings.terminationGracePeriodSeconds }}
163 {{- if .Values.image.pullSecrets }}
165 - name: {{ .Values.image.pullSecrets }}
167 {{- if or .Values.configOverrides (not .Values.persistence.enabled) }}
170 {{- range $key, $value := .Values.configOverrides }}
173 name: cassandra-config-{{ $key | replace "." "-" }}
175 {{- if not .Values.persistence.enabled }}
179 volumeClaimTemplates:
183 app: {{ template "cassandra.name" . }}
184 chart: {{ template "cassandra.chart" . }}
185 release: {{ .Release.Name }}
186 heritage: {{ .Release.Service }}
189 - {{ .Values.persistence.accessMode | quote }}
192 storage: {{ .Values.persistence.size | quote }}
193 {{- if .Values.persistence.storageClass }}
194 {{- if (eq "-" .Values.persistence.storageClass) }}
197 storageClassName: "{{ .Values.persistence.storageClass }}"