SlideShare a Scribd company logo
Managing Stateful Apps In
Kubernetes
Managing Stateful Applications in Kubernetes
@rajashree_28 mrajashree
I’m Rajashree
Managing Stateful Applications in Kubernetes
1. Containers and Container Orchestration
2.Kubernetes
3.Stateless vs stateful apps
4.Running stateful apps on k8s
1. Containers and Container Orchestration
2.Kubernetes
3.Stateless vs stateful apps
4.Running stateful apps on k8s
Containers
Application packaging
• Source code, dependencies, env vars
• Application portability
• Performance consistency
• No more “it works on my machine”
Managing Stateful Applications in Kubernetes
OS level virtualization
• Containers share host Operating System
• Lightweight as opposed to a VM
• One host can run multiple containers
• Resource isolation
• Increased efficiency
Managing containers
Container
Node
Container
Container
• Scheduling across nodes
• Availability
EC2
Container
EC2 EC2
Client
Managing containers
Container
Container
Container
Container
Container
Container
Container
Container
Run 3 containers
Run 3 containers
Run 3 containers
Managing containers
• Which machine is my container running on?
• Are there sufficient resources for my app?
• How do containers communicate with each
other?
• How do I manage load balancing?
• How do I ensure healthcheck/monitoring?
Container orchestration
Client
EC2
Container
Container
Container
EC2
Container
Container
Container
EC2
Container
Container
Container
Run 9 containers
1. Containers and Container Orchestration
2.Kubernetes
3.Stateless vs stateful apps
4.Running stateful apps on k8s
Kubernetes!
• Manage containerized applications
• Open source
• Scalability
• Handle upgrades
Pod
• Smallest deployable unit
• One or more containers
• “one-container-per-pod”
• Unique IP address
Container
Pod
10.10.1.1
Node
Deployment
• Pods are ephemeral
• Deployments manage pod life-cycle
• Ensure actual state same as desired
• Provide easy scaling, upgrades for apps
k8s cluster
Pod 1
10.10.1.1
10.11.1.1
10.11.1.2
Pod 2
Pod 3
Node 1
Node 2
Deployment
selector=

app: nginx
labels=

app: nginx
labels=

app: nginx
labels=

app: nginx
1. Containers and Container Orchestration
2.Kubernetes
3.Stateless vs stateful apps
4.Running stateful apps on k8s
Stateless
• No persisted data
• No application state
• Pods are replaceable
• Examples: edge API server, nginx
Stateful
• Persisted data
• Server/node identity is irreplaceable
• Examples: mysql, cassandra
Why run stateful apps on k8s?
1. Depends on use case
2. Leverage containerization benefits
3. Manage stateless and stateful apps together
4. Ability to use same infrastructure provider
5. Easy scalability
6. Affordability
1. Containers and Container Orchestration
2.Kubernetes
3.Stateless vs stateful apps
4.Running stateful apps on k8s
K8s objects for statefulness
• Persistent Volumes (PV)
• Persistent Volume Claims (PVC)
• Storage Class
• StatefulSet
Persistent volume
• Storage resource in k8s
• Volume plugins
• Created by cluster admin
• Lifecycle independent of pod
Persistent Volume Claims
• Request to claim a storage resource
• Abstracts storage details of PV from user
• User only specifies size and access mode
• Access modes: RWO, RWM, ROM
Static Provisioning
Cluster admin
Creates PV
PV
size: 10 GB
AccessMode: RWO
User
Creates PVC
PVC
requests:
size: 3 GB (min)
AccessMode: RWO
Available
PVController
Bound
Limitations?
• User created PVC requesting 3 Gib
• But there was only one PV with 10 Gib
• PV got bound to PVC with excess volume
• User will get a PV-PVC binding only if admin
has created enough PVs
Storage Class
• Resource for classifying storage
• Specifies provisioner, parameters, reclaimPolicy
• Created by cluster admin
• User must know name of Storage Class
Dynamic Provisioning
Cluster admin
Creates 

Storage Class
Name: standard

Provisioner: aws-ebs
Parameters: type=gp2
ReclaimPolicy: Delete
User
Creates PVC
PVC
storageClass: standard
size: 3 GB (min)
AccessMode: RWO
Creates PV
PV
size: 3 GB
AccessMode: RWO
Dynamic Provisioning
• Efficient resource utilization
• Only needs storageClass and PVC creation
• PV created dynamically
Pod in stateful app
• Stores data independently
• Should have separate PV
• Needs separate PVC for separate PV
• Lets say you want 10 pods for your app
• Do you create 10 PVCs?
• What about when you want to scale up?
• Can something create PVCs dynamically too?
Pod in stateful app
StatefulSets
• Stable unique persistent volume for each pod
• Creates PVC using a volume claim template
• Stable unique network identifier for all pods
• Ordered deployment and scaling
• Automated rolling updates
Use Case - Cassandra
• Highly available, scalable
• Uses replication while storing data
• All nodes are equal
• Cassandra nodes can identify each other
EC2 EC2
cassandra-0 cassandra-1 cassandra-2
PVC 0
PV 0 PV 1 PV 2
PVC 1 PVC 2
StatefulSet
1. Containers and Container Orchestration
2.Kubernetes
3.Stateless vs stateful apps
4.Running stateful apps on k8s
Thank you!

