While running my container on kubernetes
using helm upgrade command, I am getting this error:
'Readiness probe failed: Get http://172.17.0.6:3003/: dial tcp 172.17.0.6:3003: getsockopt: connection refused'.
My docker image is for a node.js application and I am trying to manage it through minikube.
Increase the Timeout of the Readiness Probe To increase the Readiness probe timeout, configure the Managed controller item and update the value of "Readiness Timeout". By default it set to 5 (5 seconds). You may increase it to for example 30 (30 seconds).
If the readiness probe fails, the endpoints controller removes the Pod's IP address from the endpoints of all Services that match the Pod. The default state of readiness before the initial delay is Failure . If a container does not provide a readiness probe, the default state is Success .
The liveness probe will be marked as failed when the container issues an unhealthy response. The probe is also considered failed if the service doesn't implement the gRPC health checking protocol.
Define readiness probes Kubernetes provides readiness probes to detect and mitigate these situations. A pod with containers reporting that they are not ready does not receive traffic through Kubernetes Services. Note: Readiness probes runs on the container during its whole lifecycle.
For anyone else here, if using helm to manage your deployments, you need to set initialDelaySeconds
it in the deployments.yaml
template in the /templates
folder under livenessProbe
. The livenessProbe
will force restart your pod if the probe cannot connect, as was happening with mine. It wasn't giving my application enough time to build.
This could be solved by increasing the initial delay in the readiness check. Actually since the connection to the DB was taking more then the initial delay as a result of which the readiness probe was failing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With