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 <tvanlessen@gmail.com>
This commit is contained in:
Tammo van Lessen
2019-12-17 08:26:00 -08:00
committed by Kubernetes Prow Robot
parent 2ef9c1ea20
commit 24a110fa18
3 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -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
+11
View File
@@ -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"
```
+3
View File
@@ -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