I wondered this morning if there is an equivalent of ādocker pauseā in Kubernetes to pause all processes inside a container?
I searched for a solution on the official tech documentation (https://kubernetes.io/docs/reference/kubectl/docker-cli-to-kubectl/) without success.
Kubernetes does not support this feature because it only works on virtual machines and K8S advises using stateless pods.
You can all the same patch the readiness in a deployment to determine when the traffic will be able to pass but this could complicate the solution and also restart the containerā¦
An acceptable workaround is to scale down the related deployment, but it is not exactly the same thing: the replicas=0 destroy all the pods, so it is not really a pause!
kubectl scale --replicas=0 deployment/<pod name> --namespace=<namespace>