Shiv:
I try to restart the pod when an endpoint returns an HTTP 500 on the /health endpoint. The service, probe-pod, should never send traffic to the pod while it is failing.
• The application needs to has an endpoint /start, which will indicate if it can accept traffic by returning an HTTP 200. If the endpoint returns an HTTP 500, the application has not finished initialization
• The application needs to have another endpoint /health that will indicate if the application is still working as expected by returning an HTTP 200. If the endpoint returns an HTTP 500 the application is no longer responsive.
• The probes should use port 8080
apiVersion: v1
kind: Pod
metadata:
name: probe-pod
spec:
containers:
- image: nginx
name: probe-pod
args:
- /started
ports:
- containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 2
readinessProbe:
httpGet:
path: /started
port: 8080
timeoutSeconds: 2