DEV Community

DevOps Interview Practice #4: What is the difference between a rolling update and a recreate strategy in Kubernetes Deployments?

The author is a DevOps engineer from Korea preparing for international opportunities and practicing English and technical skills simultaneously. As part of daily English practice, the author asks ChatGPT interview-style questions and answers in English, then refines the answers based on feedback. Today's question is about the difference between rolling update and recreate strategy in Kubernetes Deployments. The author's initial answer states that recreate ensures persistency but sacrifices availability, while rolling update ensures availability but sacrifices persistency. The recreate strategy ends existing pods and then starts scaling up new ones. The rolling update strategy ensures availability using maxUnavailable and maxSurge parameters. The refined answer explains that recreate ensures version consistency but sacrifices availability, while rolling update prioritizes availability even with different versions. With recreate, all existing pods are terminated before the new ReplicaSet scales up. Rolling update maintains availability by scaling down existing pods according to maxUnavailable and creating new ones within the maxSurge limit.
favicon
dev.to
dev.to