Secure file-sharing platform Box has released as open source a microservice it developed in-house, called kube-applier, that keeps Kubernetes objects up-to-date with declarative configuration. Kube-applier has been used in product at Box for almost a year, so the beta testing has been done for you.
“Kubernetes is unequivocally the infrastructure of the future. We’re happy to contribute the platform,” said Sam Ghods, Box services architect and co-founder, in a phone interview.
Before kube-applier, Box developers had to manage cluster or imperative objects manually, Greg Lyons, contributor to the kube-applier API, further explained in a phone interview. Now, when they write their own application- specific config files they only have to code it once, then run it anywhere.
Declarative configurations are the gold standard across all sorts of infrastructure paradigms, Lyons explained, yet this is something that had been missing from the Kubernetes container orchestration engine. kube-applier gives developers a way to keep track of version control, allowing them to keep track of the history of their system.
Box is currently running three different production clusters as well as development and staging environments and is moving to add more clusters all the time. The company needed its engineers to be able to update all the clusters.
“It is not about delivering configuration to the containers themselves or enabling the containers,” said Ghode. The ability to deploy configuration already exists in Kubernetes.
“This is about updating objects in a way that is safe and declarative and reversible,” he explained. It synchronizes the specification from the developer into all the clusters in a way that’s more predictable then each developer having to issue multiple commands in each separate cluster, he said.
Kubernetes can be scary at first, said Lyons, because in abstracting away some problems, you can come up with a whole new set of challenges. Enter kube-applier, which abstracts away this process.
Lyons lays out the process on the Box blog: “It watches a remote Git repository for new commits then runs kubectl apply on each file against your Kubernetes cluster, making deployment as simple as committing your file changes. kube-applier lets you choose its ‘root’ to be any directory within a Git repo, so we run a kube-applier instance on each cluster and point it at the correct subdirectory.”
The upshot is, as long as you check in your code to this code base, he said, developers can have the piece of mind to know that their code will be updated throughout the entire code structure. This can abstract away one of the finer points of running Kubernetes.
The kube-assist software, accessible via an API, allows portability across all possible clouds — virtualized public, private, bare metal, Lyons said.