From 0cf77f9c1bfeca58f78b142e1186534c3de84b6c Mon Sep 17 00:00:00 2001 From: Nikita Akhnin Date: Fri, 1 Feb 2019 00:00:31 +0700 Subject: [PATCH] [casssandra] Toggle for enabling hostNetwork in Cassandra pods (#11023) * Add hostNetwork toggle Signed-off-by: Nikita Akhnin * Add feature to enable hostNetwork in Cassandra pods Signed-off-by: Nikita Akhnin * Update README.md Signed-off-by: Nikita Akhnin * Update Chart.yaml Signed-off-by: Nikita Akhnin --- incubator/cassandra/Chart.yaml | 2 +- incubator/cassandra/README.md | 1 + incubator/cassandra/templates/statefulset.yaml | 5 +++++ incubator/cassandra/values.yaml | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/incubator/cassandra/Chart.yaml b/incubator/cassandra/Chart.yaml index 16fd4b92ed..579d8e6ffc 100644 --- a/incubator/cassandra/Chart.yaml +++ b/incubator/cassandra/Chart.yaml @@ -1,5 +1,5 @@ name: cassandra -version: 0.10.3 +version: 0.10.4 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 diff --git a/incubator/cassandra/README.md b/incubator/cassandra/README.md index 6cdbb8aa0c..b3b19595ac 100644 --- a/incubator/cassandra/README.md +++ b/incubator/cassandra/README.md @@ -88,6 +88,7 @@ The following table lists the configurable parameters of the Cassandra chart and | `config.cluster_name` | The name of the cluster. | `cassandra` | | `config.cluster_size` | The number of nodes in the cluster. | `3` | | `config.seed_size` | The number of seed nodes used to bootstrap new clients joining the cluster. | `2` | +| `config.seeds` | The comma-separated list of seed nodes. | Automatically generated according to `.Release.Name` and `config.seed_size` | | `config.num_tokens` | Initdb Arguments | `256` | | `config.dc_name` | Initdb Arguments | `DC1` | | `config.rack_name` | Initdb Arguments | `RAC1` | diff --git a/incubator/cassandra/templates/statefulset.yaml b/incubator/cassandra/templates/statefulset.yaml index 412a4cbcf2..c691597f4f 100644 --- a/incubator/cassandra/templates/statefulset.yaml +++ b/incubator/cassandra/templates/statefulset.yaml @@ -30,6 +30,7 @@ spec: {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} spec: + hostNetwork: {{ .Values.hostNetwork }} {{- if .Values.selector }} {{ toYaml .Values.selector | indent 6 }} {{- end }} @@ -86,7 +87,11 @@ spec: {{- $seed_size := default 1 .Values.config.seed_size | int -}} {{- $global := . }} - name: CASSANDRA_SEEDS + {{- if .Values.hostNetwork }} + value: {{ required "You must fill \".Values.config.seeds\" with list of Cassandra seeds when hostNetwork is set to true" .Values.config.seeds | quote }} + {{- else }} 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 }}" + {{- end }} - name: MAX_HEAP_SIZE value: {{ default "8192M" .Values.config.max_heap_size | quote }} - name: HEAP_NEWSIZE diff --git a/incubator/cassandra/values.yaml b/incubator/cassandra/values.yaml index 86cec364e3..6bfae651ac 100644 --- a/incubator/cassandra/values.yaml +++ b/incubator/cassandra/values.yaml @@ -148,6 +148,10 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template # name: +# Use host network for Cassandra pods +# You must pass seed list into config.seeds property if set to true +hostNetwork: false + ## Backup cronjob configuration ## Ref: https://github.com/nuvo/cain backup: