From 4bd9ee5794b26855ddaf4668a1148868e4397880 Mon Sep 17 00:00:00 2001 From: cseeger-harris <97911100+cseeger-harris@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:35:43 -0800 Subject: [PATCH 1/3] Add deployment annotations, move pod to similar structure Signed-off-by: cseeger-harris <97911100+cseeger-harris@users.noreply.github.com> --- charts/prometheus-sql-exporter/Chart.yaml | 2 +- .../templates/deployment.yaml | 15 +++++++++++---- charts/prometheus-sql-exporter/values.yaml | 10 ++++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/charts/prometheus-sql-exporter/Chart.yaml b/charts/prometheus-sql-exporter/Chart.yaml index 0722b57e4db4..c3de8dce7f4a 100644 --- a/charts/prometheus-sql-exporter/Chart.yaml +++ b/charts/prometheus-sql-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Prometheus SQL Exporter name: prometheus-sql-exporter -version: 0.2.0 +version: 0.2.1 appVersion: v0.5.8 home: https://github.com/justwatchcom/sql_exporter sources: diff --git a/charts/prometheus-sql-exporter/templates/deployment.yaml b/charts/prometheus-sql-exporter/templates/deployment.yaml index a99b429f0f4a..90d60eab6393 100644 --- a/charts/prometheus-sql-exporter/templates/deployment.yaml +++ b/charts/prometheus-sql-exporter/templates/deployment.yaml @@ -4,6 +4,13 @@ metadata: name: {{ template "prometheus-sql-exporter.fullname" . }} labels: {{- include "prometheus-sql-exporter.labels" . | nindent 4 }} + {{- if .Values.deployment.labels }} + {{- toYaml .Values.deployment.labels | trim | nindent 4 }} + {{- end }} + {{- if .Values.deployment.annotations }} + annotations: + {{- toYaml .Values.deployment.annotations | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.replicaCount }} selector: @@ -13,13 +20,13 @@ spec: metadata: labels: {{- include "prometheus-sql-exporter.selectorLabels" . | nindent 8 }} - {{- if .Values.podLabels }} -{{ toYaml .Values.podLabels | trim | indent 8 }} + {{- if .Values.pod.labels }} +{{ toYaml .Values.pod.labels | trim | indent 8 }} {{- end }} annotations: kubectl.kubernetes.io/default-container: {{ .Chart.Name }} -{{- if .Values.annotations }} -{{ toYaml .Values.annotations | indent 8 }} +{{- if .Values.pod.annotations }} +{{ toYaml .Values.pod.annotations | indent 8 }} {{- end }} spec: serviceAccountName: {{ template "prometheus-sql-exporter.serviceAccountName" . }} diff --git a/charts/prometheus-sql-exporter/values.yaml b/charts/prometheus-sql-exporter/values.yaml index 221cfed17678..67a771968952 100644 --- a/charts/prometheus-sql-exporter/values.yaml +++ b/charts/prometheus-sql-exporter/values.yaml @@ -129,9 +129,15 @@ tolerations: [] affinity: {} -annotations: {} +# Labels and annotations to attach to the pod resource +pod: + annotations: {} + labels: {} -podLabels: {} +# Labels and annotations to attach to the deployment resource +deployment: + labels: {} + annotations: {} # Configurable health checks livenessProbe: From bd8b9512bfbec51ce3fed2390e6acecca1dcce64 Mon Sep 17 00:00:00 2001 From: cseeger-harris <97911100+cseeger-harris@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:45:39 -0800 Subject: [PATCH 2/3] move order to match pod Signed-off-by: cseeger-harris <97911100+cseeger-harris@users.noreply.github.com> --- charts/prometheus-sql-exporter/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/prometheus-sql-exporter/values.yaml b/charts/prometheus-sql-exporter/values.yaml index 67a771968952..ab505aaf3566 100644 --- a/charts/prometheus-sql-exporter/values.yaml +++ b/charts/prometheus-sql-exporter/values.yaml @@ -136,8 +136,8 @@ pod: # Labels and annotations to attach to the deployment resource deployment: - labels: {} annotations: {} + labels: {} # Configurable health checks livenessProbe: From 041eb95ebb6b59ecf521847132bfd859d1c50ace Mon Sep 17 00:00:00 2001 From: cseeger-harris <97911100+cseeger-harris@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:53:55 -0800 Subject: [PATCH 3/3] revert pod label changes to prevent breakage Signed-off-by: cseeger-harris <97911100+cseeger-harris@users.noreply.github.com> --- charts/prometheus-sql-exporter/templates/deployment.yaml | 8 ++++---- charts/prometheus-sql-exporter/values.yaml | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/charts/prometheus-sql-exporter/templates/deployment.yaml b/charts/prometheus-sql-exporter/templates/deployment.yaml index 90d60eab6393..a68a3cedefdd 100644 --- a/charts/prometheus-sql-exporter/templates/deployment.yaml +++ b/charts/prometheus-sql-exporter/templates/deployment.yaml @@ -20,13 +20,13 @@ spec: metadata: labels: {{- include "prometheus-sql-exporter.selectorLabels" . | nindent 8 }} - {{- if .Values.pod.labels }} -{{ toYaml .Values.pod.labels | trim | indent 8 }} + {{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | trim | indent 8 }} {{- end }} annotations: kubectl.kubernetes.io/default-container: {{ .Chart.Name }} -{{- if .Values.pod.annotations }} -{{ toYaml .Values.pod.annotations | indent 8 }} +{{- if .Values.annotations }} +{{ toYaml .Values.annotations | indent 8 }} {{- end }} spec: serviceAccountName: {{ template "prometheus-sql-exporter.serviceAccountName" . }} diff --git a/charts/prometheus-sql-exporter/values.yaml b/charts/prometheus-sql-exporter/values.yaml index ab505aaf3566..e010cd7ce70a 100644 --- a/charts/prometheus-sql-exporter/values.yaml +++ b/charts/prometheus-sql-exporter/values.yaml @@ -129,10 +129,9 @@ tolerations: [] affinity: {} -# Labels and annotations to attach to the pod resource -pod: - annotations: {} - labels: {} +annotations: {} + +podLabels: {} # Labels and annotations to attach to the deployment resource deployment: