mirror of
https://github.com/truenas/charts.git
synced 2026-05-01 05:50:11 +08:00
70 lines
2.4 KiB
YAML
70 lines
2.4 KiB
YAML
{{ $values := (. | mustDeepCopy) }}
|
|
{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }}
|
|
|
|
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "common.names.fullname" . }}-postgres-nc
|
|
labels:
|
|
app.kubernetes.io/name: {{ template "common.names.name" . }}-postgres
|
|
app.kubernetes.io/instance: {{ .Release.Name }}-postgres
|
|
spec:
|
|
strategy:
|
|
type: "Recreate"
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: {{ template "common.names.name" . }}-postgres
|
|
app.kubernetes.io/instance: {{ .Release.Name }}-postgres
|
|
template:
|
|
metadata:
|
|
name: {{ template "common.names.fullname" . }}
|
|
labels:
|
|
app.kubernetes.io/name: {{ template "common.names.name" . }}-postgres
|
|
app.kubernetes.io/instance: {{ .Release.Name }}-postgres
|
|
annotations: {{ include "common.annotations" . | nindent 8 }}
|
|
spec:
|
|
containers:
|
|
- name: {{ .Chart.Name }}-postgres
|
|
image: {{ template "postgres.imageName" . }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }}
|
|
volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }}
|
|
ports:
|
|
- name: postgres-tcp
|
|
containerPort: 5432
|
|
protocol: TCP
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done"
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 5
|
|
successThreshold: 2
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done"
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 5
|
|
successThreshold: 1
|
|
startupProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done"
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
timeoutSeconds: 2
|
|
failureThreshold: 60
|
|
successThreshold: 1
|
|
volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }}
|