I have a deployment with a defined number of replicas
. I use readiness probe to communicate if my Pod is ready/ not ready to handle new connections – my Pods toggle between ready
/ not ready
state during their lifetime.
I want Kubernetes to scale the deployment up/ down to ensure that there is always the desired number of pods in a ready
state.
Example:
- If
replicas
is 4 and there are 4 Pods inready
state, then Kubernetes should keep the current replica count. - If
replicas
is 4 and there are 2ready
pods and 2not ready
pods, then Kubernetes should add 2 more pods.
How do I make Kubernetes scale my deployment based on the "ready"/ "not ready" status of my Pods?