From 24a110fa182eb0a195bdcfadb80d278ef1ba2e3f Mon Sep 17 00:00:00 2001 From: Tammo van Lessen Date: Tue, 17 Dec 2019 17:26:00 +0100 Subject: [PATCH] Add metrics port to containerSpec (#19479) WIthout a metrics port given in the container spec, prometheus scraping annotations would not scrape the correct port. See https://github.com/prometheus/prometheus/issues/3826#issuecomment-380736580 for details. Signed-off-by: Tammo van Lessen --- stable/kured/Chart.yaml | 2 +- stable/kured/README.md | 11 +++++++++++ stable/kured/templates/daemonset.yaml | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/stable/kured/Chart.yaml b/stable/kured/Chart.yaml index 76c9005b36..21a0d30a11 100644 --- a/stable/kured/Chart.yaml +++ b/stable/kured/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.2.0" description: A Helm chart for kured name: kured -version: 1.4.1 +version: 1.4.2 home: https://github.com/weaveworks/kured maintainers: - name: plumdog diff --git a/stable/kured/README.md b/stable/kured/README.md index d292b937ac..b93496b0b2 100644 --- a/stable/kured/README.md +++ b/stable/kured/README.md @@ -36,3 +36,14 @@ extraArgs: bar-baz: 2 ``` becomes `/usr/bin/kured ... --foo=1 --bar-baz=2`. + +## Prometheus Metrics + +Kured exposes a single prometheus metric indicating whether a reboot is required or not (see [kured docs](https://github.com/weaveworks/kured#prometheus-metrics)) for details. It can be scraped with the following set of annotations: + +```yaml +podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/path: "/metrics" + prometheus.io/port: "8080" +``` \ No newline at end of file diff --git a/stable/kured/templates/daemonset.yaml b/stable/kured/templates/daemonset.yaml index a3e5478a27..4f141ae8e7 100644 --- a/stable/kured/templates/daemonset.yaml +++ b/stable/kured/templates/daemonset.yaml @@ -61,6 +61,9 @@ spec: - --{{ $key }} {{- end }} {{- end }} + ports: + - containerPort: 8080 + name: metrics env: # Pass in the name of the node on which this pod is scheduled # for use with drain/uncordon operations and lock acquisition