11{{- if eq .Values.kind "Deployment" }}
2- apiVersion : {{ template " deployment.apiVersion" . }}
2+ apiVersion : {{ include "common.capabilities. deployment.apiVersion" . }}
33kind : Deployment
44metadata :
5- name : {{ include "pgbouncer.fullname" . }}
6- labels :
7- {{- include "pgbouncer.labels" . | nindent 4 }}
5+ name : {{ include "common.names.fullname" . }}
6+ labels : {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
7+ {{- if .Values.commonAnnotations }}
8+ annotations : {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
9+ {{- end }}
810spec :
911 replicas : {{ .Values.replicaCount }}
1012 revisionHistoryLimit : {{ .Values.revisionHistoryLimit }}
@@ -14,18 +16,12 @@ spec:
1416 {{ if .Values.minReadySeconds -}}
1517 minReadySeconds : {{ .Values.minReadySeconds }}
1618 {{ end -}}
19+ {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }}
1720 selector :
18- matchLabels :
19- {{- include "pgbouncer.selectorLabels" . | nindent 6 }}
21+ matchLabels : {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
2022 template :
2123 metadata :
22- labels :
23- {{- include "pgbouncer.selectorLabels" . | nindent 8 }}
24- {{- if .Values.podLabels }}
25- {{- range $key, $value := .Values.podLabels }}
26- {{ $key }}: {{ $value | quote }}
27- {{- end -}}
28- {{- end }}
24+ labels : {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
2925 annotations :
3026 checksum/config : {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
3127 checksum/userlist : {{ include (print $.Template.BasePath "/userlist-secret.yaml") . | sha256sum }}
3531 prometheus.io/port : " {{ .Values.pgbouncerExporter.servicePort }}"
3632 prometheus.io/path : " /metrics"
3733 {{- end }}
38- {{- range $key, $value := .Values.podAnnotations }}
39- {{ $key }}: {{ $ value | quote }}
34+ {{- if .Values.podAnnotations }}
35+ {{- include "common.tplvalues.render" (dict " value" .Values.podAnnotations "context" $) | nindent 8 }}
4036 {{- end }}
4137 spec :
4238 serviceAccountName : {{ template "pgbouncer.serviceAccountName" . }}
@@ -150,22 +146,22 @@ spec:
150146 - name : PGBOUNCER_USER
151147 valueFrom :
152148 secretKeyRef :
153- name : {{ .Values.config.existingAdminSecret | default (printf "%s-secret" (include "pgbouncer .fullname" .)) }}
149+ name : {{ .Values.config.existingAdminSecret | default (printf "%s-secret" (include "common.names .fullname" .)) }}
154150 key : {{ .Values.config.adminUserKey | default "adminUser" }}
155151 - name : PGBOUNCER_PASS
156152 valueFrom :
157153 secretKeyRef :
158- name : {{ .Values.config.existingAdminSecret | default (printf "%s-secret" (include "pgbouncer .fullname" .)) }}
154+ name : {{ .Values.config.existingAdminSecret | default (printf "%s-secret" (include "common.names .fullname" .)) }}
159155 key : {{ .Values.config.adminPasswordKey | default "adminPassword" }}
160156 - name : PGUSER
161157 valueFrom :
162158 secretKeyRef :
163- name : {{ .Values.config.existingAdminSecret | default (printf "%s-secret" (include "pgbouncer .fullname" .)) }}
159+ name : {{ .Values.config.existingAdminSecret | default (printf "%s-secret" (include "common.names .fullname" .)) }}
164160 key : {{ .Values.config.adminUserKey | default "adminUser" }}
165161 - name : PGPASSWORD
166162 valueFrom :
167163 secretKeyRef :
168- name : {{ .Values.config.existingAdminSecret | default (printf "%s-secret" (include "pgbouncer .fullname" .)) }}
164+ name : {{ .Values.config.existingAdminSecret | default (printf "%s-secret" (include "common.names .fullname" .)) }}
169165 key : {{ .Values.config.adminPasswordKey | default "adminPassword" }}
170166 {{- if .Values.pgbouncerExporter.resources }}
171167 resources : {{ toYaml .Values.pgbouncerExporter.resources | trimSuffix "\n" | nindent 10 }}
@@ -186,10 +182,10 @@ spec:
186182 emptyDir : {}
187183 - name : config
188184 configMap :
189- name : {{ template "pgbouncer .fullname" . }}-configmap
185+ name : {{ template "common.names .fullname" . }}-configmap
190186 - name : userlist
191187 secret :
192- secretName : {{ .Values.config.existingUserlistSecret | default (printf "%s-userlist-secret" (include "pgbouncer .fullname" .)) }}
188+ secretName : {{ .Values.config.existingUserlistSecret | default (printf "%s-userlist-secret" (include "common.names .fullname" .)) }}
193189 {{- if .Values.extraVolumes -}}
194190 {{ toYaml .Values.extraVolumes | trimSuffix "\n" | nindent 6 }}
195191 {{ end -}}
0 commit comments