Search⌘ K
AI Features

Check Pod Immutability

Explore Kubernetes pod immutability to understand why pods and their configurations cannot be changed after deployment. Learn about resource requests and limits for containers within pods, and how Kubernetes schedules and manages resources to ensure stable and efficient application performance.

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 ...