[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f386jmyluqj0nq":3},{"_id":4,"slug":5,"title":6,"subtitle":7,"kind":8,"cards":9,"tags":46,"categories":48,"source":50,"lang":53,"author":54,"audioState":57,"stats":58,"publishedAt":61,"renderer":62},"6abc676cca21c797c7e9eb23","statefulset-vs-deployment-c449670a","statefulset vs deployment","We can deploy the exact same ECR image twice: This lets them see the difference, instead of only hearing the theory.","news",[10,13,18,22,27,32,37,41],{"headline":6,"body":11,"imageUrl":12,"sourceImageUrl":12},"We can deploy the exact same ECR image twice: This lets them see the difference, instead of only hearing the theory. Part 1 — First find your exact ECR image Your image should look something like: Use your actual tag below if it is not v1.","https:\u002F\u002Fmedia2.dev.to\u002Fdynamic\u002Fimage\u002Fwidth=1200,height=627,fit=cover,gravity=auto,format=auto\u002Fhttps%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fspabzklqu1ey574xc7kd.png",{"headline":14,"body":15,"imageUrl":16,"images":17},"Сначала запускаем наш Restaurant Company как Deployment. Потом","Сначала запускаем наш Restaurant Company как Deployment. Потом удалим Pod и посмотрим, что Kubernetes создаст новый Pod с другим именем.","\u002Fapi\u002Fmedia\u002Fposts\u002Fstatefulset-vs-deployment-c449670a\u002F1.webp",{"local":16},{"headline":14,"body":19,"imageUrl":20,"images":21},"Сначала запускаем наш Restaurant Company как Deployment. Потом удалим Pod и посмотрим, что Kubernetes создаст новый Pod с другим именем. Students should see something like: Ребята, какое имя у первого Pod? Ребята, какое имя у первого Pod? They'll give the long name. Как будет называться следующий Pod? Как будет называться следующий Pod? Deployment говорит: \"Мне всё равно, какой Pod. Просто дай мне 3 работающих Pod.\" Deployment говорит: \"Мне всё равно, какой Pod. Просто дай мне 3 работающих Pod.\" Students need to understand identity first. Now something very important happens. Если я поставлю replicas: 4, как будет называться следующий Pod? Если я поставлю replicas: 4, как будет называться следующий Pod? That's when they'll start understanding StatefulSet.","\u002Fapi\u002Fmedia\u002Fposts\u002Fstatefulset-vs-deployment-c449670a\u002F2.webp",{"local":20},{"headline":23,"body":24,"imageUrl":25,"images":26},"Я удалил restaurant-statefulset-1. Kubernetes не сказал: \"Дам тебе","Я удалил restaurant-statefulset-1. Kubernetes не сказал: \"Дам тебе какой-нибудь новый Pod.\" Он сказал: \"Мне нужен именно номер 1 обратно.\" Я удалил restaurant-statefulset-1. Kubernetes не сказал: \"Дам тебе какой-нибудь новый Pod.\" Он сказал: \"Мне нужен именно номер 1 обратно.\" Хорошо. Имя вернулось. Но если внутри restaurant-statefulset-1 были важные данные — вернутся ли данные? Хорошо. Имя вернулось. Но если внутри restaurant-statefulset-1 были важные данные — вернутся ли данные?","\u002Fapi\u002Fmedia\u002Fposts\u002Fstatefulset-vs-deployment-c449670a\u002F3.webp",{"local":25},{"headline":28,"body":29,"imageUrl":30,"images":31},"For your Restaurant Company app, Nginx normally serves","For your Restaurant Company app, Nginx normally serves static files, so it does not actually need StatefulSet in production. Tell students this clearly:","\u002Fapi\u002Fmedia\u002Fposts\u002Fstatefulset-vs-deployment-c449670a\u002F4.webp",{"local":30},{"headline":33,"body":34,"imageUrl":35,"images":36},"Мы используем Restaurant Company с StatefulSet для обучения","Мы используем Restaurant Company с StatefulSet для обучения. В реальном проекте этот frontend лучше запускать Deployment. Database — MySQL, PostgreSQL, MongoDB — гораздо более естественный пример StatefulSet.","\u002Fapi\u002Fmedia\u002Fposts\u002Fstatefulset-vs-deployment-c449670a\u002F5.webp",{"local":35},{"headline":33,"body":38,"imageUrl":39,"images":40},"Мы используем Restaurant Company с StatefulSet для обучения. В реальном проекте этот frontend лучше запускать Deployment. Database — MySQL, PostgreSQL, MongoDB — гораздо более естественный пример StatefulSet. But Restaurant Company makes the mechanics easy to see. Let's give each Pod its own \u002Fdata. Then modify statefulset.yaml:","\u002Fapi\u002Fmedia\u002Fposts\u002Fstatefulset-vs-deployment-c449670a\u002F6.webp",{"local":39},{"headline":42,"body":43,"imageUrl":44,"images":45},"Because an existing StatefulSet may not accept this","Because an existing StatefulSet may not accept this structural change cleanly, for the classroom the simplest route is to recreate the lab StatefulSet: Now the students should see the big idea: This is the most important part of today's class. Pod умер. Container умер. Новый container был создан. Но данные остались. Новый container был создан. Then prove each Pod has its OWN storage It should not contain Pod 1's file. The sentence I want your students to repeat Have the whole class say this: Deployment сохраняет количество Pod. StatefulSet сохраняет identity Pod. PVC сохраняет данные. Deployment сохраняет количество Pod. StatefulSet сохраняет identity Pod. For further actions, you may consider blocking this person and\u002For reporting abuse","\u002Fapi\u002Fmedia\u002Fposts\u002Fstatefulset-vs-deployment-c449670a\u002F7.webp",{"local":44},[47],"dev",[49],"Technology",{"name":51,"url":52},"Dev.to","https:\u002F\u002Fdev.to\u002Fjumptotech\u002Fstatefulset-vs-deployment-mjl","en",{"handle":55,"displayName":56},"spots","Spots","queued",{"views":59,"likes":60,"saves":60,"shares":60,"completions":60,"opens":60,"skips":60,"depthSum":60},1,0,"2026-09-30T01:35:40.800Z","local"]