I am deploying some web app on kubernetes and I want to set liveness probe for this application. When I configure my deployment with liveness probe, kubelet start health check. I was defined httpGet with scheme "HTTP" parameter but kubelet using https schema randomly.
This is my liveness probe configuration:
livenessProbe:
failureThreshold: 4
httpGet:
path: /
port: 80
scheme: HTTP
initialDelaySeconds: 40
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
This is result from kubelet:
kubectl describe pod greenlight-7877dc58b7-6s78l
output:
Warning Unhealthy 31s (x4 over 46s) kubelet Liveness probe failed: Get "https://10.244.4.182/": dial tcp 10.244.4.182:443: connect: connection refused
Kubernetes version: v1.19.9
Thanx for help!
Since you are explicitly stating livenessProbe to use HTTP, it's probably your application that redirects traffic to HTTPS. Make sure that your application returns a
200 OK
on basepath/
, and not a redirection (any of3xx
codes).You can either fix that, or use TCP probe