diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 4b5de007acc3..719b5271af39 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -11,4 +11,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.20.1 +version: 9.21.0 diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index dd199551b824..cabc23ff62ac 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -367,6 +367,7 @@ Though enough for the majority of installations, the default PodSecurityPolicy _ | serviceMonitor.annotations | object | `{}` | Annotations to add to service monitor | | serviceMonitor.enabled | bool | `false` | If true, creates a Prometheus Operator ServiceMonitor. | | serviceMonitor.interval | string | `"10s"` | Interval that Prometheus scrapes Cluster Autoscaler metrics. | +| serviceMonitor.metricRelabelings | object | `{}` | MetricRelabelConfigs to apply to samples before ingestion. | | serviceMonitor.namespace | string | `"monitoring"` | Namespace which Prometheus is running in. | | serviceMonitor.path | string | `"/metrics"` | The path to scrape for metrics; autoscaler exposes `/metrics` (this is standard) | | serviceMonitor.selector | object | `{"release":"prometheus-operator"}` | Default to kube-prometheus install (CoreOS recommended), but should be set according to Prometheus install. | diff --git a/charts/cluster-autoscaler/templates/servicemonitor.yaml b/charts/cluster-autoscaler/templates/servicemonitor.yaml index 35e0ba45ecf2..5468756faf7a 100644 --- a/charts/cluster-autoscaler/templates/servicemonitor.yaml +++ b/charts/cluster-autoscaler/templates/servicemonitor.yaml @@ -20,6 +20,10 @@ spec: - port: {{ .Values.service.portName }} interval: {{ .Values.serviceMonitor.interval }} path: {{ .Values.serviceMonitor.path }} + {{- if .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.serviceMonitor.metricRelabelings | indent 6) . }} + {{- end }} namespaceSelector: matchNames: - {{.Release.Namespace}} diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index bb7bfb5fd1f5..1a4c1bcf3946 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -344,6 +344,9 @@ serviceMonitor: path: /metrics # serviceMonitor.annotations -- Annotations to add to service monitor annotations: {} + ## [RelabelConfig](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.RelabelConfig) + # serviceMonitor.metricRelabelings -- MetricRelabelConfigs to apply to samples before ingestion. + metricRelabelings: {} ## Custom PrometheusRule to be defined ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart