db-deployment.yaml 634 B

123456789101112131415161718192021222324252627282930313233
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. labels:
  5. app: db
  6. name: db
  7. spec:
  8. replicas: 1
  9. selector:
  10. matchLabels:
  11. app: db
  12. template:
  13. metadata:
  14. labels:
  15. app: db
  16. spec:
  17. containers:
  18. - image: postgres:15-alpine
  19. name: postgres
  20. env:
  21. - name: POSTGRES_USER
  22. value: postgres
  23. - name: POSTGRES_PASSWORD
  24. value: postgres
  25. ports:
  26. - containerPort: 5432
  27. name: postgres
  28. volumeMounts:
  29. - mountPath: /var/lib/postgresql/data
  30. name: db-data
  31. volumes:
  32. - name: db-data
  33. emptyDir: {}