I changed the limits (default requested amount of CPU) on my Kubernetes cluster. Of course the new limits don't affect already running Pods. So, how can I apply the new (lower) limits to already running Pods.
You can do that only when you run it as a deployment, or atleast run a pod with RestartPolicy
as RestartAlways
, so you can always scale down to zero and scale up to 1 for a safe restart.
In your case, considering that you just run your pod using kubectl
run without any restartpolicy
, or a restartpolicy
as Never, i would run another pod, test and kill the already running ones.
Expect better answers from any one.
You cant change the properties of a running pod. It would reject the changes. Rather you can create a deployment
whose rolling update
feature ensures,
one pod will be running during the update of limits. There wont be any downtime for your pod.
You need to restart the Pods:
resources
field of a running Pod. The update would be rejected.