[bitnami/cassandra] Cassandra exporter doesn't allow custom ports (#12576)

* [bitnami/cassandra] add configmap definition

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/cassandra] add volumes

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/cassandra] add doc

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* [bitnami/cassandra] minor bump

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/cassandra] fix configmap naming

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/cassandra] debug

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/cassandra] revert debug

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
Alberto Otero
2022-09-20 13:13:19 +02:00
committed by GitHub
parent 696102a6bc
commit aa4dbb045c
6 changed files with 94 additions and 2 deletions

View File

@@ -23,4 +23,4 @@ name: cassandra
sources:
- https://github.com/bitnami/containers/tree/main/bitnami/cassandra
- http://cassandra.apache.org
version: 9.5.0
version: 9.6.0

View File

@@ -274,6 +274,7 @@ The command removes all the Kubernetes components associated with the chart and
| `metrics.serviceMonitor.labels` | Used to pass Labels that are required by the installed Prometheus Operator | `{}` |
| `metrics.containerPorts.http` | HTTP Port on the Host and Container | `8080` |
| `metrics.containerPorts.jmx` | JMX Port on the Host and Container | `5555` |
| `metrics.configuration` | Configure Cassandra-exporter with a custom config.yml file | `""` |
### TLS/SSL parameters

View File

@@ -252,3 +252,10 @@ otherwise it generates a new one.
{{- printf "%s###%s###%s" $ca $crt $key -}}
{{- end }}
{{/*
Get the metrics config map name.
*/}}
{{- define "cassandra.metricsConfConfigMap" -}}
{{- printf "%s-metrics-conf" (include "common.names.fullname" . ) | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-metrics-conf" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/part-of: cassandra
app.kubernetes.io/component: cassandra-exporter
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
config.yml: |-
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.configuration "context" $) | nindent 4 }}

View File

@@ -490,8 +490,11 @@ spec:
failureThreshold: {{ .Values.metrics.readinessProbe.failureThreshold }}
successThreshold: {{ .Values.metrics.readinessProbe.successThreshold }}
{{- end }}
{{- if .Values.metrics.extraVolumeMounts }}
volumeMounts:
- name: metrics-conf
mountPath: /opt/bitnami/cassandra-exporter/config.yml
subPath: config.yml
{{- if .Values.metrics.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- end }}
@@ -499,6 +502,9 @@ spec:
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
- name: metrics-conf
configMap:
name: {{ include "cassandra.metricsConfConfigMap" . }}
{{- if (include "cassandra.tlsEncryption" . ) }}
- name: certs
secret:

View File

@@ -770,6 +770,67 @@ metrics:
http: 8080
jmx: 5555
## @param metrics.configuration [string] Configure Cassandra-exporter with a custom config.yml file
## ref: https://github.com/criteo/cassandra_exporter/blob/master/config.yml
##
configuration: |
host: localhost:{{ .Values.metrics.containerPorts.jmx }}
ssl: False
user:
password:
listenPort: {{ .Values.metrics.containerPorts.http }}
blacklist:
# To profile the duration of jmx call you can start the program with the following options
# > java -Dorg.slf4j.simpleLogger.defaultLogLevel=trace -jar cassandra_exporter.jar config.yml --oneshot
#
# To get intuition of what is done by cassandra when something is called you can look in cassandra
# https://github.com/apache/cassandra/tree/trunk/src/java/org/apache/cassandra/metrics
# Please avoid to scrape frequently those calls that are iterating over all sstables
# Unaccessible metrics (not enough privilege)
- java:lang:memorypool:.*usagethreshold.*
# Leaf attributes not interesting for us but that are presents in many path
- .*:999thpercentile
- .*:95thpercentile
- .*:fifteenminuterate
- .*:fiveminuterate
- .*:durationunit
- .*:rateunit
- .*:stddev
- .*:meanrate
- .*:mean
- .*:min
# Path present in many metrics but uninterresting
- .*:viewlockacquiretime:.*
- .*:viewreadtime:.*
- .*:cas[a-z]+latency:.*
- .*:colupdatetimedeltahistogram:.*
# Mostly for RPC, do not scrap them
- org:apache:cassandra:db:.*
# columnfamily is an alias for Table metrics
# https://github.com/apache/cassandra/blob/8b3a60b9a7dbefeecc06bace617279612ec7092d/src/java/org/apache/cassandra/metrics/TableMetrics.java#L162
- org:apache:cassandra:metrics:columnfamily:.*
# Should we export metrics for system keyspaces/tables ?
- org:apache:cassandra:metrics:[^:]+:system[^:]*:.*
# Don't scrap us
- com:criteo:nosql:cassandra:exporter:.*
maxScrapFrequencyInSec:
50:
- .*
# Refresh those metrics only every hour as it is costly for cassandra to retrieve them
3600:
- .*:snapshotssize:.*
- .*:estimated.*
- .*:totaldiskspaceused:.*
## @section TLS/SSL parameters
##