|
|
@@ -0,0 +1,37 @@
|
|
|
+apiVersion: apps/v1
|
|
|
+kind: Deployment
|
|
|
+metadata:
|
|
|
+ name: postgres-mas
|
|
|
+spec:
|
|
|
+ replicas: 1
|
|
|
+ selector:
|
|
|
+ matchLabels:
|
|
|
+ app: postgres-mas
|
|
|
+ template:
|
|
|
+ metadata:
|
|
|
+ labels:
|
|
|
+ app: postgres-mas
|
|
|
+ spec:
|
|
|
+ initContainers:
|
|
|
+ - name: init-database
|
|
|
+ image: busybox
|
|
|
+ command: ['sh', '-c', 'rm -rf /var/lib/postgresql/data/lost+found']
|
|
|
+ volumeMounts:
|
|
|
+ - mountPath: /var/lib/postgresql/data
|
|
|
+ name: postgresdata-mas
|
|
|
+ containers:
|
|
|
+ - name: postgres
|
|
|
+ image: 'postgres:14'
|
|
|
+ imagePullPolicy: IfNotPresent
|
|
|
+ ports:
|
|
|
+ - containerPort: 5432
|
|
|
+ envFrom:
|
|
|
+ - configMapRef:
|
|
|
+ name: postgres-mas-secret
|
|
|
+ volumeMounts:
|
|
|
+ - mountPath: /var/lib/postgresql/data
|
|
|
+ name: postgresdata-mas
|
|
|
+ volumes:
|
|
|
+ - name: postgresdata-mas
|
|
|
+ persistentVolumeClaim:
|
|
|
+ claimName: postgres-mas-volume-claim
|