k8s-charts/charts/pgadmin/templates/deployment.yaml

77 lines
2.3 KiB
YAML
Raw Normal View History

2023-04-30 18:20:19 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "pgadmin.fullname" . }}
labels:
{{- include "pgadmin.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: Recreate
selector:
matchLabels:
{{- include "pgadmin.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "pgadmin.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "pgadmin.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
env:
{{- toYaml .Values.env | nindent 12 }}
livenessProbe:
httpGet:
path: /login
port: http
startupProbe:
httpGet:
path: /login
port: http
periodSeconds: 3
failureThreshold: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: pgadmin-config
mountPath: /var/lib/pgadmin
volumes:
- name: pgadmin-config
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "pgadmin.fullname" . }}-pvc{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}