2021-12-25 09:53:35 +00:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: {{ .Release.Name }}-postgres
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
app.kubernetes.io/component: postgres
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
app.kubernetes.io/component: postgres
|
|
|
|
replicas: 1
|
|
|
|
strategy:
|
|
|
|
type: Recreate
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
app.kubernetes.io/component: postgres
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: postgres
|
|
|
|
image: postgres:14
|
|
|
|
ports:
|
|
|
|
- containerPort: 5432
|
|
|
|
envFrom:
|
|
|
|
- secretRef:
|
|
|
|
name: {{ .Release.Name }}-postgres-config
|
|
|
|
volumeMounts:
|
|
|
|
- name: postgres-data
|
|
|
|
mountPath: "/var/lib/postgresql/data"
|
|
|
|
subPath: postgres
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
memory: "64Mi"
|
|
|
|
cpu: "100m"
|
|
|
|
limits:
|
|
|
|
memory: "256Mi"
|
|
|
|
cpu: "400m"
|
|
|
|
volumes:
|
|
|
|
- name: postgres-data
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ .Release.Name }}-postgres-data
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: {{ .Release.Name }}-postgres
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
app.kubernetes.io/component: postgres
|
|
|
|
spec:
|
|
|
|
type: ClusterIP
|
|
|
|
ports:
|
|
|
|
- port: 5432
|
|
|
|
name: postgres
|
|
|
|
selector:
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
app.kubernetes.io/component: postgres
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
metadata:
|
|
|
|
name: {{ .Release.Name }}-postgres-config
|
|
|
|
annotations:
|
|
|
|
secret-generator.v1.mittwald.de/autogenerate: POSTGRES_PASSWORD
|
|
|
|
hosting: {{ .Release.Name }}
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
app.kubernetes.io/component: postgres
|
|
|
|
stringData:
|
2021-12-25 10:43:06 +00:00
|
|
|
POSTGRES_USER: "{{ .Values.postgresUser }}"
|
|
|
|
POSTGRES_DB: "{{ .Values.postgresDBName }}"
|
2021-12-25 16:34:19 +00:00
|
|
|
POSTGRES_INITDB_ARGS: "--no-locale --encoding=UTF8"
|