[incubator/cassandra] Ability to override Cassandra configuration files and docker command (#8376)

* Fix Statefulset definition

Signed-off-by: Maciej Bryński <maciej.brynski@xcaliber.com>

* Ability to overrides config files and docker command

Signed-off-by: Maciej Bryński <maciej.brynski@xcaliber.com>

* Bump Chart version

Signed-off-by: Maciej Bryński <maciej.brynski@xcaliber.com>

* Fix newline

Signed-off-by: Maciej Bryński <maciej.brynski@xcaliber.com>

* Fix

Signed-off-by: Maciej Bryński <maciej.brynski@xcaliber.com>
This commit is contained in:
Maciej Bryński
2018-12-18 10:06:34 -08:00
committed by Kubernetes Prow Robot
parent a22d36543c
commit 9c8e9a9a0f
5 changed files with 46 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: cassandra
version: 0.9.5
version: 0.10.0
appVersion: 3.11.3
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
+3
View File
@@ -98,6 +98,9 @@ The following table lists the configurable parameters of the Cassandra chart and
| `config.ports.thrift` | Initdb Arguments | `9160` |
| `config.ports.agent` | The port of the JVM Agent (if any) | `nil` |
| `config.start_rpc` | Initdb Arguments | `false` |
| `configOverrides` | Overrides config files in /etc/cassandra dir | `{}` |
| `commandOverrides` | Overrides default docker command | `[]` |
| `argsOverrides` | Overrides default docker args | `[]` |
| `env` | Custom env variables | `{}` |
| `persistence.enabled` | Use a PVC to persist data | `true` |
| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) |
@@ -0,0 +1,14 @@
{{- if .Values.configOverrides }}
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ template "cassandra.name" . }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "cassandra.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ toYaml .Values.configOverrides | indent 2 }}
{{- end }}
+19 -1
View File
@@ -74,6 +74,12 @@ spec:
- name: {{ template "cassandra.fullname" . }}
image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.commandOverrides }}
command: {{ .Values.commandOverrides }}
{{- end }}
{{- if .Values.argsOverrides }}
args: {{ .Values.argsOverrides }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
env:
@@ -137,6 +143,11 @@ 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 not .Values.persistence.enabled }}
lifecycle:
preStop:
@@ -148,8 +159,15 @@ spec:
imagePullSecrets:
- name: {{ .Values.image.pullSecrets }}
{{- end }}
{{- if not .Values.persistence.enabled }}
{{- if or .Values.configOverrides (not .Values.persistence.enabled) }}
volumes:
{{- end }}
{{- range $key, $value := .Values.configOverrides }}
- configMap:
name: cassandra
name: cassandra-config-{{ $key | replace "." "-" }}
{{- end }}
{{- if not .Values.persistence.enabled }}
- name: data
emptyDir: {}
{{- else }}
+9
View File
@@ -67,6 +67,15 @@ config:
# If a JVM Agent is in place
# agent: 61621
## Cassandra config files overrides
configOverrides: {}
## Cassandra docker command overrides
commandOverrides: []
## Cassandra docker args overrides
argsOverrides: []
## Custom env variables.
## ref: https://hub.docker.com/_/cassandra/
env: {}