Statefulset in Kubernetes Explained | Statefulset vs Deployment

  Рет қаралды 15,740

DevOps Pro

DevOps Pro

Жыл бұрын

In this video, we will dive into Statefulset in Kubernetes, how it works, and its features, and compare Statefulset vs Deployment.
===============Topics covered==================
👉 What is Statefulset in Kubernetes?
👉 Understanding how Statefulset works and its use cases.
👉 Statefulset vs Deployment
✳️ Github Repo - [github.com/devopsproin/certif...]
Don't forget to like, comment, and subscribe for more content, and check out our complete CKA playlist link in the description below to stay updated with our latest videos.
Thank you for watching, and let's get started on mastering Kubernetes and cracking the CKA exam!
================= ⭐️⭐️⭐️⭐️⭐️⭐️⭐️ =================
📝 Get access to the notes and ppt of each video - www.youtube.com/@DevOpsPro/join
=================== Let's Connect ===================
🤝 LinkedIn - / riya-soni-3bb5111a0
🤝 LinkedIn - / devopsproin
🤝 Twitter - / devopsproin
🤝 Facebook - / devopsproin
🤝 Instagram - / devopsproin
🤝 Discord Community - / discord
==================================================
👉 Site Link:- devopspro.in/
👉 Kubernetes Playlist Link - • Certified Kubernetes A...
👉 Linux Playlist Link - • Linux Tutorials For Be...
👉 Crash Course Playlist Link - • DevOps Crash Courses i...
👉 DevOps Pro English Channel - / @devopsproenglish

