how to stop/pause a pod in kubernetes

So, like others have pointed out, Kubernetes doesn’t support stop/pause of current state of pod and resume when needed. However, you can still achieve it by having no working deployments which is setting number of replicas to 0. kubectl scale –replicas=0 deployment/<your-deployment> see the help # Set a new size for a Deployment, ReplicaSet, Replication … Read more

Kubernetes sort pods by age [closed]

Pods have status, which you can use to find out startTime. I guess something like kubectl get po –sort-by=.status.startTime should work. You could also try: kubectl get po –sort-by='{.firstTimestamp}’. kubectl get pods –sort-by=.metadata.creationTimestamp Thanks @chris Also apparently in Kubernetes 1.7 release, sort-by is broken. https://github.com/kubernetes/kubectl/issues/43 Here’s the bug report : https://github.com/kubernetes/kubernetes/issues/48602 Here’s the PR: https://github.com/kubernetes/kubernetes/pull/48659/files

Restart pods when configmap updates in Kubernetes?

The current best solution to this problem (referenced deep in https://github.com/kubernetes/kubernetes/issues/22368 linked in the sibling answer) is to use Deployments, and consider your ConfigMaps to be immutable. When you want to change your config, create a new ConfigMap with the changes you want to make, and point your deployment at the new ConfigMap. If the … Read more