python/django/python-guestbook/kubernetes-manifests/guestbook-postgres.deployment.yaml (27 lines of code) (raw):
################################################################################
# WARNING: These settings are used for educational purposes only. This Postgres
# database deployment is not suitable for production as the data is not
# persistently stored and will go away every time the Pod restarts. Consider
# using a Helm chart that provisions a StatefulSet instead of Deployment.
################################################################################
apiVersion: apps/v1
kind: Deployment
metadata:
name: python-guestbook-db
labels:
app: python-guestbook
tier: db
spec:
replicas: 1
selector:
matchLabels:
app: python-guestbook
tier: db
template:
metadata:
labels:
app: python-guestbook
tier: db
spec:
containers:
- image: postgres:14.4
name: db
ports:
- containerPort: 5432
env:
- name: POSTGRES_HOST_AUTH_METHOD
value: "trust"