Files
infra-hideyoshi.com/postgres/postgres.yaml
2022-09-06 05:45:20 -03:00

45 lines
1.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
namespace: portfolio
name: postgres-deployment
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
limits:
containers:
- name: postgres
image: postgres
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: postgres-secret
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgres-pv-claim
---
apiVersion: v1
kind: Service
metadata:
namespace: portfolio
name: postgres-service
spec:
selector:
app: postgres
ports:
- port: 5432
type: ClusterIP