pokeapi/Resources/k8s/kustomize/deployments/pokeapi-deployment.yaml

59 lines
1.5 KiB
YAML
Raw Normal View History

2021-05-27 17:25:40 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: pokeapi
labels:
component: pokeapi
spec:
replicas: 2
selector:
matchLabels:
component: pokeapi
template:
metadata:
labels:
component: pokeapi
spec:
initContainers:
- name: postgres-connection-checker
image: postgres:13.3-alpine
command: ['sh', '-c',
'until pg_isready -h postgresql -p 5432;
do echo waiting for database; sleep 2; done;']
containers:
- name: pokeapi
image: pokeapi/pokeapi:staging
# imagePullPolicy: Always
ports:
- containerPort: 80
env:
- name: POSTGRES_HOST
value: postgresql
- name: POSTGRES_USER
value: ash
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-env-secret
key: POSTGRES_PASSWORD
- name: POSTGRES_DB
value: pokeapi
- name: REDIS_CONNECTION_STRING
value: redis://redis:6379/1
envFrom:
- configMapRef:
name: pokeapi-configmap
resources: {}
readinessProbe:
periodSeconds: 5
initialDelaySeconds: 5
httpGet:
path: /api/v2/
port: 80
livenessProbe:
periodSeconds: 5
initialDelaySeconds: 5
httpGet:
path: /api/v2/
port: 80