You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
905 B

apiVersion: apps/v1
kind: Deployment # Create a deployment
metadata:
name: postgres # Set the name of the deployment
namespace: postgres
spec:
replicas: 1 # Set 3 deployment replicas
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:12.10 # Docker image
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432 # Exposing the container port 5432 for PostgreSQL client connections.
envFrom:
- configMapRef:
name: postgres-secret # Using the ConfigMap postgres-secret
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgresdata
volumes:
- name: postgresdata
persistentVolumeClaim:
claimName: pg-pv-claim