diff --git a/incubator/cassandra/Chart.yaml b/incubator/cassandra/Chart.yaml index 44681640ed..256012c98c 100644 --- a/incubator/cassandra/Chart.yaml +++ b/incubator/cassandra/Chart.yaml @@ -1,5 +1,5 @@ name: cassandra -version: 0.6.4 +version: 0.7.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 diff --git a/incubator/cassandra/README.md b/incubator/cassandra/README.md index 4174bb5456..9f948db00a 100644 --- a/incubator/cassandra/README.md +++ b/incubator/cassandra/README.md @@ -104,6 +104,7 @@ The following table lists the configurable parameters of the Cassandra chart and | `resources` | CPU/Memory resource requests/limits | Memory: `4Gi`, CPU: `2` | | `service.type` | k8s service type exposing ports, e.g. `NodePort`| `ClusterIP` | | `podManagementPolicy` | podManagementPolicy of the StatefulSet | `OrderedReady` | +| `podAnnotations` | pod annotations for the StatefulSet | `{}` | | `updateStrategy.type` | UpdateStrategy of the StatefulSet | `OnDelete` | | `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `90` | | `livenessProbe.periodSeconds` | How often to perform the probe | `30` | @@ -126,6 +127,11 @@ The following table lists the configurable parameters of the Cassandra chart and | `backup.env` | Backup environment variables | AWS_REGION: `us-east-1` | | `backup.resources` | Backup CPU/Memory resource requests/limits | Memory: `1Gi`, CPU: `1` | | `backup.destination` | Destination to store backup artifacts | `s3://bucket/cassandra` | +| `exporter.enabled` | Enable Cassandra exporter | `false` | +| `exporter.image.repo` | Exporter image repository | `criteord/cassandra_exporter` | +| `exporter.image.tag` | Exporter image tag | `2.0.2` | +| `exporter.port` | Exporter port | `5556` | +| `exporter.jvmOpts` | Exporter additional JVM options | | ## Scale cassandra When you want to change the cluster size of your cassandra, you can use the helm upgrade command. diff --git a/incubator/cassandra/templates/statefulset.yaml b/incubator/cassandra/templates/statefulset.yaml index f941b4490c..26d9e3c306 100644 --- a/incubator/cassandra/templates/statefulset.yaml +++ b/incubator/cassandra/templates/statefulset.yaml @@ -24,6 +24,10 @@ spec: release: {{ .Release.Name }} {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 8 }} +{{- end }} +{{- if .Values.podAnnotations }} + annotations: +{{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} spec: {{- if .Values.selector }} @@ -39,6 +43,30 @@ spec: {{ toYaml .Values.affinity | indent 8 }} {{- end }} containers: +{{- if .Values.exporter.enabled }} + - name: cassandra-exporter + image: "{{ .Values.exporter.image.repo }}:{{ .Values.exporter.image.tag }}" + env: + - name: CASSANDRA_EXPORTER_CONFIG_listenPort + value: {{ .Values.exporter.port | quote }} + - name: JVM_OPTS + value: {{ .Values.exporter.jvmOpts | quote }} + ports: + - name: metrics + containerPort: {{ .Values.exporter.port }} + protocol: TCP + - name: jmx + containerPort: 5555 + livenessProbe: + tcpSocket: + port: {{ .Values.exporter.port }} + readinessProbe: + httpGet: + path: /metrics + port: {{ .Values.exporter.port }} + initialDelaySeconds: 20 + timeoutSeconds: 45 +{{- end }} - name: {{ template "cassandra.fullname" . }} image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} diff --git a/incubator/cassandra/values.yaml b/incubator/cassandra/values.yaml index 325065b4b7..ea12a9858a 100644 --- a/incubator/cassandra/values.yaml +++ b/incubator/cassandra/values.yaml @@ -87,6 +87,10 @@ readinessProbe: # nodeSelector: # cloud.google.com/gke-nodepool: pool-db +## Additional pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +podAnnotations: {} + ## Additional pod labels ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ podLabels: {} @@ -162,3 +166,13 @@ backup: # Additional support can added. # Ref: https://github.com/maorfr/skbn destination: s3://bucket/cassandra + +## Cassandra exported configuration +## ref: https://github.com/criteo/cassandra_exporter +exporter: + enabled: false + image: + repo: criteord/cassandra_exporter + tag: 2.0.2 + port: 5556 + jvmOpts: ""