From eb7ab52fa91d5b873edab8e4720ae8b6b4eae8e9 Mon Sep 17 00:00:00 2001 From: Joe Mifsud Date: Wed, 25 Dec 2024 14:09:01 -0500 Subject: [PATCH 1/4] [prometheus-smartctl-exporter] Add support for device-include / device-exclude and image pull secrets (#4990) * Add support for device-include / device-exclude and image pull secrets Signed-off-by: Joe Mifsud * Change version to minor release, add defaults to values.yaml Signed-off-by: Joe Mifsud * Correct example values.yaml Signed-off-by: Joe Mifsud * Add CI test cases Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Update Chart.yaml Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Drop CI test case with service account Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> --------- Signed-off-by: Joe Mifsud Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus-smartctl-exporter/Chart.yaml | 2 +- .../ci/default-values.yaml | 1 + .../ci/device-exclude-values.yaml | 3 +++ .../ci/device-include-values.yaml | 3 +++ .../ci/prometheusrules-values.yaml | 5 +++++ .../ci/resources-values.yaml | 8 ++++++++ .../ci/servicemonitor-values.yaml | 5 +++++ .../templates/daemonset.yaml | 12 ++++++++++++ charts/prometheus-smartctl-exporter/values.yaml | 5 ++++- 9 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 charts/prometheus-smartctl-exporter/ci/default-values.yaml create mode 100644 charts/prometheus-smartctl-exporter/ci/device-exclude-values.yaml create mode 100644 charts/prometheus-smartctl-exporter/ci/device-include-values.yaml create mode 100644 charts/prometheus-smartctl-exporter/ci/prometheusrules-values.yaml create mode 100644 charts/prometheus-smartctl-exporter/ci/resources-values.yaml create mode 100644 charts/prometheus-smartctl-exporter/ci/servicemonitor-values.yaml diff --git a/charts/prometheus-smartctl-exporter/Chart.yaml b/charts/prometheus-smartctl-exporter/Chart.yaml index 6802e623bb3c..81b0e5112588 100644 --- a/charts/prometheus-smartctl-exporter/Chart.yaml +++ b/charts/prometheus-smartctl-exporter/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.12.0 +version: 0.13.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/prometheus-smartctl-exporter/ci/default-values.yaml b/charts/prometheus-smartctl-exporter/ci/default-values.yaml new file mode 100644 index 000000000000..d6c93d3e865b --- /dev/null +++ b/charts/prometheus-smartctl-exporter/ci/default-values.yaml @@ -0,0 +1 @@ +# default values diff --git a/charts/prometheus-smartctl-exporter/ci/device-exclude-values.yaml b/charts/prometheus-smartctl-exporter/ci/device-exclude-values.yaml new file mode 100644 index 000000000000..54be11996564 --- /dev/null +++ b/charts/prometheus-smartctl-exporter/ci/device-exclude-values.yaml @@ -0,0 +1,3 @@ +# exclude devices +config: + device_exclude: "/dev/sr.*" diff --git a/charts/prometheus-smartctl-exporter/ci/device-include-values.yaml b/charts/prometheus-smartctl-exporter/ci/device-include-values.yaml new file mode 100644 index 000000000000..426bbd674444 --- /dev/null +++ b/charts/prometheus-smartctl-exporter/ci/device-include-values.yaml @@ -0,0 +1,3 @@ +# include devices +config: + device_include: "/dev/sd.*" diff --git a/charts/prometheus-smartctl-exporter/ci/prometheusrules-values.yaml b/charts/prometheus-smartctl-exporter/ci/prometheusrules-values.yaml new file mode 100644 index 000000000000..dc92a7642443 --- /dev/null +++ b/charts/prometheus-smartctl-exporter/ci/prometheusrules-values.yaml @@ -0,0 +1,5 @@ +# enable prometheus rules +prometheusRules: + enabled: true + extraLabels: + release: prometheus-operator diff --git a/charts/prometheus-smartctl-exporter/ci/resources-values.yaml b/charts/prometheus-smartctl-exporter/ci/resources-values.yaml new file mode 100644 index 000000000000..4bbaaad8cb35 --- /dev/null +++ b/charts/prometheus-smartctl-exporter/ci/resources-values.yaml @@ -0,0 +1,8 @@ +# set resources +resources: + limits: + cpu: 100m + memory: 64Mi + requests: + cpu: 100m + memory: 64Mi diff --git a/charts/prometheus-smartctl-exporter/ci/servicemonitor-values.yaml b/charts/prometheus-smartctl-exporter/ci/servicemonitor-values.yaml new file mode 100644 index 000000000000..48802074691e --- /dev/null +++ b/charts/prometheus-smartctl-exporter/ci/servicemonitor-values.yaml @@ -0,0 +1,5 @@ +# enable service monitor +serviceMonitor: + enabled: true + extraLabels: + release: prometheus-operator diff --git a/charts/prometheus-smartctl-exporter/templates/daemonset.yaml b/charts/prometheus-smartctl-exporter/templates/daemonset.yaml index 1500c092698e..1aefec512ee5 100644 --- a/charts/prometheus-smartctl-exporter/templates/daemonset.yaml +++ b/charts/prometheus-smartctl-exporter/templates/daemonset.yaml @@ -35,12 +35,24 @@ spec: {{- include "prometheus-smartctl-exporter.selectorLabels" $global | nindent 8 }} idx: i{{ $idx }} spec: + {{- if $global.Values.image.pullSecrets }} + imagePullSecrets: + {{- range $secret := $global.Values.image.pullSecrets }} + - name: {{ $secret }} + {{- end }} + {{- end }} containers: - image: "{{ $global.Values.image.repository }}:{{ $global.Values.image.tag | default $global.Chart.AppVersion }}" imagePullPolicy: {{ $global.Values.image.pullPolicy }} args: - '--smartctl.path={{ $config.smartctl_location }}' - '--smartctl.interval={{ $config.collect_not_more_than_period }}' +{{- if $config.device_exclude }} + - '--smartctl.device-exclude={{ $config.device_exclude }}' +{{- end }} +{{- if $config.device_include }} + - '--smartctl.device-include={{ $config.device_include }}' +{{- end }} {{ range $config.devices }} - '--smartctl.device={{ . }}' {{ end }} diff --git a/charts/prometheus-smartctl-exporter/values.yaml b/charts/prometheus-smartctl-exporter/values.yaml index d3bcfea73f14..89d7d5a7f217 100644 --- a/charts/prometheus-smartctl-exporter/values.yaml +++ b/charts/prometheus-smartctl-exporter/values.yaml @@ -1,6 +1,8 @@ config: {} # devices: # - /dev/sda +# device_include: /dev/sd.* +# device_exclude: /dev/sr.* extraInstances: [] # - config: @@ -38,9 +40,10 @@ prometheusRules: image: repository: quay.io/prometheuscommunity/smartctl-exporter - pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" + pullPolicy: IfNotPresent + pullSecrets: [] serviceAccount: # Specifies whether a service account should be created From a1ef252ad7757a110d2ddbef6c89c56f4fe8e751 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Fri, 27 Dec 2024 11:10:07 -0500 Subject: [PATCH 2/4] [prometheus-nginx-exporter] bump to 1.4.0 (#5093) * bump to 1.4.0 Signed-off-by: drfaust92 * Add an option in CI test case Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Correct and update comments at options Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Use new flag format Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Add an upgrade note Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Insert namespaceOverride in values.yaml Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Set app version label from image tag first if present Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> --------- Signed-off-by: drfaust92 Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus-nginx-exporter/Chart.lock | 6 +++--- charts/prometheus-nginx-exporter/Chart.yaml | 6 +++--- charts/prometheus-nginx-exporter/README.md | 7 +++++++ charts/prometheus-nginx-exporter/ci/ci-values.yaml | 3 +++ charts/prometheus-nginx-exporter/templates/_helpers.tpl | 4 +--- .../prometheus-nginx-exporter/templates/deployment.yaml | 9 ++++++++- charts/prometheus-nginx-exporter/values.yaml | 8 +++++--- 7 files changed, 30 insertions(+), 13 deletions(-) diff --git a/charts/prometheus-nginx-exporter/Chart.lock b/charts/prometheus-nginx-exporter/Chart.lock index a4bb33abfde9..e8429201d799 100644 --- a/charts/prometheus-nginx-exporter/Chart.lock +++ b/charts/prometheus-nginx-exporter/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: nginx repository: https://charts.bitnami.com/bitnami - version: 15.3.4 -digest: sha256:c5ee96dcdfa5a8ef4aa0a91e734ddedeb3c43f04fa29775a9ec6465f5eeb0192 -generated: "2023-10-15T13:18:06.969016+03:00" + version: 18.3.1 +digest: sha256:0c9d53b23d2d09220457f35ba99516e7fe3a6f1ca71e2d165139d5a83db8430f +generated: "2024-12-24T10:01:22.264584-05:00" diff --git a/charts/prometheus-nginx-exporter/Chart.yaml b/charts/prometheus-nginx-exporter/Chart.yaml index 2aad071b6b51..21152341c6ad 100644 --- a/charts/prometheus-nginx-exporter/Chart.yaml +++ b/charts/prometheus-nginx-exporter/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 description: A Helm chart for NGINX Prometheus Exporter name: prometheus-nginx-exporter -version: 0.2.2 -appVersion: 0.11.0 +version: 1.0.0 +appVersion: 1.4.0 home: https://github.com/nginxinc/nginx-prometheus-exporter sources: - https://github.com/nginxinc/nginx-prometheus-exporter @@ -30,6 +30,6 @@ annotations: type: application dependencies: - name: nginx - version: "15.3.4" + version: "18.3.1" repository: https://charts.bitnami.com/bitnami condition: nginx.enabled diff --git a/charts/prometheus-nginx-exporter/README.md b/charts/prometheus-nginx-exporter/README.md index efc96817b418..adad316833ea 100644 --- a/charts/prometheus-nginx-exporter/README.md +++ b/charts/prometheus-nginx-exporter/README.md @@ -44,6 +44,13 @@ helm upgrade [RELEASE_NAME] prometheus-community/prometheus-nginx-exporter --ins _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ +### To 1.0 + +Chart release 1.0 reflects a major bump of the default NGINX Exporter image tag from major number 0 to 1. + +This release has switched to using flags in the new format (`--flag`) but still supports the +deprecated format (`-flag`) transparently for NGINX Exporter below release 1.0.0. + ## Configuring See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands: diff --git a/charts/prometheus-nginx-exporter/ci/ci-values.yaml b/charts/prometheus-nginx-exporter/ci/ci-values.yaml index 01ea9b1f8792..4c87d0be02cb 100644 --- a/charts/prometheus-nginx-exporter/ci/ci-values.yaml +++ b/charts/prometheus-nginx-exporter/ci/ci-values.yaml @@ -21,3 +21,6 @@ nginx: stub_status on; } } + +options: + nginx.timeout: 10s diff --git a/charts/prometheus-nginx-exporter/templates/_helpers.tpl b/charts/prometheus-nginx-exporter/templates/_helpers.tpl index 08bf752c9fe2..848cb68bc7bd 100644 --- a/charts/prometheus-nginx-exporter/templates/_helpers.tpl +++ b/charts/prometheus-nginx-exporter/templates/_helpers.tpl @@ -62,9 +62,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/component: metrics app.kubernetes.io/part-of: {{ template "prometheus-nginx-exporter.name" . }} {{- include "prometheus-nginx-exporter.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ default .Chart.AppVersion .Values.image.tag | quote }} {{- if .Values.additionalLabels }} {{ toYaml .Values.additionalLabels }} {{- end }} diff --git a/charts/prometheus-nginx-exporter/templates/deployment.yaml b/charts/prometheus-nginx-exporter/templates/deployment.yaml index 1ae04acca18b..96963aecc250 100644 --- a/charts/prometheus-nginx-exporter/templates/deployment.yaml +++ b/charts/prometheus-nginx-exporter/templates/deployment.yaml @@ -37,10 +37,17 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: + {{- if semverCompare ">=1.0.0-0" (coalesce .Values.image.tag .Chart.AppVersion) }} + - "--nginx.scrape-uri={{ tpl .Values.nginxServer . }}" + {{- range $key, $value := .Values.options }} + - "--{{ $key }}{{ if $value }}={{ $value }}{{ end }}" + {{- end }} + {{- else }} - "-nginx.scrape-uri={{ tpl .Values.nginxServer . }}" {{- range $key, $value := .Values.options }} - "-{{ $key }}{{ if $value }}={{ $value }}{{ end }}" - {{- end }} + {{- end}} + {{- end}} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/charts/prometheus-nginx-exporter/values.yaml b/charts/prometheus-nginx-exporter/values.yaml index 812120cf7684..dcedc218d6b3 100644 --- a/charts/prometheus-nginx-exporter/values.yaml +++ b/charts/prometheus-nginx-exporter/values.yaml @@ -27,14 +27,17 @@ image: nameOverride: "" fullnameOverride: "" +# Overide deployment namespace +namespaceOverride: "" + # Add your nginx server details here nginxServer: "http://{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local:8080/stub_status" # nginxServer: "http://frontend.default.svc.cluster.local:8080/stub_status" # Arguments - https://github.com/nginxinc/nginx-prometheus-exporter#command-line-arguments options: {} - # -nginx.plus - # -nginx.retries int + # nginx.plus: + # nginx.timeout: 5s livenessProbe: httpGet: @@ -57,7 +60,6 @@ service: podAnnotations: {} - resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little From 4dac64a380b2d76b94055dc12f9f13ae819dcb59 Mon Sep 17 00:00:00 2001 From: Julio Chana Date: Sat, 28 Dec 2024 08:20:10 +0100 Subject: [PATCH 3/4] feat: Create secret to store credentials when provided (#5099) Signed-off-by: Julio Chana --- .../prometheus-rabbitmq-exporter/Chart.yaml | 2 +- .../templates/deployment.yaml | 10 +++++++-- .../templates/secret.yaml | 22 +++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 charts/prometheus-rabbitmq-exporter/templates/secret.yaml diff --git a/charts/prometheus-rabbitmq-exporter/Chart.yaml b/charts/prometheus-rabbitmq-exporter/Chart.yaml index f34a2bd47669..50d5adf1680d 100644 --- a/charts/prometheus-rabbitmq-exporter/Chart.yaml +++ b/charts/prometheus-rabbitmq-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Rabbitmq metrics exporter for prometheus name: prometheus-rabbitmq-exporter -version: 1.12.1 +version: 1.13.0 appVersion: v0.29.0 home: https://github.com/kbudde/rabbitmq_exporter sources: diff --git a/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml b/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml index 887364b2899e..69fb579c81ec 100644 --- a/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml +++ b/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml @@ -57,7 +57,10 @@ spec: key: "{{ .Values.rabbitmq.existingPasswordSecretKey }}" {{- else if .Values.rabbitmq.password }} - name: RABBIT_PASSWORD - value: {{ .Values.rabbitmq.password }} + valueFrom: + secretKeyRef: + name: {{ template "prometheus-rabbitmq-exporter.fullname" . }} + key: RABBIT_PASSWORD {{- end }} {{- if .Values.rabbitmq.existingUserSecret }} - name: RABBIT_USER @@ -67,7 +70,10 @@ spec: key: "{{ .Values.rabbitmq.existingUserSecretKey }}" {{- else if .Values.rabbitmq.user }} - name: RABBIT_USER - value: {{ .Values.rabbitmq.user }} + valueFrom: + secretKeyRef: + name: {{ template "prometheus-rabbitmq-exporter.fullname" . }} + key: RABBIT_USER {{- end }} {{- if .Values.rabbitmq.url }} - name: RABBIT_URL diff --git a/charts/prometheus-rabbitmq-exporter/templates/secret.yaml b/charts/prometheus-rabbitmq-exporter/templates/secret.yaml new file mode 100644 index 000000000000..c58c1ec75bd2 --- /dev/null +++ b/charts/prometheus-rabbitmq-exporter/templates/secret.yaml @@ -0,0 +1,22 @@ +{{- if or (and (.Values.rabbitmq.password) (not .Values.rabbitmq.existingPasswordSecret)) (and (.Values.rabbitmq.user) (not .Values.rabbitmq.existingUserSecret)) }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "prometheus-rabbitmq-exporter.fullname" . }} + labels: + app: {{ template "prometheus-rabbitmq-exporter.name" . }} + chart: {{ template "prometheus-rabbitmq-exporter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- if .Values.additionalLabels }} +{{ toYaml .Values.additionalLabels | indent 4 }} + {{- end }} +type: Opaque +data: + {{- if and (.Values.rabbitmq.password) (not .Values.rabbitmq.existingPasswordSecret) }} + RABBIT_PASSWORD: {{ .Values.rabbitmq.password | b64enc }} + {{- end }} + {{- if and (.Values.rabbitmq.user) (not .Values.rabbitmq.existingUserSecret) }} + RABBIT_USER: {{ .Values.rabbitmq.user | b64enc }} + {{- end }} +{{- end }} From 5710cd2952759450a32917a8d07f04ed725b4db3 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Sun, 29 Dec 2024 12:39:55 -0500 Subject: [PATCH 4/4] add home link in chart.yaml (#5098) Signed-off-by: drfaust92 Co-authored-by: MH --- charts/prometheus-json-exporter/Chart.yaml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/charts/prometheus-json-exporter/Chart.yaml b/charts/prometheus-json-exporter/Chart.yaml index 1f31e32cebe1..c0782d992a16 100644 --- a/charts/prometheus-json-exporter/Chart.yaml +++ b/charts/prometheus-json-exporter/Chart.yaml @@ -5,28 +5,10 @@ keywords: - metric - monitoring - prometheus - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.14.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. +version: 0.14.1 appVersion: "v0.6.0" - +home: https://github.com/prometheus-community/json_exporter maintainers: - name: schmiddim email: schmiddim@gmx.at