Product-Manager/z2/k8s/deployment-backend.yml

39 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2022-05-07 11:14:18 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: product-manager-backend-deployment
labels:
app: product-manager-backend
spec:
replicas: 1
selector:
matchLabels:
app: product-manager-backend
template:
metadata:
labels:
app: product-manager-backend
spec:
initContainers:
- name: init-cont
image: busybox:1.31
command: ['sh', '-c',
'echo -e "Checking for the availability of PostgreSQL Server deployment"; while ! nc -z postgres-db-service 5432; do sleep 1; printf "-"; done; echo -e " >> PostgreSQL DB Server has started";']
containers:
- name: product-manager-backend
image: product-manager-backend:latest
imagePullPolicy: IfNotPresent
command: ['bash']
args: ['scripts/backend_entrypoint.sh']
ports:
- containerPort: 8000
env:
- name: POSTGRES_DB
value: postgres
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
- name: DATABASE_HOST
value: postgres-db-service