From 98b84201a4436ec6d076680e3f276232618717fa Mon Sep 17 00:00:00 2001 From: Baargav Date: Mon, 15 Apr 2024 09:24:36 -0400 Subject: [PATCH 1/5] [prometheus-blackbox-exporter] Ensure Config Reloader does not inherit same resources as blackbox exporter (#4418) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ensure configReloader does not get same resources as the exporter Signed-off-by: Baargav * Bump chart version Signed-off-by: Baargav --------- Signed-off-by: Baargav Signed-off-by: André Bauer Co-authored-by: André Bauer --- charts/prometheus-blackbox-exporter/Chart.yaml | 2 +- charts/prometheus-blackbox-exporter/templates/_helpers.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/prometheus-blackbox-exporter/Chart.yaml b/charts/prometheus-blackbox-exporter/Chart.yaml index 4c6d5debb604..94a22523a63d 100644 --- a/charts/prometheus-blackbox-exporter/Chart.yaml +++ b/charts/prometheus-blackbox-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Prometheus Blackbox Exporter name: prometheus-blackbox-exporter -version: 8.15.0 +version: 8.15.1 appVersion: v0.25.0 home: https://github.com/prometheus/blackbox_exporter sources: diff --git a/charts/prometheus-blackbox-exporter/templates/_helpers.tpl b/charts/prometheus-blackbox-exporter/templates/_helpers.tpl index 7eab07ff31d8..30039b893efc 100644 --- a/charts/prometheus-blackbox-exporter/templates/_helpers.tpl +++ b/charts/prometheus-blackbox-exporter/templates/_helpers.tpl @@ -186,7 +186,7 @@ containers: - --listen-address=:{{ .Values.configReloader.containerPort }} - --log-format={{ .Values.configReloader.config.logFormat }} - --log-level={{ .Values.configReloader.config.logLevel }} - {{- with .Values.resources }} + {{- with .Values.configReloader.resources }} resources: {{- toYaml . | nindent 4 }} {{- end }} From d1d865fa55b736d5a03445d7a199d3ffb9c319c3 Mon Sep 17 00:00:00 2001 From: Thanasis Petrovas <108522410+than-pet@users.noreply.github.com> Date: Mon, 15 Apr 2024 23:32:25 +0300 Subject: [PATCH 2/5] [kube-promettheus-stack] fix ThanosRuler custom resource name label selector (#4458) --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/thanos-ruler/podDisruptionBudget.yaml | 2 +- .../kube-prometheus-stack/templates/thanos-ruler/ruler.yaml | 4 ++-- .../kube-prometheus-stack/templates/thanos-ruler/service.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 5a7b6409d86a..72c2bb662d85 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -23,7 +23,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 58.1.1 +version: 58.1.2 appVersion: v0.73.1 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/thanos-ruler/podDisruptionBudget.yaml b/charts/kube-prometheus-stack/templates/thanos-ruler/podDisruptionBudget.yaml index 83e54edf9b51..c28f9146477f 100644 --- a/charts/kube-prometheus-stack/templates/thanos-ruler/podDisruptionBudget.yaml +++ b/charts/kube-prometheus-stack/templates/thanos-ruler/podDisruptionBudget.yaml @@ -17,5 +17,5 @@ spec: selector: matchLabels: app.kubernetes.io/name: thanos-ruler - thanos-ruler: {{ template "kube-prometheus-stack.thanosRuler.name" . }} + thanos-ruler: {{ template "kube-prometheus-stack.thanosRuler.crname" . }} {{- end }} diff --git a/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml b/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml index 908d6a45aa42..123dc245e107 100644 --- a/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml +++ b/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml @@ -142,7 +142,7 @@ spec: labelSelector: matchExpressions: - {key: app.kubernetes.io/name, operator: In, values: [thanos-ruler]} - - {key: thanos-ruler, operator: In, values: [{{ template "kube-prometheus-stack.thanosRuler.name" . }}]} + - {key: thanos-ruler, operator: In, values: [{{ template "kube-prometheus-stack.thanosRuler.crname" . }}]} {{- else if eq .Values.thanosRuler.thanosRulerSpec.podAntiAffinity "soft" }} podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: @@ -152,7 +152,7 @@ spec: labelSelector: matchExpressions: - {key: app.kubernetes.io/name, operator: In, values: [thanos-ruler]} - - {key: thanos-ruler, operator: In, values: [{{ template "kube-prometheus-stack.thanosRuler.name" . }}]} + - {key: thanos-ruler, operator: In, values: [{{ template "kube-prometheus-stack.thanosRuler.crname" . }}]} {{- end }} {{- if .Values.thanosRuler.thanosRulerSpec.tolerations }} tolerations: diff --git a/charts/kube-prometheus-stack/templates/thanos-ruler/service.yaml b/charts/kube-prometheus-stack/templates/thanos-ruler/service.yaml index be0c8445910d..e08b71ff82d9 100644 --- a/charts/kube-prometheus-stack/templates/thanos-ruler/service.yaml +++ b/charts/kube-prometheus-stack/templates/thanos-ruler/service.yaml @@ -48,6 +48,6 @@ spec: {{- end }} selector: app.kubernetes.io/name: thanos-ruler - thanos-ruler: {{ template "kube-prometheus-stack.thanosRuler.name" . }} + thanos-ruler: {{ template "kube-prometheus-stack.thanosRuler.crname" . }} type: "{{ .Values.thanosRuler.service.type }}" {{- end }} From 95df064d8a345eef36aa01145a078578e138417a Mon Sep 17 00:00:00 2001 From: gasmick <33287410+gasmick@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:41:40 +0200 Subject: [PATCH 3/5] [prometheus-pushgateway] add support for basic authentication (#4447) * [prometheus-pushgateway]: add support for basic authentication Signed-off-by: gasmick <33287410+gasmick@users.noreply.github.com> * [prometheus-pushgateway]: bump major instead of minor version Signed-off-by: gasmick <33287410+gasmick@users.noreply.github.com> * [prometheus-pushgateway] omit args if empty Signed-off-by: gasmick <33287410+gasmick@users.noreply.github.com> * [prometheus-pushgateway] add default labels to Secret Signed-off-by: gasmick <33287410+gasmick@users.noreply.github.com> * [prometheus-pushgateway] add support for setting httpHeaders for probes in Values Signed-off-by: gasmick <33287410+gasmick@users.noreply.github.com> * Add corrections in README Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Correct textlint directive in README Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> --------- Signed-off-by: gasmick <33287410+gasmick@users.noreply.github.com> Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus-pushgateway/Chart.yaml | 2 +- charts/prometheus-pushgateway/README.md | 12 +-- .../templates/_helpers.tpl | 78 ++++++++++++++++++- .../templates/secret.yaml | 10 +++ charts/prometheus-pushgateway/values.yaml | 6 ++ 5 files changed, 98 insertions(+), 10 deletions(-) create mode 100644 charts/prometheus-pushgateway/templates/secret.yaml diff --git a/charts/prometheus-pushgateway/Chart.yaml b/charts/prometheus-pushgateway/Chart.yaml index 6e4aa38a5dd8..9e48152adda4 100644 --- a/charts/prometheus-pushgateway/Chart.yaml +++ b/charts/prometheus-pushgateway/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "v1.8.0" description: A Helm chart for prometheus pushgateway name: prometheus-pushgateway -version: 2.11.0 +version: 2.12.0 home: https://github.com/prometheus/pushgateway sources: - https://github.com/prometheus/pushgateway diff --git a/charts/prometheus-pushgateway/README.md b/charts/prometheus-pushgateway/README.md index 1865d47181c3..cc6645fdf9cd 100644 --- a/charts/prometheus-pushgateway/README.md +++ b/charts/prometheus-pushgateway/README.md @@ -1,18 +1,18 @@ # Prometheus Pushgateway -This chart bootstraps a prometheus [pushgateway](http://github.com/prometheus/pushgateway) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. +This chart bootstraps a Prometheus [Pushgateway](http://github.com/prometheus/pushgateway) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. -An optional prometheus `ServiceMonitor` can be enabled, should you wish to use this gateway with a [Prometheus Operator](https://github.com/coreos/prometheus-operator). +An optional prometheus `ServiceMonitor` can be enabled, should you wish to use this gateway with [Prometheus Operator](https://github.com/coreos/prometheus-operator). ## Get Repository Info - + ```console helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update ``` -_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._ - +_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._ + ## Install Chart ```console @@ -36,7 +36,7 @@ _See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command doc ## Upgrading Chart ```console -helm upgrade [RELEASE_NAME] [CHART] --install +helm upgrade [RELEASE_NAME] prometheus-community/prometheus-pushgateway --install ``` _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ diff --git a/charts/prometheus-pushgateway/templates/_helpers.tpl b/charts/prometheus-pushgateway/templates/_helpers.tpl index af9bad350e62..dcd42ff36bee 100644 --- a/charts/prometheus-pushgateway/templates/_helpers.tpl +++ b/charts/prometheus-pushgateway/templates/_helpers.tpl @@ -111,6 +111,26 @@ Define Ingress apiVersion {{- end }} {{- end }} +{{/* +Define webConfiguration +*/}} +{{- define "prometheus-pushgateway.webConfiguration" -}} +basic_auth_users: +{{- range $k, $v := .Values.webConfiguration.basicAuthUsers }} + {{ $k }}: {{ htpasswd "" $v | trimPrefix ":"}} +{{- end }} +{{- end }} + +{{/* +Define Authorization +*/}} +{{- define "prometheus-pushgateway.Authorization" -}} +{{- $users := keys .Values.webConfiguration.basicAuthUsers }} +{{- $user := first $users }} +{{- $password := index .Values.webConfiguration.basicAuthUsers $user }} +{{- $user }}:{{ $password }} +{{- end }} + {{/* Returns pod spec */}} @@ -143,21 +163,58 @@ containers: env: {{- toYaml . | nindent 6 }} {{- end }} - {{- with .Values.extraArgs }} + {{- if or .Values.extraArgs .Values.webConfiguration }} args: + {{- with .Values.extraArgs }} {{- toYaml . | nindent 6 }} {{- end }} + {{- if .Values.webConfiguration }} + - --web.config.file=/etc/config/web-config.yaml + {{- end }} + {{- end }} ports: - name: metrics containerPort: 9091 protocol: TCP {{- if .Values.liveness.enabled }} + {{- $livenessCommon := omit .Values.liveness.probe "httpGet" }} livenessProbe: - {{- toYaml .Values.liveness.probe | nindent 6 }} + {{- with .Values.liveness.probe }} + httpGet: + path: {{ .httpGet.path }} + port: {{ .httpGet.port }} + {{- if or .httpGet.httpHeaders $.Values.webConfiguration.basicAuthUsers }} + httpHeaders: + {{- if $.Values.webConfiguration.basicAuthUsers }} + - name: Authorization + value: Basic {{ include "prometheus-pushgateway.Authorization" $ | b64enc }} + {{- end }} + {{- with .httpGet.httpHeaders }} + {{- toYaml . | nindent 10 }} + {{- end }} + {{- end }} + {{- toYaml $livenessCommon | nindent 6 }} + {{- end }} {{- end }} {{- if .Values.readiness.enabled }} + {{- $readinessCommon := omit .Values.readiness.probe "httpGet" }} readinessProbe: - {{- toYaml .Values.readiness.probe | nindent 6 }} + {{- with .Values.readiness.probe }} + httpGet: + path: {{ .httpGet.path }} + port: {{ .httpGet.port }} + {{- if or .httpGet.httpHeaders $.Values.webConfiguration.basicAuthUsers }} + httpHeaders: + {{- if $.Values.webConfiguration.basicAuthUsers }} + - name: Authorization + value: Basic {{ include "prometheus-pushgateway.Authorization" $ | b64enc }} + {{- end }} + {{- with .httpGet.httpHeaders }} + {{- toYaml . | nindent 10 }} + {{- end }} + {{- end }} + {{- toYaml $readinessCommon | nindent 6 }} + {{- end }} {{- end }} {{- with .Values.resources }} resources: @@ -171,6 +228,10 @@ containers: - name: storage-volume mountPath: "{{ .Values.persistentVolume.mountPath }}" subPath: "{{ .Values.persistentVolume.subPath }}" + {{- if .Values.webConfiguration }} + - name: web-config + mountPath: "/etc/config" + {{- end }} {{- with .Values.extraVolumeMounts }} {{- toYaml . | nindent 6 }} {{- end }} @@ -223,10 +284,21 @@ volumes: {{- else }} emptyDir: {} {{- end }} + {{- if .Values.webConfiguration }} + - name: web-config + secret: + secretName: {{ include "prometheus-pushgateway.fullname" . }} + {{- end }} {{- end }} {{- if .Values.extraVolumes }} {{- toYaml .Values.extraVolumes | nindent 2 }} {{- else if $storageVolumeAsPVCTemplate }} + {{- if .Values.webConfiguration }} + - name: web-config + secret: + secretName: {{ include "prometheus-pushgateway.fullname" . }} + {{- else }} [] {{- end }} + {{- end }} {{- end }} diff --git a/charts/prometheus-pushgateway/templates/secret.yaml b/charts/prometheus-pushgateway/templates/secret.yaml new file mode 100644 index 000000000000..a8142d138978 --- /dev/null +++ b/charts/prometheus-pushgateway/templates/secret.yaml @@ -0,0 +1,10 @@ +{{- if .Values.webConfiguration }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "prometheus-pushgateway.fullname" . }} + labels: + {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }} +data: + web-config.yaml: {{ include "prometheus-pushgateway.webConfiguration" . | b64enc}} +{{- end }} diff --git a/charts/prometheus-pushgateway/values.yaml b/charts/prometheus-pushgateway/values.yaml index 8d33fac24629..062711fb64c2 100644 --- a/charts/prometheus-pushgateway/values.yaml +++ b/charts/prometheus-pushgateway/values.yaml @@ -107,6 +107,12 @@ resources: {} # cpu: 100m # memory: 30Mi +# -- Sets web configuration +# To enable basic authentication, provide basicAuthUsers as a map +webConfiguration: {} + # basicAuthUsers: + # username: password + liveness: enabled: true probe: From ac29a4d7bd2766e588e4db01b565920c46978537 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 16 Apr 2024 21:13:31 +0300 Subject: [PATCH 4/5] [prometheus-memcached-exporter] bump to 0.14.3 (#4443) Signed-off-by: drfaust92 --- charts/prometheus-memcached-exporter/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/prometheus-memcached-exporter/Chart.yaml b/charts/prometheus-memcached-exporter/Chart.yaml index 7cf79b940e36..93317e5fcf31 100644 --- a/charts/prometheus-memcached-exporter/Chart.yaml +++ b/charts/prometheus-memcached-exporter/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: prometheus-memcached-exporter description: Prometheus exporter for Memcached metrics type: application -version: 0.3.1 -appVersion: "v0.14.2" +version: 0.3.2 +appVersion: "v0.14.3" home: https://github.com/prometheus/memcached_exporter sources: - https://github.com/prometheus/memcached_exporter From 71f21809fe80b57368e1bbf2a938e8fdc1322002 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 16 Apr 2024 22:29:25 +0300 Subject: [PATCH 5/5] [kube-prometheus-stack] bump prom to 2.51.2 (#4459) --- charts/kube-prometheus-stack/Chart.yaml | 2 +- charts/kube-prometheus-stack/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 72c2bb662d85..379a94a4ab1c 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -23,7 +23,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 58.1.2 +version: 58.1.3 appVersion: v0.73.1 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 12649e2adeda..8fcb6e35de52 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -3350,7 +3350,7 @@ prometheus: image: registry: quay.io repository: prometheus/prometheus - tag: v2.51.1 + tag: v2.51.2 sha: "" ## Tolerations for use with node taints