Kubernetes 101 : Why do we use deployments and not just "unmanaged" pods ?



We start by running an "independentpod based on a debian image, using the below command:


The pod gets scheduled on one of the kubernetes nodes.

To see which node hosts our pod, we use the below command:


We see that our pod lives on the "node-1" node.

Taking down a node:


We take the node "node-1" offline for maintenance, using the below command, and the pod gets evicted from "node-1":


We will see that our pod doesn't get re-scheduled on any other node. We can verify that using the below command:


Even after making our node "node-1" available again, using the below command, the pod doesn't get re-scheduled:


On the other hand, when we use a deployment to deploy our pod using the below command:


The pod gets re-scheduled on other nodes, when we take the node that is hosting it offline.

Comments

Leave as a comment:

Archive