Once upon a time, the concept of “workflow” in Kubernetes might have seemed a bit antithetical.
Consider this older definition from the business process management world, via Wikipedia: “A workflow consists of an orchestrated and repeatable pattern of activity, enabled by the systematic organization of resources into processes that transform materials, provide services, or process information.”
Kubernetes Operators are a particular boon for workflow automation.
“Orchestrated and repeatable” sure sound relevant to Kubernetes, but that definition (and many of its variants) also suggests state – something Kubernetes and containers in general weren’t thought to be good at in their initial phases. In the early days, a term like “stateful application” would have been viewed as a no-go for Kubernetes, says Ravi Lachhman, evangelist at Harness.
“Since containerized workloads are ephemeral and meant to terminate quickly and gracefully, this would not be conducive to a workflow that would be long-lived,” Lachhman. “Inherently, workflows are stateful [and] need to live to give decisions or move forward workloads.”
[ Kubernetes 101: An introduction to containers, Kubernetes, and OpenShift: Watch the on-demand Kubernetes 101 webinar.]
As Kubernetes and its ecosystem have evolved, however, automating certain workloads and processes – including for stateful applications – has become much more achievable. Lachhman points to Kubernetes Operators as a particular boon for workflow automation – we’ll discuss this in detail at the end of this post.
Workflows you can automate with Kubernetes
In the meantime, we asked Raghu Kishore Vempati, director of technology, research, and innovation at Altran, to take us through some key examples or workflows or processes that can be automated with Kubernetes. Gary Duan, CTO at NeuVector, also shares some thoughts from a security automation standpoint.
1. App setup/Installation
For large solutions that comprise several (or more) applications, the setup and installation process almost inevitably requires automation to reduce the operational burden, Vempati notes. Cluster management can otherwise become significantly complex, says Vempati, especially as various installation units are further versioned.
“Adopting a DevOps approach, Continuous Delivery of applications and their configuration on a Kubernetes cluster can be completely automated,” Vempati says. “A single installation/setup for a particular logical app plane could consist of several resources that could include deployments, services, secrets, stateful sets, etc. Several such installation units belonging to a single application/solution can be orchestrated in an order to be set up on the K8s cluster.”
[ Kubernetes terminology, demystified: Get our Kubernetes glossary cheat sheet for IT and business leaders. ]
2. Pod and node scaling
Dynamic pod scaling is considered one of Kubernetes’ particularly important features. Vempati notes that the Horizontal Pod Autoscaler, or HPA, enables the system to scale pods based on common system metrics (e.g. CPU utilization) or custom app metrics (e.g. number of requests), which are configurable for the cluster.
“However, the configuration itself could be subject to change for various resources on the cluster,” Vempati says. “This process of configuring the scalability behavior of the pods itself can be automated and can be subject to various factors and dependencies within and outside the application/solution.”
There is a corollary here with another key concept in Kubernetes architecture: nodes.
“K8s by itself doesn’t provide for node scaling,” Vempati says. “It [does], however, have the capability where nodes can be added or removed from the cluster without impacting the execution of applications.”
Various cloud platforms offer automation of node scaling as part of the platforms or services, according to Vempati, including for hybrid or on-premises environments. “As with pod scaling, while the node scaling can be configured, the process of configuring the scalability of the nodes itself can be automated based on factors internal and external to the application/solution,” Vempati says.
[ Read also: 5 open source projects that make Kubernetes even better. ]
3. Persistent storage management
Stateful applications such as databases are no longer taboo in Kubernetes environments – far from it.
“K8s has many features that help run stateful applications,” Vempati says. “For example, it provides the ability to dynamically provision storage volumes on-demand.”
Vempati also points to the ability to clone persistent volumes for storage systems that implement the Kubernetes CSI spec, as well as the ability to capture snapshots of the volumes that are accessed by applications, as key features on this front.
“For large applications running in production, these capabilities are very useful,” Vempati says. “For applications that require high availability of data, having the latest snapshots of data and the time to restoration of access to the data is very critical. Automation of the above-mentioned capabilities and their associated configurations for the applications can help achieve the same.”
Let’s examine three more important examples of what you can automate: