Skip to main content

What happens when you edit a Pod directly instead of its Deployment?

Junior Kubernetes
Quick Answer You can't รขโ‚ฌโ€ running Pods are immutable. kubectl edit or kubectl patch on a Pod only changes mutable fields (like labels). The Pod spec (containers, images) can't be changed on a running Pod. To update a Pod, you update its Deployment or ReplicaSet รขโ‚ฌโ€ Kubernetes creates new Pods with the updated spec and removes the old ones.

Answer

Deployment overwrites changes by recreating Pods with original spec.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice