From 6f462b1c1f100617b58da14407613f96d4d4a5ea Mon Sep 17 00:00:00 2001 From: Jakub Walecki Date: Thu, 6 Oct 2022 19:48:31 +0200 Subject: [PATCH] Add scrape interval and timeout for cadvisor service monitor (#120) --- charts/cadvisor/Chart.yaml | 2 +- charts/cadvisor/README.md | 2 ++ charts/cadvisor/templates/servicemonitor.yaml | 2 ++ charts/cadvisor/values.yaml | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/cadvisor/Chart.yaml b/charts/cadvisor/Chart.yaml index d321ca9..8b045dc 100644 --- a/charts/cadvisor/Chart.yaml +++ b/charts/cadvisor/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: A chart for a Cadvisor deployment name: cadvisor -version: 2.2.1 +version: 2.2.2 appVersion: 0.44.0 home: https://github.com/google/cadvisor sources: diff --git a/charts/cadvisor/README.md b/charts/cadvisor/README.md index bf5a2ce..8fb9760 100644 --- a/charts/cadvisor/README.md +++ b/charts/cadvisor/README.md @@ -68,6 +68,8 @@ The following table lists the configurable parameters of the cAdvisor chart and | `podSecurityContext.privileged`| set podSecurityContext privileged to true | `false` | | `metrics.enabled` | create ServiceMonitor CR for Prometheus operator | `false` | | `metrics.relabelings` | add pre-scraping relabeling to ServiceMonitor | `[]` | +| `metrics.interval` | scraping interval for the ServiceMonitor | `30s` | +| `metrics.scrapeTimeout` | scraping timeout for the ServiceMonitor | `30s` | | `metrics.metricsRelabelings` | add pre-ingestion relabeling to ServiceMonitor | `[]` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/charts/cadvisor/templates/servicemonitor.yaml b/charts/cadvisor/templates/servicemonitor.yaml index 4101f9f..2b81ca6 100644 --- a/charts/cadvisor/templates/servicemonitor.yaml +++ b/charts/cadvisor/templates/servicemonitor.yaml @@ -18,6 +18,8 @@ spec: - {{ .Release.Namespace }} endpoints: - path: /metrics + interval: {{ .Values.metrics.interval }} + scrapeTimeout: {{ .Values.metrics.scrapeTimeout }} port: http {{- if .Values.metrics.relabelings }} relabelings: diff --git a/charts/cadvisor/values.yaml b/charts/cadvisor/values.yaml index ad25d91..0fa9499 100644 --- a/charts/cadvisor/values.yaml +++ b/charts/cadvisor/values.yaml @@ -75,6 +75,8 @@ affinity: {} # This will create a ServiceMonitor Custom Resource indicating the prometheus operator what to scrape. metrics: enabled: false + interval: 30s + scrapeTimeout: 30s # 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: # relabelings: