Pod Life Cycle

Learn about the state of Pods during its life cycle.

We'll cover the following...

Pods are designed to be mortal and immutable.

Mortal means we create a Pod, it executes a task, and then it terminates. As soon as it completes, it is deleted and cannot be restarted. The same is true if it fails—it is deleted and cannot be restarted.

Immutable means we cannot modify them after they’re deployed. This can be a huge mindset change if we’re from a traditional background where we regularly patched live servers and logged on to them to make fixes and configuration changes. If we need to change a Pod, we create a new one with the changes, delete the old one, and replace it with the new one. If a Pod needs to store data, we should attach a volume and store it in the volume so it’s not lost when the Pod is deleted.

Let’s look at a typical Pod life cycle.

We define a Pod in a declarative YAML object that ...