0

We have added readiness probe and the container is in unready state until it is fully loaded but in case of horizontal autoscaling a new pod which is in unready state starts getting traffic due to which request are failing. We are using nginx ingress controller for loadbalancing and service type is of ClusterIPenter image description here

We tried adding readiness probes , probe is working and making sure that container is not ready state but somehow it is getting trafficenter image description here

  • [Please do not upload images of code/data/errors.](//meta.stackoverflow.com/q/285551/1772220) – ugexe Apr 17 '23 at 14:13

1 Answers1

0

Infra-cluster traffic is handled by the Services and the Services route as soon as the Pod is RUNNING.

What you can do is configure an initContainer that does a health check of the localhost:PORT of your service.

Check it out here: Kubernetes - wait for other pod to be ready

If you have the ability to create automatisms, you might also consider using the kubectl wait command:

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait

glv
  • 994
  • 1
  • 1
  • 15