[bitnami/cassandra] Stop supporting custom config & init scripts through files directory (#2152)

* [bitnami/cassandra] Stop support custom config & init scripts through files directory

Signed-off-by: juan131 <juan@bitnami.com>

* [bitnami/cassandra] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>
This commit is contained in:
Juan Ariza Toledano
2020-03-30 10:28:49 +02:00
committed by GitHub
parent 5c56df0ee5
commit b2014bd20f
10 changed files with 39 additions and 68 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: cassandra
version: 5.1.4
version: 5.2.0
appVersion: 3.11.6
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 high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple datacenters, with asynchronous masterless replication allowing low latency operations for all clients.
keywords:
+26 -11
View File
@@ -72,7 +72,7 @@ The following tables lists the configurable parameters of the cassandra chart an
| `service.type` | Kubernetes Service type | `ClusterIP` |
| `service.port` | CQL Port for the Kubernetes service | `9042` |
| `service.thriftPort` | Thrift Port for the Kubernetes service | `9160` |
| `service.nodePorts.cql` | Kubernetes CQL node port | `""` |
| `service.nodePorts.cql` | Kubernetes CQL node port | `""` |
| `service.nodePorts.rcp` | Kubernetes Thrift node port | `""` |
| `service.loadBalancerIP` | LoadBalancerIP if service type is `LoadBalancer` | `nil` |
| `service.annotations` | Annotations for the service | {} |
@@ -83,7 +83,7 @@ The following tables lists the configurable parameters of the cassandra chart an
| `persistence.size` | Persistent Volume Size | `8Gi` |
| `tlsEncryptionSecretName` | Secret with keystore, keystore password, truststore and truststore password | `{}` |
| `resources` | CPU/Memory resource requests/limits | `{}` |
| `existingConfiguration` | Pointer to a configMap that contains custom Cassandra configuration files. This will override any Cassandra configuration variable set in the chart | `{}` |
| `existingConfiguration` | Pointer to a configMap that contains custom Cassandra configuration files. This will override any Cassandra configuration variable set in the chart | `nil` (evaluated as a template) |
| `cluster.name` | Cassandra cluster name | `cassandra` |
| `cluster.replicaCount` | Number of Cassandra nodes | `1` |
| `cluster.seedCount` | Number of seed nodes (note: must be greater or equal than 1 and less or equal to `cluster.replicaCount`) | `1` |
@@ -103,7 +103,7 @@ The following tables lists the configurable parameters of the cassandra chart an
| `dbUser.forcePassword` | Force the user to provide a non-empty password for `dbUser.user` | `false` |
| `dbUser.password` | Password for `dbUser.user`. Randomly generated if empty | (Random generated) |
| `dbUser.existingSecret` | Use an existing secret object for `dbUser.user` password (will ignore `dbUser.password`) | `nil` |
| `initDBConfigMap` | Configmap for initialization CQL commands (done in the first node). Useful for creating keyspaces at startup, for instance | `nil` |
| `initDBConfigMap` | Configmap for initialization CQL commands (done in the first node). Useful for creating keyspaces at startup, for instance | `nil` (evaluated as a template) |
| `livenessProbe.enabled` | Turn on and off liveness probe | `true` |
| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `30` |
| `livenessProbe.periodSeconds` | How often to perform the probe | `30` |
@@ -142,15 +142,15 @@ The above parameters map to the env variables defined in [bitnami/cassandra](htt
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
$ helm install my-release \
--set dbUser.user=admin,dbUser.password=password\
helm install my-release \
--set dbUser.user=admin,dbUser.password=password\
bitnami/cassandra
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
```console
$ helm install my-release -f values.yaml bitnami/cassandra
helm install my-release -f values.yaml bitnami/cassandra
```
> **Tip**: You can use the default [values.yaml](values.yaml)
@@ -168,6 +168,7 @@ Bitnami will release a new chart updating its containers if a new version of the
This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`. You can use this file instead of the default one.
- Number of Cassandra and seed nodes:
```diff
- master.replicaCount: 1
- master.seedCount: 1
@@ -176,24 +177,28 @@ This chart includes a `values-production.yaml` file where you can find some para
```
- Minimum nuber of instances that must be available in the cluster:
```diff
- cluster.minimumAvailable: 1
+ cluster.minimumAvailable: 2
```
- Force the user to provide a non-empty password for `dbUser.user`:
```diff
- dbUser.forcePassword: false
+ dbUser.forcePassword: true
```
- Enable NetworkPolicy:
```diff
- networkPolicy.enabled: false
+ networkPolicy.enabled: true
```
- Start a side-car prometheus exporter:
```diff
- metrics.enabled: false
+ metrics.enabled: true
@@ -203,8 +208,8 @@ This chart includes a `values-production.yaml` file where you can find some para
You can enable TLS between client and server and between nodes. In order to do so, you need to set the following values:
* For internode cluster encryption, set `cluster.internodeEncryption` to a value different from `none`. Available values are `all`, `dc` or `rack`.
* For client-server encryption, set `cluster.clientEncryption` to true.
- For internode cluster encryption, set `cluster.internodeEncryption` to a value different from `none`. Available values are `all`, `dc` or `rack`.
- For client-server encryption, set `cluster.clientEncryption` to true.
In addition to this, you **must** create a secret containing the *keystore* and *truststore* certificates and their corresponding protection passwords. Then, set the `tlsEncryptionSecretName` when deploying the chart.
@@ -216,9 +221,19 @@ cluster.clientEncryption=true
tlsEncryptionSecretName=cassandra-tls
```
### Using custom configuration
This helm chart supports mounting your custom configuration file(s) for Cassandra. This is done by setting the `existingConfiguration` parameter with the name of a configmap (for example, `cassandra-configuration`) that includes the custom configuration file(s):
```console
existingConfiguration=cassandra-configuration
```
> Note: this will override any other Cassandra configuration variable set in the chart.
### Initializing the database
The [Bitnami cassandra](https://github.com/bitnami/bitnami-docker-cassandra) image allows having initialization scripts mounted in `/docker-entrypoint.initdb`. This is done in the chart by adding files in the `files/docker-entrypoint-initdb.d` folder (in order to do so, clone this chart) or by setting the `initDBConfigMap` value with a `ConfigMap` (named, for example, `init-db`) that includes the necessary `sh` or `cql` scripts:
The [Bitnami cassandra](https://github.com/bitnami/bitnami-docker-cassandra) image allows having initialization scripts mounted in `/docker-entrypoint.initdb`. This is done in the chart by setting the parameter `initDBConfigMap` with the name of a configmap (for example, `init-db`) that includes the necessary `sh` or `cql` scripts:
```console
initDBConfigMap=init-db
@@ -247,8 +262,8 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru
An issue in StatefulSet manifest of the 4.x chart series rendered chart upgrades to be broken. The 5.0.0 series fixes this issue. To upgrade to the 5.x series you need to manually delete the Cassandra StatefulSet before executing the `helm upgrade` command.
```bash
$ kubectl delete sts -l release=<RELEASE_NAME>
$ helm upgrade <RELEASE_NAME> ...
kubectl delete sts -l release=<RELEASE_NAME>
helm upgrade <RELEASE_NAME> ...
```
### 4.0.0
-3
View File
@@ -1,3 +0,0 @@
Place your Cassandra configuration files here. This will override the values set in any configuration environment variable. This will not be used in case the value *existingConfiguration* is used.
More information [here](https://github.com/bitnami/bitnami-docker-cassandra#configuration)
@@ -1,3 +0,0 @@
You can copy here your custom `.sh` or `.cql` file so they are executed during the first boot of the image.
More info in the [bitnami-docker-cassandra](https://github.com/bitnami/bitnami-docker-cassandra#initializing-a-new-instance) repository.
-22
View File
@@ -107,28 +107,6 @@ Also, we can't use a single if because lazy evaluation is not an option
{{- end -}}
{{- end -}}
{{/*
Get the init db configmap.
*/}}
{{- define "cassandra.initDbCM" -}}
{{- if .Values.initDBConfigMap -}}
{{- printf "%s" .Values.initDBConfigMap -}}
{{- else -}}
{{- printf "%s-init-scripts" (include "cassandra.fullname" .) -}}
{{- end -}}
{{- end -}}
{{/*
Get the configuration configmap.
*/}}
{{- define "cassandra.configurationCM" -}}
{{- if .Values.existingConfiguration -}}
{{- printf "%s" .Values.existingConfiguration -}}
{{- else -}}
{{- printf "%s-configuration" (include "cassandra.fullname" .) -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
@@ -1,9 +0,0 @@
{{ if and (.Files.Glob "files/conf/*") (not .Values.existingConfiguration) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "cassandra.fullname" . }}-configuration
labels: {{- include "cassandra.labels" . | nindent 4 }}
data:
{{ (.Files.Glob "files/conf/*").AsConfig | indent 2 }}
{{ end }}
@@ -1,9 +0,0 @@
{{- if and (.Files.Glob "files/docker-entrypoint-initdb.d/*") (not .Values.initDBConfigMap) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "cassandra.fullname" . }}-init-scripts
labels: {{- include "cassandra.labels" . | nindent 4 }}
data:
{{ (.Files.Glob "files/docker-entrypoint-initdb.d/*").AsConfig | indent 2 }}
{{- end }}
+6 -6
View File
@@ -200,11 +200,11 @@ spec:
- name: encryption-secrets
mountPath: /bitnami/cassandra/secrets
{{- end }}
{{- if or (.Files.Glob "files/docker-entrypoint-initdb.d/*") (.Values.initDBConfigMap) }}
{{- if .Values.initDBConfigMap }}
- name: init-db
mountPath: /docker-entrypoint-initdb.d
{{- end }}
{{ if or (.Files.Glob "files/conf/*") .Values.existingConfiguration }}
{{ if .Values.existingConfiguration }}
- name: configurations
mountPath: /bitnami/cassandra/conf
{{- end }}
@@ -242,15 +242,15 @@ spec:
- key: truststore
path: truststore
{{- end }}
{{- if or (.Files.Glob "files/conf/*") .Values.existingConfiguration }}
{{- if .Values.existingConfiguration }}
- name: configurations
configMap:
name: {{ include "cassandra.configurationCM" . }}
name: {{ tpl .Values.existingConfiguration $ }}
{{- end }}
{{- if or (.Files.Glob "files/docker-entrypoint-initdb.d/*") (.Values.initDBConfigMap) }}
{{- if .Values.initDBConfigMap }}
- name: init-db
configMap:
name: {{ include "cassandra.initDbCM" . }}
name: {{ tpl .Values.initDBConfigMap $ }}
{{- end }}
{{- if not .Values.persistence.enabled }}
- name: data
+3 -2
View File
@@ -17,7 +17,7 @@ image:
## Bitnami Cassandra image tag
## ref: https://github.com/bitnami/bitnami-docker-cassandra#supported-tags-and-respective-dockerfile-links
##
tag: 3.11.6-debian-10-r41
tag: 3.11.6-debian-10-r46
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -148,6 +148,7 @@ resources:
## Secret with keystore, keystore password, truststore, truststore password
##
# tlsEncryptionSecretName:
## ConfigMap with custom cassandra configuration files. This overrides any other Cassandra configuration set in the chart
##
# existingConfiguration:
@@ -282,7 +283,7 @@ metrics:
registry: docker.io
pullPolicy: IfNotPresent
repository: bitnami/cassandra-exporter
tag: 2.3.4-debian-10-r22
tag: 2.3.4-debian-10-r26
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
+3 -2
View File
@@ -17,7 +17,7 @@ image:
## Bitnami Cassandra image tag
## ref: https://github.com/bitnami/bitnami-docker-cassandra#supported-tags-and-respective-dockerfile-links
##
tag: 3.11.6-debian-10-r41
tag: 3.11.6-debian-10-r46
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -148,6 +148,7 @@ resources:
## Secret with keystore, keystore password, truststore, truststore password
##
# tlsEncryptionSecretName:
## ConfigMap with custom cassandra configuration files. This overrides any other Cassandra configuration set in the chart
##
# existingConfiguration:
@@ -282,7 +283,7 @@ metrics:
registry: docker.io
pullPolicy: IfNotPresent
repository: bitnami/cassandra-exporter
tag: 2.3.4-debian-10-r22
tag: 2.3.4-debian-10-r26
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/