prometheus-postgres-exporter/templates/prometheus-postgres-exporter/deployment.yaml
Markus Pesch fb218484d0
All checks were successful
Generate README / generate-parameters (push) Successful in 28s
Helm / helm-lint (push) Successful in 16s
Helm / helm-unittest (push) Successful in 18s
Markdown linter / markdown-link-checker (push) Successful in 30s
Markdown linter / markdown-lint (push) Successful in 26s
Release / publish-chart (push) Successful in 20s
fix(deployment): add missing rolling release strategy
2025-01-19 21:45:16 +01:00

132 lines
4.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
{{- with (include "prometheus-postgres-exporter.deployment.annotations" . | fromYaml) }}
annotations:
{{- tpl (. | toYaml) $ | nindent 4 }}
{{- end }}
{{- with (include "prometheus-postgres-exporter.deployment.labels" . | fromYaml) }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "prometheus-postgres-exporter.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.deployment.replicas }}
selector:
matchLabels:
{{- include "prometheus-postgres-exporter.pod.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "prometheus-postgres-exporter.pod.labels" . | nindent 8 }}
spec:
{{- with .Values.deployment.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: postgres-exporter
args:
- "--config.file=/etc/prometheus-postgres-exporter/config.d/exporterConfig.yaml"
- "--web.config.file=/etc/prometheus-postgres-exporter/config.d/webConfig.yaml"
- "--web.listen-address=:9187"
{{- range .Values.deployment.postgresExporter.args }}
- {{ . | quote }}
{{- end }}
{{- $env := (include "prometheus-postgres-exporter.deployment.env" . | fromYaml) }}
{{- if and (hasKey $env "env") (gt (len $env.env) 0) }}
env:
{{- toYaml $env.env | nindent 8 }}
{{- end }}
{{- $envFrom := (include "prometheus-postgres-exporter.deployment.envFrom" . | fromYaml) }}
{{- if hasKey $envFrom "envFrom" }}
envFrom:
{{- toYaml $envFrom.envFrom | nindent 8 }}
{{- end }}
image: {{ include "prometheus-postgres-exporter.deployment.images.postgres-exporter.fqin" . | quote }}
imagePullPolicy: {{ .Values.deployment.postgresExporter.image.pullPolicy }}
livenessProbe:
tcpSocket:
port: 9187
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
tcpSocket:
port: 9187
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 3
ports:
- name: http
containerPort: 9187
protocol: TCP
{{- with .Values.deployment.postgresExporter.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.deployment.postgresExporter.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- $volumeMounts := (include "prometheus-postgres-exporter.deployment.volumeMounts" . | fromYaml) }}
{{- if hasKey $volumeMounts "volumeMounts" }}
volumeMounts:
{{- toYaml $volumeMounts.volumeMounts | nindent 8 }}
{{- end }}
{{- with .Values.deployment.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.deployment.dnsPolicy }}
dnsPolicy: {{ .Values.deployment.dnsPolicy }}
{{- end }}
{{- if .Values.deployment.hostname }}
hostname: {{ .Values.deployment.hostname }}
{{- end }}
hostNetwork: {{ .Values.deployment.hostNetwork }}
{{- with .Values.deployment.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.deployment.priorityClassName }}
priorityClassName: {{ .Values.deployment.priorityClassName }}
{{- end }}
{{- if .Values.deployment.restartPolicy }}
restartPolicy: {{ .Values.deployment.restartPolicy }}
{{- end }}
{{- with .Values.deployment.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccount: {{ include "prometheus-postgres-exporter.deployment.serviceAccount" . }}
{{- if .Values.deployment.subdomain }}
subdomain: {{ .Values.deployment.subdomain }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }}
{{- with .Values.deployment.tolerations }}
tolerations:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.deployment.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- $volumes := (include "prometheus-postgres-exporter.deployment.volumes" . | fromYaml) }}
{{- if hasKey $volumes "volumes" }}
volumes:
{{- toYaml $volumes.volumes | nindent 6 }}
{{- end }}
{{- with .Values.deployment.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}