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
2023-01-09 15:11:23 +00:00
image : postgres:15.1-alpine
2021-06-01 13:17:54 +00:00
command : [ 'sh' , '-c' ]
args :
- until pg_isready -h postgresql -p 5432; do
echo waiting for database;
sleep 2;
done;
2021-05-27 17:25:40 +00:00
containers :
- name : pokeapi
2021-06-05 20:58:10 +00:00
image : pokeapi/pokeapi:master
2023-01-09 15:11:23 +00:00
imagePullPolicy : Always
2021-05-27 17:25:40 +00:00
ports :
2021-05-28 09:53:23 +00:00
- containerPort : 8080
2021-06-01 13:17:54 +00:00
securityContext: # CI : Github Actions kills this container if not run with root. Otherwise, it's safe to use the default pokeapi/pokeapi user and remove these lines.
2021-05-28 13:50:42 +00:00
allowPrivilegeEscalation : false
runAsUser : 0
2021-05-27 17:25:40 +00:00
env :
2021-05-28 09:53:23 +00:00
- name : SERVER_PORT
2021-05-28 13:50:42 +00:00
value : "8080"
2021-05-27 17:25:40 +00: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 13:50:42 +00:00
port : 8080
2021-05-27 17:25:40 +00:00
livenessProbe :
periodSeconds : 5
initialDelaySeconds : 5
httpGet :
path : /api/v2/
2021-05-28 13:50:42 +00:00
port : 8080