diff --git a/charts/prometheus-postgres-exporter/Chart.yaml b/charts/prometheus-postgres-exporter/Chart.yaml index eb653698ea57..84e8c3be94d8 100644 --- a/charts/prometheus-postgres-exporter/Chart.yaml +++ b/charts/prometheus-postgres-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "v0.16.0" description: A Helm chart for prometheus postgres-exporter name: prometheus-postgres-exporter -version: 6.5.0 +version: 6.6.0 home: https://github.com/prometheus-community/postgres_exporter sources: - https://github.com/prometheus-community/postgres_exporter diff --git a/charts/prometheus-postgres-exporter/templates/deployment.yaml b/charts/prometheus-postgres-exporter/templates/deployment.yaml index d7acda68696c..8c9165b5df94 100644 --- a/charts/prometheus-postgres-exporter/templates/deployment.yaml +++ b/charts/prometheus-postgres-exporter/templates/deployment.yaml @@ -159,7 +159,7 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: - {{- if .Values.config.postgresExporter }} + {{- if or .Values.config.postgresExporter .Values.config.existingSecret.enabled }} - name: postgres-exporter mountPath: /etc/postgres_exporter.yml subPath: postgres_exporter.yml @@ -195,7 +195,13 @@ spec: defaultMode: 420 name: {{ template "prometheus-postgres-exporter.fullname" . }} name: postgres-exporter - {{- end }} + {{- else if .Values.config.existingSecret.enabled }} + - secret: + defaultMode: 420 + secretName: {{ .Values.config.existingSecret.name }} + name: postgres-exporter + {{ end}} + {{- with .Values.extraVolumes }} {{ toYaml . | nindent 6 }} {{- end }} diff --git a/charts/prometheus-postgres-exporter/values.yaml b/charts/prometheus-postgres-exporter/values.yaml index 4686bce43e39..8d718f0ce717 100644 --- a/charts/prometheus-postgres-exporter/values.yaml +++ b/charts/prometheus-postgres-exporter/values.yaml @@ -189,6 +189,12 @@ config: # options: # sslmode: disable + # define an existing secret to be mounted as the config file + # needs to have the key 'postgres_exporter.yml' + existingSecret: + enabled: false + name: "" + nodeSelector: {} tolerations: [] diff --git a/charts/prometheus/templates/pdb.yaml b/charts/prometheus/templates/pdb.yaml index 7ffe67307116..fffbdc62fc87 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -11,5 +11,16 @@ spec: selector: matchLabels: {{- include "prometheus.server.matchLabels" . | nindent 6 }} - {{- toYaml $pdbSpec | nindent 2 }} + {{- if not (or (hasKey $pdbSpec "minAvailable") (hasKey $pdbSpec "maxUnavailable")) }} + maxUnavailable: 1 + {{- end }} + {{- if hasKey $pdbSpec "minAvailable" }} + minAvailable: {{ $pdbSpec.minAvailable }} + {{- end }} + {{- if hasKey $pdbSpec "maxUnavailable" }} + maxUnavailable: {{ $pdbSpec.maxUnavailable }} + {{- end }} + {{- if hasKey $pdbSpec "unhealthyPodEvictionPolicy" }} + unhealthyPodEvictionPolicy: {{ $pdbSpec.unhealthyPodEvictionPolicy }} + {{- end }} {{- end }} diff --git a/charts/prometheus/values.yaml b/charts/prometheus/values.yaml index f5edbbf4fd09..a81d7a0a6fea 100644 --- a/charts/prometheus/values.yaml +++ b/charts/prometheus/values.yaml @@ -453,7 +453,7 @@ server: ## podDisruptionBudget: enabled: false - maxUnavailable: 1 + # maxUnavailable: 1 # minAvailable: 1 ## unhealthyPodEvictionPolicy is available since 1.27.0 (beta) ## https://kubernetes.io/docs/tasks/run-application/configure-pdb/#unhealthy-pod-eviction-policy