2021-05-27 19:25:40 +02: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
|
2021-05-28 11:53:23 +02:00
|
|
|
imagePullPolicy: Always
|
2021-05-27 19:25:40 +02:00
|
|
|
ports:
|
2021-05-28 11:53:23 +02:00
|
|
|
- containerPort: 8080
|
2021-05-28 15:50:42 +02:00
|
|
|
securityContext:
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
runAsUser: 0
|
2021-05-27 19:25:40 +02:00
|
|
|
env:
|
2021-05-28 11:53:23 +02:00
|
|
|
- name: SERVER_PORT
|
2021-05-28 15:50:42 +02:00
|
|
|
value: "8080"
|
2021-05-27 19:25:40 +02:00
|
|
|
- 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/
|
2021-05-28 15:50:42 +02:00
|
|
|
port: 8080
|
2021-05-27 19:25:40 +02:00
|
|
|
livenessProbe:
|
|
|
|
periodSeconds: 5
|
|
|
|
initialDelaySeconds: 5
|
|
|
|
httpGet:
|
|
|
|
path: /api/v2/
|
2021-05-28 15:50:42 +02:00
|
|
|
port: 8080
|