Scaling a pod in Openshift


Scaling a pod down an up again is the same as restarting a pod, it's just that the container folks like to use fancy words:

The thing you scale down and up is a deployment, which is one abstraction above a pod.

You can get a list of deployments with:

$ oc get deployments
foo-ice-cream
$ oc scale deployment/foo-ice-cream --replicas=0

Give it a second or two, and then scale it up again to get a fresh pod with containers, fresh of any disk or in-memory state left behind that wasn't mounted or injected:

$ oc scale deployment/foo-ice-cream --replicas=1

Happy scaling!


Licensed under CC BY Creative Commons License ~ ✉ torstein.k.johansen @ gmail ~ 🐘 @skybert@hachyderm.io ~ 🎥 youtube.com/@skybert