How Heptio plans to automate away Kubernetes setup pains

Using Google's custom Ksonnet language, microservices developers can spend less time on configuration setup

automation
Thinkstock

Heptio, the commercial Kubernetes outfit founded by two creators of the container orchestration framework, has unveiled its first public project for making Kubernetes easier to deploy in the enterprise.

Kubernetes simplifies how apps run as microservices, but setting up Kubernetes itself is no picnic. Heptio’s project automates some of the fiddlier parts of the setup process via a custom, domain-specific language.

Heptio’s project, dubbed Ksonnet, is an open source toolset for assembling the configuration needed to deploy Kubernetes. The most common setup difficulties in Kubernetes involve creating the configuration files, what Heptio calls the “wall of YAML” problem.

Ksonnet uses the Jsonnet data-templating language, created by Google, to automatically generate the configuration files needed for a Kubernetes deployment. The resulting files have sane defaults for most use cases, but they can be customized as needed. The file generation can be done entirely programmatically or by using JSON as a base template for the configuration file to be generated.

One drawback to Ksonnet is that it requires you to write the templates in Ksonnet’s own code. You can’t use a familiar scripting language like Python or even Go, the language Kubernetes is written in. Ironically, the underlying Jsonnet language used by Ksonnet has both Python and Go bindings, although only the Python API is an official offering.

Joe Beda, one of Heptio’s cofounders and a co-creator of Kubernetes, explained why the company decided on a domain-specific language rather than, for instance, a library with bindings to a language of choice. Using Python or another scripting language “didn’t meet our long-term goals around making Kubernetes more approachable,” Beda said.

“In my mind,” Beda added, “Jsonnet offers a great ramp from simply a ‘better JSON’ to ‘template some values’ to ‘manipulate structure.’ … Something that looks and feels like code (Python, JavaScript) can be really intimidating. When you are getting started, it just feels wrong to have to write a program to deploy your program.”

Ksonnet involves contributions from three other companies — Deis (now part of Microsoft), Bitnami, and Box — all with significant production-level Kubernetes deployments.

Ksonnet is not Heptio’s only Kubernetes focus. In a presentation delivered at GlueCon, Beda noted three other efforts focused on making Kubernetes “accessible to non-systems engineers,” making it “trivial to get up and running anywhere,” and delivering “sophisticated enterprise-focused features.” Ksonnet could help deliver on that last area by providing a unified way for management frameworks like Chef or Puppet to assemble a Kubernetes install.

The Ksonnet project is still in the early, prototype stages, Beda notes. Thus, the full scope of what Ksonnet could do for Kubernetes hasn’t been explored yet — neither all the ways Ksonnet could be used to configure Kubernetes, nor the level of abstraction possible for that configuration.

“If the raw YAML for Kubernetes is machine code then Ksonnet, right now, is kind of an assembly [language],” Beda says. “We are going to work our way up to higher and higher level representations while still providing ways to get to the full Kubernetes feature set.”

Also, Ksonnet may work out only as a solution for just one subset of Kubernetes users. “We don’t see Ksonnet as the only way to solve this, but we hope it’ll prove to be a way that works for a large percentage of users.”

Where Ksonnet might show the most payoff is with Kubernetes clusters that have more nodes. Having more nodes typically means more complex workloads deployed on those nodes, which is a better use case for Ksonnet. A recent Kubernetes user survey showed that around 48 percent of Kubernetes deployments used just between one and 10 nodes. 

Still, even deployments with a modest number of nodes could benefit from a unified way like Heptio’s to manage how configurations are created—not only for manual setups but those done via a distribution like CoreOS, because Heptio would provide another mechanism for automating how Kubernetes itself can be managed.

Copyright © 2017 IDG Communications, Inc.