We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Ephemeral

Pods die, they die often, and sometimes without warning.

The ephemeral (fancy word for "temporary") nature of Pods is one of the defining features of Kubernetes. Unlike traditional virtual machines (VMs) or physical servers that might run indefinitely (or until hardware failure), Pods are designed to be spun up, torn down, and restarted at a moment's notice.

  • Why are they temporary? Flexibility and resilience. If a Pod encounters a problem, it can be easily terminated and replaced with a new, healthy instance. This model not only allows for high availability but also promotes immutability. Instead of manually patching or updating existing environments, you spin up new versions of the entire environment.
  • How does it affect me? As a developer, it's crucial to understand that it's rarely a good idea to store persistent data on a Pod. They can be terminated and replaced, and any locally saved data will be lost. Plan on your image restarting from scratch often!

Assignment

Get a list of your running pods:

kubectl get pods

Print the logs (what the container is printing to stdout) of your older pod:

kubectl logs PODNAME

Kill that older pod (this might take several seconds to complete):

kubectl delete pod PODNAME

Get a list of your running pods again:

kubectl get pods

You can do these steps as many times as you need to be able to answer the questions.