diff --git a/stable/prometheus-operator/Chart.yaml b/stable/prometheus-operator/Chart.yaml index 575fcdc215..3f1f2687f7 100644 --- a/stable/prometheus-operator/Chart.yaml +++ b/stable/prometheus-operator/Chart.yaml @@ -9,7 +9,7 @@ name: prometheus-operator sources: - https://github.com/coreos/prometheus-operator - https://coreos.com/operators/prometheus -version: 2.3.0 +version: 2.3.1 appVersion: 0.26.0 home: https://github.com/coreos/prometheus-operator keywords: diff --git a/stable/prometheus-operator/README.md b/stable/prometheus-operator/README.md index fcda20636d..643d24e8b6 100644 --- a/stable/prometheus-operator/README.md +++ b/stable/prometheus-operator/README.md @@ -264,6 +264,7 @@ The following tables lists the configurable parameters of the prometheus-operato | `kubelet.enabled` | Deploy servicemonitor to scrape the kubelet service. See also `prometheusOperator.kubeletService` | `true` | | `kubelet.namespace` | Namespace where the kubelet is deployed. See also `prometheusOperator.kubeletService.namespace` | `kube-system` | | `kubelet.serviceMonitor.https` | Enable scraping of the kubelet over HTTPS. For more information, see https://github.com/coreos/prometheus-operator/issues/926 | `false` | +| `kubelet.serviceMonitor.cAdvisorMetricRelabelings` | The `metric_relabel_configs` for scraping cAdvisor. | `` | | `kubeControllerManager.enabled` | Deploy a `service` and `serviceMonitor` to scrape the Kubernetes controller-manager | `true` | | `kubeControllerManager.endpoints` | Endpoints where Controller-manager runs. Provide this if running Controller-manager outside the cluster | `[]` | | `kubeControllermanager.service.port` | Controller-manager port for the service runs on | `10252` | diff --git a/stable/prometheus-operator/ci/test-values.yaml b/stable/prometheus-operator/ci/test-values.yaml index 61b1da4547..1bbe7c692e 100644 --- a/stable/prometheus-operator/ci/test-values.yaml +++ b/stable/prometheus-operator/ci/test-values.yaml @@ -386,6 +386,18 @@ kubelet: ## https://github.com/coreos/prometheus-operator/issues/926 ## https: false + cAdvisorMetricRelabelings: + - sourceLabels: [__name__, image] + separator: ; + regex: container_([a-z_]+); + replacement: $1 + action: drop + - sourceLabels: [__name__] + separator: ; + regex: container_(network_tcp_usage_total|network_udp_usage_total|tasks_state|cpu_load_average_10s) + replacement: $1 + action: drop + ## Component scraping the kube controller manager ## diff --git a/stable/prometheus-operator/templates/exporters/kubelet/servicemonitor.yaml b/stable/prometheus-operator/templates/exporters/kubelet/servicemonitor.yaml index fb3b9a2284..d89b092f4b 100644 --- a/stable/prometheus-operator/templates/exporters/kubelet/servicemonitor.yaml +++ b/stable/prometheus-operator/templates/exporters/kubelet/servicemonitor.yaml @@ -34,6 +34,10 @@ spec: path: /metrics/cadvisor interval: 30s honorLabels: true +{{- if .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings }} + metricRelabelings: +{{ toYaml .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings | indent 4 }} +{{- end }} {{- end }} jobLabel: k8s-app namespaceSelector: diff --git a/stable/prometheus-operator/values.yaml b/stable/prometheus-operator/values.yaml index 75ee597708..8842b147c0 100644 --- a/stable/prometheus-operator/values.yaml +++ b/stable/prometheus-operator/values.yaml @@ -398,6 +398,18 @@ kubelet: ## https://github.com/coreos/prometheus-operator/issues/926 ## https: false + # cAdvisorMetricRelabelings: + # - sourceLabels: [__name__, image] + # separator: ; + # regex: container_([a-z_]+); + # replacement: $1 + # action: drop + # - sourceLabels: [__name__] + # separator: ; + # regex: container_(network_tcp_usage_total|network_udp_usage_total|tasks_state|cpu_load_average_10s) + # replacement: $1 + # action: drop + ## Component scraping the kube controller manager ##