[incubator/cassandra] Change configOverrides to use an initContainer (#20511)

This allows the filesystem of the configs to be r/w.

Signed-off-by: Matthew Walker <matthew.walker@prolucid.ca>

Co-authored-by: matthew-walker-prolucid <55808309+matthew-walker-prolucid@users.noreply.github.com>
This commit is contained in:
Matt Walker
2020-02-08 00:47:53 -08:00
committed by GitHub
co-authored by matthew-walker-prolucid
parent cbfec0b8fa
commit 15fd25f477
2 changed files with 24 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: cassandra
version: 0.13.4
version: 0.14.0
appVersion: 3.11.5
description: Apache Cassandra is a free and open-source distributed database management
system designed to handle large amounts of data across many commodity servers, providing
+23 -6
View File
@@ -49,6 +49,20 @@ spec:
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.configOverrides }}
initContainers:
- name: config-copier
image: busybox
command: [ 'sh', '-c', 'cp /configmap-files/* /cassandra-configs/ && chown 999:999 /cassandra-configs/*']
volumeMounts:
{{- range $key, $value := .Values.configOverrides }}
- name: cassandra-config-{{ $key | replace "." "-" | replace "_" "--" }}
mountPath: /configmap-files/{{ $key }}
subPath: {{ $key }}
{{- end }}
- name: cassandra-configs
mountPath: /cassandra-configs/
{{- end }}
containers:
{{- if .Values.exporter.enabled }}
@@ -153,11 +167,10 @@ spec:
volumeMounts:
- name: data
mountPath: /var/lib/cassandra
{{- range $key, $value := .Values.configOverrides }}
- name: cassandra-config-{{ $key | replace "." "-" }}
mountPath: /etc/cassandra/{{ $key }}
subPath: {{ $key }}
{{- end }}
{{- if .Values.configOverrides }}
- name: cassandra-configs
mountPath: /etc/cassandra
{{- end }}
{{- if not .Values.persistence.enabled }}
lifecycle:
preStop:
@@ -175,7 +188,11 @@ spec:
{{- range $key, $value := .Values.configOverrides }}
- configMap:
name: cassandra
name: cassandra-config-{{ $key | replace "." "-" }}
name: cassandra-config-{{ $key | replace "." "-" | replace "_" "--" }}
{{- end }}
{{- if .Values.configOverrides }}
- name: cassandra-configs
emptyDir: {}
{{- end }}
{{- if not .Values.persistence.enabled }}
- name: data