More Related Content

What's hot (20)

PDF
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
kanedafromparis
 
PDF
Zephyr: Creating a Best-of-Breed, Secure RTOS for IoT
LinuxCon ContainerCon CloudOpen China
 
PDF
Monitoring microservices: Docker, Mesos and Kubernetes visibility at scale
Alessandro Gallotta
 
PDF
Ports, pods and proxies
LibbySchulze
 
PPTX
Security best practices for kubernetes deployment
Michael Cherny
 
PPTX
Kubernetes Security
Karthik Gaekwad
 
PDF
DevSecOps: Bringing security to the DevOps pipeline
Aarno Aukia
 
PDF
Kubernetes - Security Journey
Jerry Jalava
 
PDF
Big data and Kubernetes
Anirudh Ramanathan
 
PDF
Openshift Container Platform on Azure
Glenn West
 
PDF
From Code to Kubernetes
Daniel Oliveira Filho
 
PPTX
Kata Container - The Security of VM and The Speed of Container | Yuntong Jin
Vietnam Open Infrastructure User Group
 
PPTX
Containers and workload security an overview
Krishna-Kumar
 
PDF
Introduction to kubernetes
Gabriel Carro
 
PDF
Java one kubernetes, jenkins and microservices
Christian Posta
 
PDF
Introduction to Kubernetes Security (Aqua & Weaveworks)
Weaveworks
 
PPTX
K8S in prod
Mageshwaran Rajendran
 
PPTX
NetflixOSS for Triangle Devops Oct 2013
aspyker
 
PDF
Virtualized Containers - How Good is it - Ananth - Siemens - CC18
CodeOps Technologies LLP
 
PDF
Kubernetes Networking 101
Kublr
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
kanedafromparis
 
Zephyr: Creating a Best-of-Breed, Secure RTOS for IoT
LinuxCon ContainerCon CloudOpen China
 
Monitoring microservices: Docker, Mesos and Kubernetes visibility at scale
Alessandro Gallotta
 
Ports, pods and proxies
LibbySchulze
 
Security best practices for kubernetes deployment
Michael Cherny
 
Kubernetes Security
Karthik Gaekwad
 
DevSecOps: Bringing security to the DevOps pipeline
Aarno Aukia
 
Kubernetes - Security Journey
Jerry Jalava
 
Big data and Kubernetes
Anirudh Ramanathan
 
Openshift Container Platform on Azure
Glenn West
 
From Code to Kubernetes
Daniel Oliveira Filho
 
Kata Container - The Security of VM and The Speed of Container | Yuntong Jin
Vietnam Open Infrastructure User Group
 
Containers and workload security an overview
Krishna-Kumar
 
Introduction to kubernetes
Gabriel Carro
 
Java one kubernetes, jenkins and microservices
Christian Posta
 
Introduction to Kubernetes Security (Aqua & Weaveworks)
Weaveworks
 
NetflixOSS for Triangle Devops Oct 2013
aspyker
 
Virtualized Containers - How Good is it - Ananth - Siemens - CC18
CodeOps Technologies LLP
 
Kubernetes Networking 101
Kublr
 

Similar to Managing Stateful Applications in Kubernetes (20)

ODP
Stateful applications on kubernetes
Akash Agrawal
 
PDF
DoK Talks #96- Persistent Disk or StatefulSet?
DoKC
 
PDF
Kubernetes Basics - ICP Workshop Batch II
PT Datacomm Diangraha
 
PDF
Data protection in a kubernetes-native world
LibbySchulze
 
PDF
The Highs and Lows of Stateful Containers
C4Media
 
PDF
Running and Managing Kubernetes on OpenStack
Victor Palma
 
PDF
Containerizing stateful apps with Kubernetes and SUSE CaaS Platform
Juan Herrera Utande
 
PDF
Designing Stateful Apps for Cloud and Kubernetes
Evan Chan
 
PDF
Solving k8s persistent workloads using k8s DevOps style
MayaData
 
PDF
Containers and Kubernetes without limits
Antje Barth
 
PDF
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
NETWAYS
 
PDF
Casos de uso para aplicaciones tradicionales en un mundo de contenedores
SUSE España
 
PDF
Container Attached Storage with OpenEBS - CNCF Paris Meetup
MayaData Inc
 
PDF
From Containerized Application to Secure and Scaling With Kubernetes
Shikha Srivastava
 
PDF
Managing containers at scale
Smruti Ranjan Tripathy
 
