Check Pod Immutability
Explore how Kubernetes treats pods as immutable objects and the implications for managing running pods. Understand the distinction between object and app immutability, and how resource requests and limits impact scheduling and resource allocation. Gain practical experience using kubectl to attempt pod edits and learn why changes are restricted, enhancing your ability to manage Kubernetes pods effectively.
We'll cover the following...
Pods as immutable objects
Pods are designed as immutable objects, meaning we shouldn’t change them after deployment.
Immutability applies at two levels:
Object immutability (the Pod)
App immutability (containers)
Kubernetes handles object immutability by preventing changes to a running Pod’s configuration. However, Kubernetes can’t always prevent us from changing the app and filesystem in containers. We’re responsible for ensuring containers and their apps are stateless and immutable.
The following example uses kubectl edit to edit a live Pod object. Try and change ...