Stateless vs Stateful Kubernetes (2024)

WEKA. February 4, 2021

Kubernetes has become the de-facto orchestration tool and initially it was supporting stateless applications, but stateful (data-driven) applications are very common and are critical to almost all the businesses. Now, a lot of support is available for running stateful applications with Kubernetes.

In this article you’ll learn about these topics:

  • Stateless vs stateful basics
  • Containerized Stateful Application Use Cases and Their Challenges
  • Kubernetes storage and stateful applications
  • Kubernetes storage provisioning & AI workloads
  • How Weka’s Parallel File System Helps Solve Stateful Use Cases

Stateless vs. Stateful Kubernetes

At a very basic level, as the name suggests, the term “stateless” means that no past data nor state is stored or needs to be persistent when a new container is created. Stateless applications tend to include containerized microservices apps, CDN, print services, or any short term workers. and are easy for both deploying and managing resources.

Stateful applications typically involve some database, such as Cassandra, MongoDB, or MySQL and processes a read and/or write to it. Typically, it will involve requests being processed based on the information provided. The prior request history impacts the current state; hence, the server must access and hold onto state information generated during the processing of the earlier request, which is why it is called stateful.

Almost all the applications with modern workloads, such as AI/ML, financial data, and genomics sequencing are stateful and require persistent storage.

Containerized Stateful Application Use Cases and Their Challenges

Containerized applications need statefulness, as they are commonly deployed in hybrid and edge-to-core-to-cloud workloads, as well as CI/CD use cases. Here are some of the common use cases for containerized application deployments:

  • Data analytics processing and AI/ML–Hadoop, Spark, Tensorflow, PyTorch, and Kubeflow are now increasingly adopting containers. And need to go over massive amounts of data repeatedly.
  • MLOps–There are a number of stateful requirements when using containers for MLOps environments, such as checkpointing for large training jobs and sharing training and inference results.
  • Databases and messaging–Some applications recommend local flash for low latency. Using local flash on the POD’s worker nodes will limit the capabilities of moving containers between different worker nodes in the POD for additional agility. That is the reason why a high-performance shared storage like Weka, one that can provide the same or better latency while allowing for shared high performance data, would allow effectively using applications such as these:
  • – Single-instance databases like MySQL, PostgreSQL, MariaDB
    – NoSQL databases like Cassandra and MongoDB
    – In-memory databases like Redis and MemSQL and KDB+
    – Messaging apps like Kafka
    – Business critical apps like Oracle, SQL server, and SAP

Kubernetes Storage and Stateful Applications

In Kubernetes, basic storage building blocks are known as volumes. A volume is attached to a pod. A volume is like local storage, and there is no persistence to it. A volume gets released when a pod is destroyed. As such, a regular volume lacks persistence, portability, and scalability.

Persistent storage, as the name suggests, retains or stores the data generated by an application, making it suitable for stateful applications. Unlike local storage or a regular volume, a persistent volume is managed by clusters, and it’s not dependent on the pod lifecycle; therefore, the data can be retained and reused.

When creating a persistent volume for Kubernetes clusters, the storage file system and its configuration (IDs, access modes, size, names etc.) needs to be specified in a StorageClass.

There are 3 steps involved in creating a persistent volume and attaching it to a container in a pod:

  • Create a StorageClass
  • Create a PersistentVolumeClaim
  • Define the volume

Kubernetes Storage Provisioning and AI Workloads

There are two popular ways of provisioning persistent storage in Kubernetes: static and dynamic. We expanded on the topic in Kubernetes storage provisioning: what you should know before deploying containerized applications. To recap, the main difference relies on the point in which you want to configure storage. If you need to pre-populate data in a volume, you choose static provisioning. If you need to create volumes on demand, you go for dynamic provisioning.

Dynamic provisioning is no longer tied to the lifecycle of the pod. Moreover, the workload is not independent of the storage technology nor whether it is running on premises or in the cloud. That gives you more flexibility in choosing different deployment modes for different workloads. The outcome is optimal and flexible usage of resources for each specific workload.

In the past though, dynamic provisioning required changes to the Kubernetes source code. Today, Kubernetes developed a container storage interface (CSI) that provides the ability to implement and provision without changing the Kubernetes source code. CSI bundles it under a single umbrella, so it’s easier to perform dynamic and static provisioning. Then users simply install the volume plugin within the cluster and use it with a StorageClass object.

How Weka’s Parallel File System Helps Solve Stateful Use Cases

WekaFS, the world’s fastest and most scalable parallel file system, addresses the shareability, performance, and portability challenges by providing stateful, reliable storage, allowing seamless deployment on premises and easy migration to the cloud, while meeting high performance and low latency requirements. Using the WekaFS Kubernetes CSI plugin, organizations now have increased flexibility in how and where they deploy containers while delivering local storage performance and low latency.

The WekaFS CSI plugin is deployed using a Helm Chart or as a Daemonset, along with the POSIX agent on Kubernetes worker nodes, and is available in the Rancher application catalog as well. WekaFS supports volume provisioning in both the dynamic (persistent volume claim) and static (persistent volume) forms with its own storage class. It also supports ReadOnlyMany, ReadWriteOnce, and ReadWriteMany access modes.

WekaFS provides the same highest performing disaggregated storage, scalability, encryption, and data protection to all application- specific Kubernetes PODs and clusters, whether on premises or in the cloud.

Stateless vs Stateful Kubernetes (1)

Create persistent storage for your containerized applications

Using Weka Kubernetes CSI plugin

Click here

Stateless vs Stateful Kubernetes (2024)
Top Articles
This underused Social Security move will boost the average check by $460 in 3 years
JPMorgan's UK digital bank blocks customers from buying crypto
417-990-0201
Wisconsin Women's Volleyball Team Leaked Pictures
Music Archives | Hotel Grand Bach - Hotel GrandBach
Heska Ulite
Jet Ski Rental Conneaut Lake Pa
Phillies Espn Schedule
How to watch free movies online
More Apt To Complain Crossword
Busted Newspaper S Randolph County Dirt The Press As Pawns
Learn2Serve Tabc Answers
Peraton Sso
Interactive Maps: States where guns are sold online most
Arre St Wv Srj
Hdmovie2 Sbs
Masterkyngmash
Contracts for May 28, 2020
Sunset Time November 5 2022
C&T Wok Menu - Morrisville, NC Restaurant
Wics News Springfield Il
Thick Ebony Trans
Directions To Nearest T Mobile Store
Feathers
When His Eyes Opened Chapter 3123
100 Gorgeous Princess Names: With Inspiring Meanings
Weather Underground Durham
Town South Swim Club
Mawal Gameroom Download
Filmy Met
Devotion Showtimes Near The Grand 16 - Pier Park
Wisconsin Volleyball Team Leaked Uncovered
Bozjan Platinum Coins
Metra Union Pacific West Schedule
Aveda Caramel Toner Formula
Magicseaweed Capitola
Bella Thorne Bikini Uncensored
Electronic Music Duo Daft Punk Announces Split After Nearly 3 Decades
2 Pm Cdt
Anhedönia Last Name Origin
Other Places to Get Your Steps - Walk Cabarrus
Go Bananas Wareham Ma
Craigslist Odessa Midland Texas
SF bay area cars & trucks "chevrolet 50" - craigslist
Promo Code Blackout Bingo 2023
Pink Runtz Strain, The Ultimate Guide
Adams-Buggs Funeral Services Obituaries
About us | DELTA Fiber
Lake County Fl Trash Pickup Schedule
Ok-Selection9999
Emmi-Sellers
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 6596

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.