Пікірлер: 128
@DevOpsPro
@DevOpsPro Жыл бұрын
Please help us with your valuable feedback - forms.gle/E9r3xvTxnLPKz9Hw9
@kalleshamuliker
@kalleshamuliker Жыл бұрын
Clearly understood. Superb
@pravinsingh8782
@pravinsingh8782 9 ай бұрын
Thanks for such a easy explanation for a complex topic .
@craftwithme4286
@craftwithme4286 Жыл бұрын
Perfect explanation
@someshmahajan7903
@someshmahajan7903 Күн бұрын
Thank you so much ma'am ❤️😊
@suraj_dhakad
@suraj_dhakad Жыл бұрын
You are the best teacher in KZbin
@abrarsyed7177
@abrarsyed7177 Жыл бұрын
You are good teacher i understand properly now
@sajjuquadri1964
@sajjuquadri1964 6 ай бұрын
The way u explained just awesome 👌 👏 👍
@AnsumanSingh1
@AnsumanSingh1 5 ай бұрын
Thanks for easy explanation.
@kavishprajapati6426
@kavishprajapati6426 9 ай бұрын
Great Explanation
@abhi-dd1ys
@abhi-dd1ys Ай бұрын
Thankyou so much for such excellent explaination😍
@nareshv7797
@nareshv7797 Жыл бұрын
Superb explanation
@rajashekhargunaki2085
@rajashekhargunaki2085 4 ай бұрын
Thank you so very much for the explanation. It is wonderful and hoping to hear you with some more clips like this.
@DevOpsPro
@DevOpsPro 4 ай бұрын
More to come! Thank You
@user-bj2ye3ee9y
@user-bj2ye3ee9y Жыл бұрын
thanks a lot for this wonderful video and taking my request into consideration
@diliprajput6327
@diliprajput6327 9 ай бұрын
Excellent job 👍 thanks
@anilpatil8299
@anilpatil8299 10 ай бұрын
Your explanation is awesome!!
@DevOpsPro
@DevOpsPro 10 ай бұрын
Thank you! 😃
@user-vd1uh9pi8g
@user-vd1uh9pi8g 4 ай бұрын
i could finally understand the concept, all thanks to u..😊
@DevOpsPro
@DevOpsPro 4 ай бұрын
Glad to hear that
@user-he7lg4bi8p
@user-he7lg4bi8p 11 ай бұрын
underrated channel. very informative
@DevOpsPro
@DevOpsPro 11 ай бұрын
Please share the videos and support the channel. Thanks!
@koyalchaudhari3220
@koyalchaudhari3220 Ай бұрын
amazing explanation
@Travel_grp84
@Travel_grp84 Ай бұрын
Thanks ❤❤❤
@ifranqureshi537
@ifranqureshi537 Жыл бұрын
Appreciated😊
@vineetkulkarni4660
@vineetkulkarni4660 6 ай бұрын
You teach very well. Language & explanation is really good.
@DevOpsPro
@DevOpsPro 6 ай бұрын
Thank you! 😃
@shubhamgohokar4833
@shubhamgohokar4833 6 ай бұрын
Very easy way loved this video
@DevOpsPro
@DevOpsPro 4 ай бұрын
Thanks a lot 😊
@mohammedkhan8781
@mohammedkhan8781 9 ай бұрын
outstanding explanation
@DevOpsPro
@DevOpsPro 9 ай бұрын
Thank you so much!
@MrGirishsajwan
@MrGirishsajwan Жыл бұрын
Great...thank you
@user-pc1pm1vb7p
@user-pc1pm1vb7p 5 ай бұрын
what a wonderful explanation .!!!
@DevOpsPro
@DevOpsPro 4 ай бұрын
Glad you liked it
@geetgazal1005
@geetgazal1005 4 ай бұрын
Excellent
@satyapal1948
@satyapal1948 Ай бұрын
Thanks
@VividlyVishal
@VividlyVishal 3 ай бұрын
Thank you very much! I was having an interview today that of final round. I was just revising up the things on KZbin. Got this video recommend and this was the topic I was having a little doubt. It got cleared --> though it was even asked by the interviewer 💯
@DevOpsPro
@DevOpsPro Ай бұрын
That's fantastic to hear!
@rajatcharde76
@rajatcharde76 Жыл бұрын
Well explained 😊
@Cloudnp9458
@Cloudnp9458 2 ай бұрын
Pods are created in sequentaial order Each pod has unique cordinal index , podname/hostname start from 0 , and then increasing by 1. Even if pod fails, pod get recreated with same name. Maintains sticky identity
@chetan-koko
@chetan-koko Жыл бұрын
You are amazing, the way you explain
@DevOpsPro
@DevOpsPro 11 ай бұрын
Thank you! 😃
@bhatkanti89
@bhatkanti89 Ай бұрын
All videos explained in very easy manner. Thanks for sharing and explaining in easiest way.
@DevOpsPro
@DevOpsPro 26 күн бұрын
Thanks
@bhatkanti89
@bhatkanti89 26 күн бұрын
@@DevOpsPro one request if possible share videos on Jenkin tool
@rajbalhara7338
@rajbalhara7338 Жыл бұрын
Great and simplified content, please make videos on k8s operator and k8s CRD
@pirumohan4971
@pirumohan4971 4 ай бұрын
your teaching style is very impressive and easily understandable.
@DevOpsPro
@DevOpsPro 4 ай бұрын
Glad to hear that
@jainkapil6316
@jainkapil6316 8 ай бұрын
Best one❤️❤️❤️
@devidas90
@devidas90 9 ай бұрын
Thanks for explaining nicely
@DevOpsPro
@DevOpsPro 9 ай бұрын
Thanks for liking
@shadhashmi3714
@shadhashmi3714 9 ай бұрын
Nice explanation
@syedshibra
@syedshibra 2 ай бұрын
indeed i liked ur content
@kanishkrana5805
@kanishkrana5805 14 күн бұрын
Superb...
@_man.on.strings__
@_man.on.strings__ Жыл бұрын
well explained
@HappiestMindSet
@HappiestMindSet 8 ай бұрын
Very Good explanation
@DevOpsPro
@DevOpsPro 8 ай бұрын
Thanks and Keep watching
@bhushangaikwad4937
@bhushangaikwad4937 5 ай бұрын
awesome
@user-oi3vx1ih4t
@user-oi3vx1ih4t 9 ай бұрын
very nice explanation
@DevOpsPro
@DevOpsPro 9 ай бұрын
Keep watching
@mahendrameena8349
@mahendrameena8349 Жыл бұрын
Good job done:)😇
@amitverma7545
@amitverma7545 11 ай бұрын
Plz make one on CKAD
@kalleshamuliker
@kalleshamuliker Жыл бұрын
Mam Please do video on Nodeaffinity.
@Mayanksugandhi25
@Mayanksugandhi25 5 ай бұрын
Wow wow wow wow.. what a explaination.. within 1 year you will cross 1 lakh subs.. just one thing i would like to suggest you.. you should put programmatically example as well so it will boost your channel.. hat's off .. aapne hindi me samjhaya wo sabse best he..
@DevOpsPro
@DevOpsPro 5 ай бұрын
Thank you so much for the kind words 💛
@user-pc1pm1vb7p
@user-pc1pm1vb7p 5 ай бұрын
@@DevOpsPro whats a diff b/w object and resource ??
@shadhashmi3714
@shadhashmi3714 7 ай бұрын
Best part this video for me pod 1 pod 2 Purna data leke baite hai so cute 🥰
@Cloudnp9458
@Cloudnp9458 2 ай бұрын
Stateful set create pod 1 by 1. Deployment create parallely . Stataefulset does sequentially ordered creation. Naming convention is pod-0,pod-1,pod-2..... Data is cloned on pod1 from pod-0 . And pod1 saves pod-0 as Central hostname, so it remain synchronised. Then third pod is created pod-2 and data is cloned from pod-1, but centrally sunchnorized to pod-0.. Scaled down in reverse order.
@guddukumar449
@guddukumar449 3 ай бұрын
Thanks alot for the easy explanation. Will you please make a video for Helm chart and Vault ,theory and Practical as well.
@DevOpsPro
@DevOpsPro Ай бұрын
Next playlist is coming on helm. Thanks
@abrarsyed7177
@abrarsyed7177 Жыл бұрын
Please mam make a video on RBAC and PV PVC
@shadynit
@shadynit Жыл бұрын
Great, this is such an easy way you explained i have been motivated to make such a kind of video after watching this. Can you also explain how data is replicated from mydb-0 to mydb-1 and -2 and so on?
@DevOpsPro
@DevOpsPro Жыл бұрын
Thank you for your comment and I'm glad to hear that my video motivated you to create similar content! Regarding your question about data replication from mydb-0 to mydb-1 and beyond, StatefulSets in Kubernetes provide a mechanism called stable network identities. Each replica in the StatefulSet is assigned a unique hostname and stable network identity, allowing data to be replicated and shared consistently. To achieve data replication, you can implement database-specific mechanisms such as master-slave replication or cluster-based replication. These mechanisms ensure that changes made to the primary database (e.g., mydb-0) are propagated to the replicas (e.g., mydb-1, mydb-2, and so on) for consistency. I hope this answers your question. If you have any further queries, feel free to ask!
@user-zi9gv2vh9x
@user-zi9gv2vh9x 9 ай бұрын
please make one session on nodeAffinity
@DevOpsPro
@DevOpsPro 9 ай бұрын
Noted! Will plan a session on nodeAffinity. Stay tuned! 😊
@maheshkumarnaik754
@maheshkumarnaik754 6 ай бұрын
waiting for next video's (LAB)
@Kk-rl7nv
@Kk-rl7nv 5 ай бұрын
Hi Rita, Video is awesome but by why you stopped to update more videos in this playlist, I searched practical part for statefulset but did not find.
@DevOpsPro
@DevOpsPro 4 ай бұрын
I apologize for the delay in updating the playlist. I'll make sure to add more practical content, including StatefulSet tutorials, to the playlist soon. Stay tuned for the upcoming videos! If you have any specific topics you'd like covered, feel free to let me know. Appreciate your patience and support!
@swapnilbat
@swapnilbat 7 ай бұрын
Hi, please create session on helm chart in Kubernetes.
@DevOpsPro
@DevOpsPro 6 ай бұрын
Will consider your suggestion for future content. Stay tuned!
@SanjayKumar-ix1si
@SanjayKumar-ix1si 10 күн бұрын
Mam different dns name dene ke badd database ko read operation ka flow kese hoga?
@Cloudnp9458
@Cloudnp9458 2 ай бұрын
Does ip address of the new pod recreated with same identity remain same?
@user-oy8od5yx2u
@user-oy8od5yx2u 2 ай бұрын
if we use persistent storage for deployment with headless service, we can do it with deployment only right?
@DevOpsPro
@DevOpsPro Ай бұрын
Yes, you can indeed use persistent storage with a Deployment and a headless Service. However, StatefulSets offer additional benefits such as stable, unique network identities for each pod, ordered deployment and scaling, and better support for stateful applications like databases. It ultimately depends on your specific use case and requirements.
@LaxmiYugesh-gn6uz
@LaxmiYugesh-gn6uz Жыл бұрын
Hi , but deployment does rolling strategy it doesn't delete all pod once it depends on max surge right. Hence deployment is for zero downtime
@DevOpsPro
@DevOpsPro Жыл бұрын
Deployments in Kubernetes use rolling updates for zero downtime, while StatefulSets are designed for managing stateful applications with stable network addresses. Each has specific use cases depending on application requirements.
@aniketkulaye1165
@aniketkulaye1165 Жыл бұрын
what if centeral hostname pod : mysql-0 pod get terminated , then how can data writes to the other pods
@DevOpsPro
@DevOpsPro Жыл бұрын
In a StatefulSet, if a Pod like mysql-0 gets terminated, the StatefulSet controller will automatically create a new Pod with the same name (mysql-0) to maintain the desired number of Pods. Data synchronization and failover mechanisms are typically handled at the application layer. It is essential to implement mechanisms such as database replication or clustering to ensure data consistency and availability across multiple Pods in a StatefulSet. These mechanisms enable seamless write operations to the newly created Pod and maintain data integrity within the StatefulSet.
@amankumarpatel1281
@amankumarpatel1281 9 ай бұрын
One more thing if we have 1 centrel pod of db then other pods are just for the read only purpose....so let's say we have multiple requests of db write operation then only central pod will do that so the workload is only handled by central db pod then what is the use of ther pod .. only read operation purpose?
@DevOpsPro
@DevOpsPro 9 ай бұрын
Even if the central pod is only handling write operations, the other pods can still be useful for read operations, which can help to improve performance and scalability. Additionally, the other pods can provide redundancy in case the central pod fails. Most importantly, the design of having multiple read-only or write-only database pods is entirely based on the specific requirements and workload of the application. For example, having multiple write-only pods can be a valid and beneficial setup for applications that experience a high volume of write requests and require high performance and scalability.
@NarenderPanwar-dk9vy
@NarenderPanwar-dk9vy 2 ай бұрын
Can we deploy a database as Deployment and use a PV for data to be consistent? Why to go for Statefulsets?
@DevOpsPro
@DevOpsPro Ай бұрын
While it's technically possible to deploy a database using a Deployment and a PersistentVolume (PV), StatefulSets offer additional benefits for managing stateful applications like databases. StatefulSets provide stable, unique network identities and stable storage, which are crucial for databases requiring consistent data storage and network identifiers, especially during scaling or node failures. They also ensure ordered deployment and scaling, important for maintaining database consistency. So, while Deployments with PVs can work for some use cases, StatefulSets are better suited for stateful applications like databases due to their additional features and guarantees.
@ayeshazakria8461
@ayeshazakria8461 8 ай бұрын
deploying application through deployment means deploying it through creating deployment.yml files ?
@DevOpsPro
@DevOpsPro 8 ай бұрын
Yes, deploying through Deployment involves creating deployment.yml files to define and manage your application's deployment configuration.
@dhirendravats9048
@dhirendravats9048 Жыл бұрын
If we deploy deploy mysql as deployment but we use persistent volume for read and write in all replicas... Will it work.... ???
@DevOpsPro
@DevOpsPro Жыл бұрын
If we deploy MySQL as a deployment and use a persistent volume for read and write operations across all replicas, the persistent volume itself will ensure data durability and persistence. However, data consistency between the replicas will not be automatically maintained by the persistent volume alone. To achieve data consistency in a multi-pod MySQL deployment, you will need to implement additional mechanisms such as database replication or clustering. These mechanisms synchronize data changes between the replicas, ensuring that updates made on one pod are propagated to the others.
@RaviKumar-pp8hi
@RaviKumar-pp8hi Жыл бұрын
I have one doubt how we can make sure after deletion of pods the data should not be delete if again we crate the same pods. For example, we have crated a dB pod by mentioning there should be one replica. accidentally, i modify replication from one to zero or delete the pods. so will the data will be remain there or it will delete as well.
@DevOpsPro
@DevOpsPro Жыл бұрын
To ensure data persistence when pods are deleted and recreated in Kubernetes, you can utilize PersistentVolumeClaims (PVCs) in conjunction with StatefulSets. By defining a PVC in your StatefulSet YAML file and associating it with the pods, the data stored within the PVC will be preserved across pod lifecycles, allowing for reliable storage and retrieval of data in stateful applications.
@samsulhaque8064
@samsulhaque8064 5 ай бұрын
Hi mam, I have a question about stateful application Let’s say I have a PostgreSQL Sharded cluster in my Kubernetes cluster and have 3 replicas with stateful Set and storage class Case1: If replica set increase 3 to 4 one pv attached to 4th number pod dynamically also some data stored in 4th member pv and all are ok Case2. When scale down 4 to 3 my 4th number pod down and pv remaining existing. And that data remaining inaccessible. when replicate set up that pv can accessible a. If that pv inaccessible so is there any data inconsistency happen? b. If inconsistency happen how to redistributed that data from 4th number pv to others pv . c. Or what the actual thing happens that orphan pv when do scale down in stateful application
@DevOpsPro
@DevOpsPro 4 ай бұрын
Great question! In Case 2, when scaling down from 4 to 3 replicas, the 4th pod is terminated, but the PV remains. To address your concerns: a. Data Inconsistency: If the PV becomes inaccessible, data inconsistency may occur. b. Redistributing Data: You'd need a mechanism to redistribute data. This involves careful planning, potentially manual intervention, and ensuring data integrity during the redistribution process. c. Orphan PVs: Orphan PVs can pose challenges, and their handling depends on your application's resilience strategy. I'll consider creating a detailed video on managing stateful application scaling scenarios.
@girishfury2630
@girishfury2630 11 ай бұрын
this is the logic but how to implement it.. is there any conditions to it ?
@DevOpsPro
@DevOpsPro 11 ай бұрын
Please watch kzbin.info/www/bejne/p3impaN9ndKhbpI for practical demonstration.
@user-zn1mc7oj7t
@user-zn1mc7oj7t 8 ай бұрын
In the replicaset and deployment video you explain deployment set deleted pods one by one and in this video you explain stateful sets delete pods one by one I am still little bit confused please help me to understand.😢
@DevOpsPro
@DevOpsPro 8 ай бұрын
In both cases, pods are indeed deleted one by one. However, the key difference lies in how the pods are identified and managed. Deployments create pods with random names, while StatefulSets maintain a consistent naming convention for their pods. StatefulSets are often used for stateful applications like databases. Hope this clarifies things!
@user-zn1mc7oj7t
@user-zn1mc7oj7t 8 ай бұрын
@@DevOpsPro thanku so much please try to revert quickly because I m giving interviews after watching your videos.
@amankumarpatel1281
@amankumarpatel1281 9 ай бұрын
If we have pv and pvc concept to do the same work what is a need to database and doing connection like db pod to other pod ...just mount that pv pvc directory to each pod created and it will get all the required and update data.. isn't it be true?
@DevOpsPro
@DevOpsPro 9 ай бұрын
Using Persistent Volumes (PV) and Persistent Volume Claims (PVC) to share data among pods is a valid approach. StatefulSets, on the other hand, offer additional benefits such as ordered pod creation, stable network identities, and ease of scaling for stateful applications like databases. It ultimately depends on your specific use case and requirements.
@amankumarpatel1281
@amankumarpatel1281 9 ай бұрын
@@DevOpsPro great 👍 thanks!
@pjj7466
@pjj7466 4 ай бұрын
It's better if you show us the practical implementation of it. So we could understand the how the data replication happening from masterpods to replica
@DevOpsPro
@DevOpsPro 4 ай бұрын
I will create separate video on demo.
@parulgoyal8044
@parulgoyal8044 10 ай бұрын
Can you please share the link of kubernetes English videos
@DevOpsPro
@DevOpsPro 9 ай бұрын
Will make soon on english channel.
@deepeshraut3065
@deepeshraut3065 4 ай бұрын
i hv a question, when we create the deployment for the database pod and define replicas=3 So, 3 pods of database are running. And when application perform write action on mydb-1 so, this data should be replicate on mydb-2 and mydb-3 and update themselves bcoz these are the replicas. So, why do we need to do the statefullset ? Please correct me if m wrong ?
@DevOpsPro
@DevOpsPro 4 ай бұрын
Great question! In a Deployment, replicas are identical instances, and changes can be applied uniformly. However, StatefulSets are valuable for scenarios where each pod has a unique identity and stable network identity. This is particularly crucial for databases where each instance (e.g., mydb-1, mydb-2) may have specific storage and network requirements. StatefulSets provide ordered deployment, stable network identities, and persistent storage, ensuring predictable scaling and recovery. Hope this clarifies!
@deepeshraut3065
@deepeshraut3065 25 күн бұрын
@@DevOpsPro yeah.. Thank you🙂
@maheshkumarnaik754
@maheshkumarnaik754 6 ай бұрын
Hi We didnt find new video's.
@siddharthkumar6453
@siddharthkumar6453 Ай бұрын
Your voice is like Deepika Padukone
@sandeepvemu794
@sandeepvemu794 Жыл бұрын
I am learning two things Hindi and K8s
@rahulsingh-iq4gd
@rahulsingh-iq4gd Ай бұрын
Good for your carrier
@sandeepvemu794
@sandeepvemu794 Ай бұрын
@@rahulsingh-iq4gd carrier?
@akashsonawane3911
@akashsonawane3911 Жыл бұрын
Many thanks for providing clear and concise explanations
@pattanayakbabu559
@pattanayakbabu559 3 ай бұрын
Where is practical vedio
@kamleshbhachani9106
@kamleshbhachani9106 Жыл бұрын
Can you share your mail id to attend live class. I want to change career In devops profile
@DevOpsPro
@DevOpsPro Жыл бұрын
Thank you for your interest in attending our live class. Please send an email to devopsproin@gmail.com with your request, and we will inform you when we schedule the session. Best of luck with your career change to the DevOps profile!
@kamranastanov5016
@kamranastanov5016 5 ай бұрын
Why not english?
@DevOpsPro
@DevOpsPro 4 ай бұрын
Will make english k8s playlist on english channel soon.
@yogitasharma4054
@yogitasharma4054 Жыл бұрын
#devopspro
@RC-om7tn
@RC-om7tn 8 ай бұрын
Excellent
Kubernetes Ingress Explained: From Beginner to Expert
12:26
DevOps Pro
Рет қаралды 29 М.
He sees meat everywhere 😄🥩
00:11
AngLova
Рет қаралды 11 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 4,1 МЛН
Kubernetes StatefulSet simply explained | Deployment vs StatefulSet
16:00
TechWorld with Nana
Рет қаралды 225 М.
Deploy a production Database in Kubernetes
8:56
Raghav Dua
Рет қаралды 7 М.
Statefulsets | Deploying MongoDB cluster to Kubernetes
18:22
Pavan Elthepu
Рет қаралды 24 М.
Kubernetes Ingress in 5 mins
5:41
IBM Technology
Рет қаралды 180 М.
Istio & Service Mesh - simply explained in 15 mins
16:09
TechWorld with Nana
Рет қаралды 640 М.
Static Pods in Kubernetes - The Ultimate Guide for DevOps Pro
18:25