PDF
Open Source Summit NorthAmerica 2017 Stateful Apps in Containers
Steve Wong
 
PDF
Think like a storage architect, in four questions
Cheryl Hung
 
PDF
Kubernetes in Production: Lessons Learnt
Arunvel Sriram
 
PDF
Running stateful applications in containers with k8 s persistent volumes and ...
Kapil Arora
 
PPTX
Dok Talks #113 - Developing Stateful Application on Kubernetes
DoKC
 
Stateful applications on kubernetes
Akash Agrawal
 
DoK Talks #96- Persistent Disk or StatefulSet?
DoKC
 
Kubernetes Basics - ICP Workshop Batch II
PT Datacomm Diangraha
 
Data protection in a kubernetes-native world
LibbySchulze
 
The Highs and Lows of Stateful Containers
C4Media
 
Running and Managing Kubernetes on OpenStack
Victor Palma
 
Containerizing stateful apps with Kubernetes and SUSE CaaS Platform
Juan Herrera Utande
 
Designing Stateful Apps for Cloud and Kubernetes
Evan Chan
 
Solving k8s persistent workloads using k8s DevOps style
MayaData
 
Containers and Kubernetes without limits
Antje Barth
 
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
NETWAYS
 
Casos de uso para aplicaciones tradicionales en un mundo de contenedores
SUSE España
 
Container Attached Storage with OpenEBS - CNCF Paris Meetup
MayaData Inc
 
From Containerized Application to Secure and Scaling With Kubernetes
Shikha Srivastava
 
Managing containers at scale
Smruti Ranjan Tripathy
 
Open Source Summit NorthAmerica 2017 Stateful Apps in Containers
Steve Wong
 
Think like a storage architect, in four questions
Cheryl Hung
 
Kubernetes in Production: Lessons Learnt
Arunvel Sriram
 
Running stateful applications in containers with k8 s persistent volumes and ...
Kapil Arora
 
Dok Talks #113 - Developing Stateful Application on Kubernetes
DoKC
 
Ad

More from All Things Open (20)

PDF
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
PPTX
Big Data on a Small Budget: Scalable Data Visualization for the Rest of Us - ...
All Things Open
 
PDF
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
PDF
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
All Things Open
 
PDF
Leveraging Pre-Trained Transformer Models for Protein Function Prediction - T...
All Things Open
 
PDF
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
All Things Open
 
PDF
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
All Things Open
 
PPTX
DON’T PANIC: AI IS COMING – The Hitchhiker’s Guide to AI - Mark Hinkle, Perip...
All Things Open
 
PDF
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
All Things Open
 
PDF
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
All Things Open
 
PPTX
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
All Things Open
 
PDF
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
All Things Open
 
PPTX
Open-Source GenAI vs. Enterprise GenAI: Navigating the Future of AI Innovatio...
All Things Open
 
PDF
The Death of the Browser - Rachel-Lee Nabors, AgentQL
All Things Open
 
PDF
Making Operating System updates fast, easy, and safe
All Things Open
 
PDF
Reshaping the landscape of belonging to transform community
All Things Open
 
PDF
The Unseen, Underappreciated Security Work Your Maintainers May (or may not) ...
All Things Open
 
PDF
Integrating Diversity, Equity, and Inclusion into Product Design
All Things Open
 
PDF
The Open Source Ecosystem for eBPF in Kubernetes
All Things Open
 
PDF
Open Source Privacy-Preserving Metrics - Sarah Gran & Brandon Pitman
All Things Open
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
Big Data on a Small Budget: Scalable Data Visualization for the Rest of Us - ...
All Things Open
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
All Things Open
 
Leveraging Pre-Trained Transformer Models for Protein Function Prediction - T...
All Things Open
 
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
All Things Open
 
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
All Things Open
 
DON’T PANIC: AI IS COMING – The Hitchhiker’s Guide to AI - Mark Hinkle, Perip...
All Things Open
 
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
All Things Open
 
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
All Things Open
 
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
All Things Open
 
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
All Things Open
 
Open-Source GenAI vs. Enterprise GenAI: Navigating the Future of AI Innovatio...
All Things Open
 
The Death of the Browser - Rachel-Lee Nabors, AgentQL
All Things Open
 
Making Operating System updates fast, easy, and safe
All Things Open
 
Reshaping the landscape of belonging to transform community
All Things Open
 
The Unseen, Underappreciated Security Work Your Maintainers May (or may not) ...
All Things Open
 
Integrating Diversity, Equity, and Inclusion into Product Design
All Things Open
 
The Open Source Ecosystem for eBPF in Kubernetes
All Things Open
 
Open Source Privacy-Preserving Metrics - Sarah Gran & Brandon Pitman
All Things Open
 
Ad

Recently uploaded (20)

PDF
July Patch Tuesday
Ivanti
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
July Patch Tuesday
Ivanti
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Managing Stateful Applications in Kubernetes