The State of Kubernetes’ Stateful Workloads
Each month on The New Stack, we pick a theme to devote a certain amount of coverage to, issues that we hear are important to our readers. This month, we looked at one of the ongoing challenges for Kubernetes, namely how to run stateful applications.
Kubernetes was originally designed for stateless workloads, or those that did not require keeping session information of the user. Most applications, however, require the application to keep some sort of state information, and hence, require some sort of persistent backend storage.
The good news that we’ve found is that there are multiple approaches to running stateful workloads on K8s, even if we haven’t fully decided on which approaches to embrace — and codify.
There are a variety of ways of managing state, pointed out analyst Janakiram MSV in his post, “Different Approaches for Building Stateful Kubernetes Applications." You could do a shared cluster, either through native provisioning by Kubernetes itself, or by host-based provisioning at the cluster. Another approach is stateful sets, where Kubernetes manages backup copies of the data through the ReplicaSet, DaemonSet, and StatefulSet controllers. Or, you could look to the solutions offered by cloud native storage solution providers, such as NetApp, Red Hat or Portworx. These often involve additional proprietary schedulers, though they can save a lot of maintenance time. If you are looking for options, MSV’s post is a good starting point.
In keeping with this theme, we also did a Q&A with Saad Ali, a software engineer at Google and the chair of the Kubernetes Storage Special Interest Group at the Cloud Native Computing Foundation, about the work already done to make run stateful workloads easier, as well as the challenges that remain and what to look for in the future. One preview: Work is being done to make better interfaces for CSI volume health checks.
Expect to see more posts about Kubernetes stateful workloads over the next week or so, including a contributed post (and podcast interview) with Ryan Staatz, head of DevOps at LogDNA, who writes that the “effectiveness with which you can run stateful services on Kubernetes begins with your infrastructure.” Check in daily at TheNewStack.io.