cadvisor: support pre-scrape relabelings (#88)

* support pre-scrape relabelings

* bump version and add readme notes
This commit is contained in:
Mahmoud Saada 2022-02-09 01:20:06 -05:00 committed by GitHub
parent c09c1cea24
commit d199a112c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 4 deletions

View File

@ -1,7 +1,7 @@
apiVersion: v1 apiVersion: v1
description: A chart for a Cadvisor deployment description: A chart for a Cadvisor deployment
name: cadvisor name: cadvisor
version: 1.4.0 version: 2.0.0
appVersion: 0.43.0 appVersion: 0.43.0
home: https://github.com/google/cadvisor home: https://github.com/google/cadvisor
sources: sources:

View File

@ -28,6 +28,10 @@ $ helm install --name my-release ckotzbauer/cadvisor
The command deploys cAdvisor on the Kubernetes cluster using the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. The command deploys cAdvisor on the Kubernetes cluster using the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
## Upgrading from v1.x to v2.x
- `metrics.relabelings` was renamed to `metrics.metricsRelabelings` to match the ServiceMonitor CRD naming
## Uninstalling the Chart ## Uninstalling the Chart
To uninstall/delete the `my-release` deployment: To uninstall/delete the `my-release` deployment:
@ -62,7 +66,8 @@ The following table lists the configurable parameters of the cAdvisor chart and
| `podSecurityContext.create` | create the podSecurityContext in container spec | `false` | | `podSecurityContext.create` | create the podSecurityContext in container spec | `false` |
| `podSecurityContext.privileged`| set podSecurityContext privileged to true | `false` | | `podSecurityContext.privileged`| set podSecurityContext privileged to true | `false` |
| `metrics.enabled` | create ServiceMonitor CR for Prometheus operator | `false` | | `metrics.enabled` | create ServiceMonitor CR for Prometheus operator | `false` |
| `metrics.relabeling` | add relabeling configuration to ServiceMonitor | `[]` | | `metrics.relabelings` | add pre-scraping relabeling to ServiceMonitor | `[]` |
| `metrics.metricsRelabelings` | add pre-ingestion relabeling to ServiceMonitor | `[]` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

View File

@ -20,7 +20,11 @@ spec:
- path: /metrics - path: /metrics
port: http port: http
{{- if .Values.metrics.relabelings }} {{- if .Values.metrics.relabelings }}
metricRelabelings: relabelings:
{{- toYaml .Values.metrics.relabelings | nindent 8 }} {{- toYaml .Values.metrics.relabelings | nindent 8 }}
{{- end -}} {{- end -}}
{{- if .Values.metrics.metricRelabelings }}
metricRelabelings:
{{- toYaml .Values.metrics.metricRelabelings | nindent 8 }}
{{- end -}}
{{- end -}} {{- end -}}

View File

@ -72,7 +72,7 @@ affinity: {}
# This will create a ServiceMonitor Custom Resource indicating the prometheus operator what to scrape. # This will create a ServiceMonitor Custom Resource indicating the prometheus operator what to scrape.
metrics: metrics:
enabled: false enabled: false
# This will allow you to specify relabelings on the metrics. E.g. to use the kubernetes monitoring # This will allow you to specify relabelings on the metrics before ingestion. E.g. to use the kubernetes monitoring
# mixin with this chart set metrics.enabled above to true and use: # mixin with this chart set metrics.enabled above to true and use:
# relabelings: # relabelings:
# - sourceLabels: # - sourceLabels:
@ -84,4 +84,11 @@ metrics:
# - sourceLabels: # - sourceLabels:
# - container_label_io_kubernetes_pod_name # - container_label_io_kubernetes_pod_name
# targetLabel: pod # targetLabel: pod
metricRelabelings: []
# This will allow you to specify relabelings on the metrics before scraping.
# relabelings:
# - action: replace
# sourceLabels:
# - __meta_kubernetes_pod_node_name
# targetLabel: node
relabelings: [] relabelings: []