X
  • November 7, 2018

X Marks the Spot: Cloud Native CI/CD with Jenkins X

Mickey Boxell
Product Management

Overview

A rapid pace of product and feature delivery is key to companies remaining competitive in the market. This need has led to a paradigm shift in the software industry: a move from traditional development practices to agile DevOps and the adoption of Continuous Integration and Continuous Deployment (CI/CD). DevOps provides a strong relationship between development and IT operations teams. Continuous Integration encourages development teams to check in code to a centralized version control repository and iterate frequently with small changes. Continuous Deployment consists of running code changes through a series automated tests in before packaging up and promoting successful builds to production. These philosophies have enabled the building, testing, and release of software to come faster and more reliably.

A lot can be said about this new model, but for the purpose of this article I will be focusing on how it is applied to cloud native development. One major component of cloud native development is the adoption of a microservice framework. This framework encourages developers to breakup monolithic applications into decoupled services based on specific functions. This is accomplished through the use of containers. Containers are isolated software packages that include system tools, libraries, and settings or configuration files. They have the potential to be very lightweight because they are run with a single operating system kernel. Their lightweight nature makes them essential to the microservice paradigm. The challenge of microservices and containers is managing and developing on environments with so many moving parts. Existing build and deploy technologies have had to keep pace with the shift to containerization and an increase in the frequency of releases in order to stay relevant and useful.

Solution

The container orchestration tool Kubernetes addresses many of the issues of managing complex container environments. Over the past few years it has become the standard for doing so at scale. But what CI/CD tool pairs well with it? A good place to start looking is Jenkins, the leading open source software development automation solution. Jenkins is capable of performing most if not all of the technical aspects of the CI/CD space. The challenge is that the tool was not originally designed with containerized environments in mind and that it is almost too flexible. There are a glut of plugins and configurations to choose from for your jenkinsfile, which can be overwhelming for new users or developers looking for a cloud native or container native solution. Fortunately, the makers of Jenkins released cloud-based version of their tool with automation specifically designed for Kubernetes environments.

Their solution, Jenkins X, is an open source, opinionated version of Jenkins designed to run on Kubernetes. If you are already familiar with Jenkins, Jenkins X provides a familiar tool for you to use. If you use another CI/CD tool or are new to the space, the simplified installation of Jenkins X, will give you a good jumping off point from which to explore cloud native development. The tool is pre-configured with runners to build your code for almost any language, such as Go, Javascript, and Java. This is a must-have in a polyglot, multi-service cloud native environment.

What Does It Do?

Jenkins X provides a drastically simplified installation process in which each component of Jenkins is installed as its own pod in a cluster. When it comes time to deploy, rather than spending your time on packaging software as Docker images and writing Kubernetes manifest files, you can rely on ready-made configurations to build and deploy containers across several common software languages. Rather than having to manually configure a git repository yourself, running jx create will create a staging and production git repository for your project in Github, register a Webhook to capture git push events, and create a Helm chart for your project. Each change to your code will be automatically built and deployed onto Kubernetes. You can easily test in the same environment you will deploy to in production. Configuring all of this manually is time consuming, challenging, and ultimately a distraction from writing code.

Some of the useful components of Jenkins X include the jx CLI tool, automated CI/CD pipelines, and GitOps. The jx CLI can be used to create projects from templates, such as Spring Boot applications, quickstart projects, and existing source code. This tool can also be used to provision Kubernetes clusters on supported cloud environments, tail logs of applications running in Kubernetes, open remote shells into any pod containers, import existing applications, start builds, and a host of other helpful activities. The pipelines that Jenkins X creates for you are cloud native in mind. They come complete with a jenkinsfile which builds your code in a container, a dockerfile to package up your application, and a Helm chart to deploy your application to Kubernetes. If you are an experienced Jenkins user, all of those files are available to be further customized. Jenkins X also supports GitOps, a methodology in which changes to code made in git are automatically rolled out to your infrastructure via delivery pipelines. Staging and production environments are also created for you out of the box and it is easy to add additional environments as well.

Installation

To use Jenkins X, download the latest release from the official GitHub page and run jx install.

For a more detailed walkthrough of how to install Jenkins X on Oracle Container Engine for Kubernetes and how to connect to the Oracle Registry check out this guide.

Conclusion

Jenkins X is a good choice both for people looking to lift and shift their existing Jenkins server to Kubernetes and those just getting started with cloud native development. The opinionated nature of the service, the comprehensive CLI tool, and the out of the box support for numerous quickstart templates make it easy to begin the journey to cloud native development. Once you have a process to start testing, building, and deploying your code to the cloud you can start experimenting and iterating to find out what practices best suit your development needs.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.