From 9d9f10ce8b59a4f853ee737467a5f556ef6f5522 Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Zaib Date: Wed, 10 Mar 2021 10:51:55 +0100 Subject: [PATCH 1/4] Add option to specify job label for service monitor --- charts/ingress-nginx/templates/controller-servicemonitor.yaml | 3 +++ charts/ingress-nginx/values.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/charts/ingress-nginx/templates/controller-servicemonitor.yaml b/charts/ingress-nginx/templates/controller-servicemonitor.yaml index 8b8c8d82f1..066488a040 100644 --- a/charts/ingress-nginx/templates/controller-servicemonitor.yaml +++ b/charts/ingress-nginx/templates/controller-servicemonitor.yaml @@ -22,6 +22,9 @@ spec: {{- if .Values.controller.metrics.serviceMonitor.metricRelabelings }} metricRelabelings: {{ toYaml .Values.controller.metrics.serviceMonitor.metricRelabelings | nindent 8 }} {{- end }} +{{- if .Values.controller.metrics.serviceMonitor.jobLabel }} + jobLabel: {{ .Values.controller.metrics.serviceMonitor.jobLabel | quote }} +{{- end }} {{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }} namespaceSelector: {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }} {{ else }} diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 5c8eb6ce66..f4689f2549 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -523,6 +523,8 @@ controller: serviceMonitor: enabled: false additionalLabels: {} + # The label to use to retrieve the job name from. + # jobLabel: "app.kubernetes.io/name" namespace: "" namespaceSelector: {} # Default: scrape .Release.Namespace only From 03bf9bbd87f21e9d90c60e5dabfc497f67e6cf48 Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Zaib Date: Tue, 6 Apr 2021 08:21:33 +0200 Subject: [PATCH 2/4] Bump chart version and update changelog --- charts/ingress-nginx/CHANGELOG.md | 4 ++++ charts/ingress-nginx/Chart.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/ingress-nginx/CHANGELOG.md b/charts/ingress-nginx/CHANGELOG.md index 0435de4edc..bd0453b7c5 100644 --- a/charts/ingress-nginx/CHANGELOG.md +++ b/charts/ingress-nginx/CHANGELOG.md @@ -4,6 +4,10 @@ This file documents all notable changes to [ingress-nginx](https://github.com/ku ### Unreleased +### 3.27.0 + +- [X] [#6945](https://github.com/kubernetes/ingress-nginx/pull/6945) Add option to specify job label for ServiceMonitor + ### 3.26.0 - [X] [#6979](https://github.com/kubernetes/ingress-nginx/pull/6979) Changed servicePort value for metrics diff --git a/charts/ingress-nginx/Chart.yaml b/charts/ingress-nginx/Chart.yaml index d97c3b1e1d..56b5e4c71c 100644 --- a/charts/ingress-nginx/Chart.yaml +++ b/charts/ingress-nginx/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: ingress-nginx # When the version is modified, make sure the artifacthub.io/changes list is updated # Also update CHANGELOG.md -version: 3.26.0 +version: 3.27.0 appVersion: 0.44.0 home: https://github.com/kubernetes/ingress-nginx description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer @@ -21,4 +21,4 @@ annotations: # List of changes for the release in artifacthub.io # https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx?modal=changelog artifacthub.io/changes: | - - Changed servicePort value for metrics + - Add ability to specify jobLabel for ServiceMonitor From 5f77efc9456c2552cca80288d4ad118a3b513925 Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Zaib Date: Tue, 6 Apr 2021 09:51:18 +0200 Subject: [PATCH 3/4] Update changelog --- charts/ingress-nginx/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ingress-nginx/CHANGELOG.md b/charts/ingress-nginx/CHANGELOG.md index bd0453b7c5..de9243c8ea 100644 --- a/charts/ingress-nginx/CHANGELOG.md +++ b/charts/ingress-nginx/CHANGELOG.md @@ -6,7 +6,7 @@ This file documents all notable changes to [ingress-nginx](https://github.com/ku ### 3.27.0 -- [X] [#6945](https://github.com/kubernetes/ingress-nginx/pull/6945) Add option to specify job label for ServiceMonitor +- [X] [#6945](https://github.com/kubernetes/ingress-nginx/pull/7020) Add option to specify job label for ServiceMonitor ### 3.26.0 From 64b5e5b69d1f3a85737f4884421e36a0a78dcf69 Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Zaib Date: Tue, 6 Apr 2021 09:54:58 +0200 Subject: [PATCH 4/4] Remove trailing spaces --- charts/ingress-nginx/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ingress-nginx/Chart.yaml b/charts/ingress-nginx/Chart.yaml index 56b5e4c71c..5ab86965ce 100644 --- a/charts/ingress-nginx/Chart.yaml +++ b/charts/ingress-nginx/Chart.yaml @@ -21,4 +21,4 @@ annotations: # List of changes for the release in artifacthub.io # https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx?modal=changelog artifacthub.io/changes: | - - Add ability to specify jobLabel for ServiceMonitor + - Add ability to specify jobLabel for ServiceMonitor