cassandra
Bitnami Helm chart for Apache Cassandra
1M+
Apache Cassandra is an open source distributed database management system designed to handle large amounts of data across many servers, providing high availability with no single point of failure.
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/cassandra
Note: You need to substitute the placeholders
REGISTRY_NAMEandREPOSITORY_NAMEwith a reference to your Helm chart registry and repository.
This chart bootstraps an Apache Cassandra deployment on a Kubernetes cluster using the Helm package manager.
To install the chart with the release name my-release:
helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/cassandra
Note You need to substitute the placeholders
REGISTRY_NAMEandREPOSITORY_NAMEwith a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to useREGISTRY_NAME=registry-1.docker.ioandREPOSITORY_NAME=bitnamicharts.
These commands deploy one node with Apache Cassandra on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.
Note List all releases using
helm list.
This section covers resource requests, credentials, external secrets, TLS, and other options.
Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the resources value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.
To make this process easier, the chart contains the resourcesPreset values, which automatically sets the resources section according to different presets. Check these presets in the bitnami/common chart. However, in production workloads using resourcesPreset is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the official Kubernetes documentation.
Bitnami charts configure credentials at first boot. Any further change in the secrets or credentials require manual intervention. Follow these instructions:
kubectl create secret generic SECRET_NAME --from-literal=cassandra-password=PASSWORD --dry-run -o yaml | kubectl apply -f -
The Bitnami Cassandra chart supports using external secret providers like CSI plugins. With the value dbUser.useExternalSecretProvider, the chart will not render any reference to the authentication secret, avoiding any collision between the helm templates and the secret provider. This requires using extraEnvVars, extraVolumes, extraVolumeMounts, annotations or labels to add all the missing secret references, according to the plugin requirements.
In the following example, we will use the GKE Secret Manager to mount the authentication secrets:
dbUser:
# We do not render the secret references
useExternalSecretProvider: true
# We add the SecretProviderClass with the password stored in our Google Cloud Project
extraDeploy:
- apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: cassandra-secret-provider
spec:
provider: gke
parameters:
secrets: |
- resourceName: "projects/my-project/secrets/my-secret/versions/v1"
path: "cassandra-password"
# Define the SecretProviderClass as an extra volume
extraVolumes:
- name: external-cassandra-secret
csi:
driver: secrets-store-gke.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: cassandra-secret-provider
# Mount the volume in the cassandra container
extraVolumeMounts:
- mountPath: "/var/secrets"
name: external-cassandra-secret
# We specify the location of the password file
extraEnvVars:
- name: CASSANDRA_PASSWORD_FILE
value: "/var/secrets/cassandra-password"
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
This chart can be integrated with Prometheus by setting metrics.enabled to true. This will deploy a sidecar container with cassandra_exporter in all pods and will expose it using the Cassandra service. This service will have the necessary annotations to be automatically scraped by Prometheus.
It is necessary to have a working installation of Prometheus or Prometheus Operator for the integration to work. Install the Bitnami Prometheus helm chart or the Bitnami Kube Prometheus helm chart to easily have a working Prometheus in your cluster.
The chart can deploy ServiceMonitor objects for integration with Prometheus Operator installations. To do so, set the value metrics.serviceMonitor.enabled=true. Ensure that the Prometheus Operator CustomResourceDefinitions are installed in the cluster or it will fail with the following error:
no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
Install the Bitnami Kube Prometheus helm chart for having the necessary CRDs and the Prometheus Operator.
This chart supports TLS between client and server and between nodes, as explained in the following list:
tls.internodeEncryption chart parameter to a value different from none. Available values are all, dc or rack.tls.clientEncryption chart parameter to true.In both cases, it is also necessary to create a secret containing the keystore and truststore certificates and their corresponding protection passwords. Pass this secret to the chart using the tls.existingSecret parameter at deployment time, as in the following example:
tls.internodeEncryption=all
tls.clientEncryption=true
tls.existingSecret=my-existing-stores
tls.passwordsSecret=my-stores-password
Note The secret may be created in the standard way with the
--from-file=./keystore,--from-file=./truststore,--from-literal=keystore-password=KEYSTORE_PASSWORDand--from-literal=truststore-password=TRUSTSTORE_PASSWORDoptions. This assumes that the stores are in the current working directory and the KEYSTORE_PASSWORD and TRUSTSTORE_PASSWORD placeholders are replaced with the correctkeystoreandtruststorepasswords respectively. Example:
kubectl create secret generic my-existing-stores --from-file=./keystore --from-file=./truststore
kubectl create secret generic my-stores-password --from-literal=keystore-password=KEYSTORE_PASSWORD --from-literal=truststore-password=TRUSTSTORE_PASSWORD
keystore and truststore files can be dynamically created from the certificates files. In this case a secret with the tls.crt, tls.key and ca.crt in PEM format is required. The following example shows how the secret can be created and assumes that all certificate files are in the working directory:
kubectl create secret tls my-certs --cert ./tls.crt --key ./tls.key
kubectl patch secret my-certs -p="{\"data\":{\"ca.crt\": \"$(cat ./ca.crt | base64 )\"}}"
To enable this feature tls.autoGenerated must be set and the new secret should be set in tls.certificateSecret:
tls.internodeEncryption=all
tls.clientEncryption=true
tls.autoGenerated=true
tls.certificatesSecret=my-certs
tls.passwordsSecret=my-stores-password
The Apache Cassandra image supports the use of custom scripts to initialize a fresh instance. This may be done by creating a Kubernetes ConfigMap that includes the necessary .sh or .cql scripts and passing this ConfigMap to the chart using the initDBConfigMap parameter.
In case you require the whole cluster to be formed, you can enable an external init job that will wait for the cluster to be ready. Enable this by setting postInit.enabled=true and the necessary shell commands using the postInit.script value. In the script, the following environment variables are available:
CASSANDRA_USER: Admin usernameCASSANDRA_PASSWORD: Admin passwordCASSANDRA_KEYSTORE_LOCATION: keystore location (if tls.enabled=true)CASSANDRA_TRUSTSTORE_LOCATION: truststore location (if tls.enabled=true)CASSANDRA_SEEDER_HOST: First password seeder host.CASSANDRA_CQL_PORT: CQL protocol portThe following example creates two new users:
postInit:
enabled: true
script: |
cqlsh -u ${CASSANDRA_USER} -p "${CASSANDRA_PASSWORD}" --execute="CREATE ROLE IF NOT EXISTS newuser WITH SUPERUSER = false AND PASSWORD = 'newuser' AND LOGIN = true" $CASSANDRA_SEEDER_HOST $CASSANDRA_CQL_PORT
cqlsh -u ${CASSANDRA_USER} -p "${CASSANDRA_PASSWORD}" --execute="GRANT CREATE ON ALL KEYSPACES TO newuser" $CASSANDRA_SEEDER_HOST $CASSANDRA_CQL_PORT
This chart also supports mounting custom configuration file(s) for Apache Cassandra. This is achieved by setting the existingConfiguration parameter with the name of a ConfigMap that includes the custom configuration file(s). Here is an example of deploying the chart with a custom configuration file stored in a ConfigMap named cassandra-configuration:
existingConfiguration=cassandra-configuration
Note This
ConfigMapoverrides other Apache Cassandra configuration variables set in the chart.
See our detailed tutorial on backing up and restoring Bitnami Apache Cassandra deployments on Kubernetes.
This chart allows you to set custom pod affinity using the XXX.affinity parameter(s). Find more information about pod affinity in the Kubernetes documentation.
As an alternative, you can use the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the bitnami/common chart. To do so, set the XXX.podAffinityPreset, XXX.podAntiAffinityPreset, or XXX.nodeAffinityPreset parameters.
The FIPS parameters only have effect if you are using images from the Bitnami Secure Images catalog.
For more information on this support, see the FIPS Compliance section.
The Bitnami Apache Cassandra image stores the Apache Cassandra data at the /bitnami/cassandra path of the container.
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.
See the Parameters section to configure the PVC or to disable persistence.
If you encounter errors when working with persistent volumes, see our troubleshooting guide for persistent volumes.
As the image runs as non-root by default, it is necessary to adjust the ownership of the persistent volume so that the container can write data into it. There are two approaches to achieve this:
podSecurityContext.enabled and containerSecurityContext.enabled to true. This option is enabled by default in the chart. However, this feature does not work in all Kubernetes distributions.volumePermissions.enabled parameter to true.The following subsections list global, common, and component-specific parameters.
| Name | Description | Value |
|---|---|---|
global.imageRegistry | Global Docker image registry | "" |
global.imagePullSecrets | Global Docker registry secret names as an array | [] |
global.defaultStorageClass | Global default StorageClass for Persistent Volume(s) | "" |
global.defaultFips | Default value for the FIPS configuration (allowed values: '', restricted, relaxed, off). Can be overridden by the 'fips' object | restricted |
global.security.allowInsecureImages | Allows skipping image verification | false |
global.compatibility.openshift.adaptSecurityContext | Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) | auto |
| Name | Description | Value |
|---|---|---|
nameOverride | String to partially override common.names.fullname | "" |
fullnameOverride | String to fully override common.names.fullname | "" |
kubeVersion | Force target Kubernetes version (using Helm capabilities if not set) | "" |
commonLabels | Labels to add to all deployed objects (sub-charts are not considered) | {} |
commonAnnotations | Annotations to add to all deployed objects | {} |
clusterDomain | Kubernetes cluster domain name | cluster.local |
extraDeploy | Array of extra objects to deploy with the release | [] |
usePasswordFiles | Mount credentials as files instead of using environment variables | true |
diagnosticMode.enabled | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | false |
diagnosticMode.command | Command to override all containers in the deployment | ["sleep"] |
diagnosticMode.args | Args to override all containers in the deployment | ["infinity"] |
| Name | Description | Value |
|---|---|---|
image.registry | Cassandra image registry | REGISTRY_NAME |
image.repository | Cassandra image repository | REPOSITORY_NAME/cassandra |
image.digest | Cassandra image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | "" |
image.pullPolicy | image pull policy | IfNotPresent |
image.pullSecrets | Cassandra image pull secrets | [] |
image.debug | Enable image debug mode | false |
dbUser.user | Cassandra admin user | cassandra |
dbUser.forcePassword | Force the user to provide a non | false |
dbUser.password | Password for dbUser.user. Randomly generated if empty | "" |
dbUser.existingSecret | Use an existing secret object for dbUser.user password (will ignore dbUser.password) | "" |
dbUser.useExternalSecretProvider | If true, the rendered YAML will not create the secret references, instead, the user will use extraEnvVars, extraVolumes, extraVolumeMounts or other method. Use this for Secret Providers like GKE Secret Manager | false |
initDB | Object with cql scripts. Useful for creating a keyspace and pre-populating data | {} |
initDBConfigMap | ConfigMap with cql scripts. Useful for creating a keyspace and pre-populating data |
Note: the README for this chart is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at https://techdocs.broadcom.com/us/en/vmware-tanzu/bitnami-secure-images/bitnami-secure-images/services/bsi-app-doc/apps-charts-cassandra-index.html
Content type
Image
Digest
sha256:e7562f5be…
Size
7.8 kB
Last updated
11 months ago
docker pull bitnamicharts/cassandra:sha256-5b6770b28e75c51f2628bbb1d1906db1a88e96be2eadd360745c9f7543dc3a0fPulls:
4,499
Jun 29 to Jul 5