Seraphim Vector - Fotolia
Jenkins on Kubernetes is promising, but integration needs work
Jenkins and Kubernetes are a natural fit for automated application development and delivery, and the open source community has plans to improve how Jenkins runs on containers.
SAN FRANCISCO -- Jenkins and Kubernetes are a popular pair of tools for automated CI/CD, but the combination could be much easier to set up and manage.
CI/CD pipelines with containerized Jenkins on Kubernetes perform faster and more flexibly, at a lower cost, than pipelines that run on VMs, bare metal or containers without orchestration. But the Jenkins open source community needs smoother integrations between them to support widespread use in mainstream IT shops.
IT pros who deploy Jenkins on Kubernetes on their own explained the benefits of CI/CD pipelines that use container infrastructure at DevOps World | Jenkins World here this week.
"We set up Jenkins masters with a set of slaves in their own [Kubernetes] namespace," said Guillermo Palacio, platform engineer at German sporting-goods retailer Adidas, in a conference presentation. "That way, we just have to pay for the resources an elastic pool of slaves [actually uses]."
Quickly learn Jenkins
Interested in quickly learning how Jenkins works? Just follow these Jenkins tutorials.
- A step by step introduction to Jenkins tutorial
- How to create your Jenkins build job
- Add Jenkins environment variables to your scripts
- Enhance your CI with parameterized Jenkins build jobs
- Integrate Git with Jenkins
- Automate deployment to Artifactory or Nexus
- Master the art of Maven builds
- Test your knowledge with this Jenkins quiz
- How well would you do on a Jenkins or DevOps interview?
A Kubernetes plug-in for Jenkins connects the two software platforms, and Adidas used the plug-in to create a command-line-based tool called Adidas Continuous Integration and Deployment (ACID) that it released on GitHub. With ACID, the CI/CD pipeline at Adidas is horizontally scalable; masters aren't a single point of failure. Palacio's team manages permissions and secrets centrally, and developers compete less for shared resources than with VM-based Jenkins.
Adidas IT also created a user interface for Jenkins on Kubernetes to support legacy systems, Palacio said in an interview before his presentation.
Many companies can't develop tools in-house for IT management, but cloud services such as the Google Kubernetes Engine (GKE) give them a leg up with Kubernetes infrastructure setup and let them focus on Jenkins deployment to the container platform.
"It took me about an hour to get Jenkins masters installed with Helm charts [on GKE], plus about a weekend's time researching the technologies," said Mandy Hubbard, software engineer and QA architect at e-discovery company CS Disco based in Austin, Texas, in a conference presentation. "At the same time, I don't want to wave my hands and say I just ran one command."
Hubbard was overwhelmed with Helm Charts at because they offer page after page of configurable code, but discovered that most of the variables could be left on the default setting and work well. Helm is a package manager for Kubernetes.
As is, the Kubernetes plug-in for Jenkins eases management of slave pools under independent, persistent masters, but there isn't an easy way to use the plug-in to create ephemeral master/slave clusters on the fly. Open source Jenkins users must also manage multiple masters individually whether they use Jenkins on Kubernetes or not, Hubbard said, and be comfortable doing so through a command-line interface.
Jenkins and Kubernetes to-do list
Some of the features Hubbard described are the domain of CloudBees Core, a commercial product based on Jenkins technology. CloudBees Core added Kubernetes support in early 2018 to its distributed pipeline architecture, which was previously based on Docker and Mesos for container orchestration. CloudBees Core is also the only way to centrally manage multiple Jenkins masters through a UI, and that's unlikely to change.
Hubbard, a Jenkins contributor, is comfortable with command-line tools, but said her company might consider CloudBees Core if it deploys Jenkins on Kubernetes in production.
Mandy Hubbardsoftware engineer and QA architect, CS Disco
"Ephemeral masters would make a UI more important, to keep track of resources and make records of them for governance," she said in an interview after her conference session.
Meanwhile, other projects are afoot that deepen the integration between open source Jenkins and Kubernetes in terms of application deployment. Jenkins X, released in spring 2018, automates Jenkins-based continuous application delivery to Kubernetes container infrastructures. Jenkins X, and a limited-availability Jenkins X-based CloudBees product, Kube CD, automatically package code into container images, create container-based application builds, promote container images through continuous integration tests, ship them to a container registry and facilitate their deployment to production Kubernetes clusters.
Jenkins X is focused on web application deployment to Kubernetes clusters, but the work that's been done on that project will inform the work of a Cloud Native special interest group formed last month, which will shore up how Jenkins runs on Kubernetes infrastructure.
"Cloud Native Jenkins is [the] name given to this new form of Jenkins that runs well on Kubernetes," said Kohsuke Kawaguchi, CloudBees CTO and Jenkins community leader, in an email interview. "What we hope to improve in this effort that's not addressed in current Jenkins is (1) Jenkins as [a] highly available distributed application on Kubernetes, (2) [a] build engine [in] serverless/function-as-a-service style, and (3) [support for Jenkins] data on cloud-native storage."
Cloud-native storage for Jenkins to supplant its filesystem architecture is already in development, and Jenkins data can now be stored in the public cloud as AWS Simple Storage Service objects, Kawaguchi said in a keynote presentation here. The other features remain on the roadmap.