As soon as I add,
spec:
containers:
- args:
- /bin/sh
- '-c'
- touch /tmp/healthy; touch /tmp/liveness
env:
to the deployment file, the application is not coming up without any error in the description logs. The deployment succeed, but no output. Both files getting created in the container. Can I run docker build inside kubernetes deployment?
Below is the complete deployment yaml.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: web
name: web
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: web
version: prod
template:
metadata:
annotations:
prometheus.io/scrape: 'true'
labels:
app: web
version: prod
spec:
containers:
- args:
- /bin/sh
- '-c'
- >-
touch /tmp/healthy; touch /tmp/liveness; while true; do echo .;
sleep 1; done
env:
- name: SUCCESS_RATE
valueFrom:
configMapKeyRef:
key: SUCCESS_RATE
name: web-config-prod
image: busybox
livenessProbe:
exec:
command:
- cat
- /tmp/liveness
initialDelaySeconds: 5
name: web
ports:
- containerPort: 8080
- containerPort: 8000