Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Orchestrating Deployments with Jenkins Workflow and Kubernetes

DZone's Guide to

Orchestrating Deployments with Jenkins Workflow and Kubernetes

An introduction to Jenkins Workflow to allow administrators to launch and configure Docker containers with Kubernetes and Google Cloud.

· DevOps Zone
Free Resource

Download your copy of Continuous Delivery with Jenkins and learn how you can deliver better, software faster. Brought to you in partnership with CloudBees.

In a previous series of blogs, we covered how to use Docker with Jenkins to achieve true continuous delivery and improve existing pipelines in Jenkins. While deployments of single Docker containers were supported with this initial integration, the CloudBees team and Jenkins community’s most recent work on Jenkins Workflow will also let administrators launch and configure clustered Docker containers with Kubernetes and the Google Cloud Platform.

What is Workflow?

Jenkins Workflow is a new plugin which allows Jenkins to treat continuous delivery as a first class job type in Jenkins. Workflow allows users to define workflow processes in a single place, avoiding the need to coordinate flows across multiple build jobs. This can be particularly important in complex enterprise environments, where work, releases and dependencies must be coordinated across teams. Workflows are defined as a Groovy script either within a Workflow job or checked into the workspace from an external repository like Git.

In a nutshell, the CloudBees Docker Workflow plugin adds a special entry point named Docker that can be used in any Workflow Groovy script. It offers a number of functions for creating and using Docker images and containers, which in turn can be used to package and deploy applications or as build environments for Jenkins.

Broadly speaking, there are two areas of functionality: using Docker images of your own or created by the worldwide community to simplify build automation; and creating and testing new images. Some projects will need both aspects and you can follow along with a complete project that does use both: see the demonstration guide .

Jenkins Workflow Deployments with Kubernetes As mentioned in the previous blog, the Google Cloud Platform also supports pushing Docker images to the Google Container Registry and deploying them to the Google Container Engine with Kubernetes.

Jenkins Workflow now also supports using the Google Cloud Platform’s Container Registry as a Docker image registry. Additionally, it also exposes a few new Kubernetes and Google Cloud Platform-specific steps to complement Workflow’s existing Docker features. These steps allow Jenkins to securely connect to a given Kubernetes cluster, as well as remotely instruct the Kubernetes cluster manager to launch a given Docker image as a container in a Kubernetes Pod, change existing settings like the target cluster or context, and set the target number of replicas in a cluster.

Where Do I Start?

  1. The Workflow plugin is an open-source plugin, so it is available for download from the open-source update center or packaged as part of the CloudBees Jenkins Platform.
  2. The CloudBees Docker Workflow plugin is another open-source plugin available in the OSS update center or as part of the CloudBees Jenkins Platform.
  3. The Google Cloud Registry Auth plugin is an open-source plugin developed by Google, so it available to download from the open source update center or packaged as part of the CloudBees Jenkins Platform.
  4. The Kubernetes plugin is another open-source plugin  available from the open-source update center or packaged as part of the CloudBees Jenkins Platform.
  5. The Google Container Engine offers a free trial.
  6. The Google Container Registry is a free service.
  7. Other plugins complement and enhance the ways Docker can be used with Jenkins. Read more about their uses cases in these blogs:
    1. Docker Build and Publish Plugin
    2. Docker Slaves with the CloudBees Jenkins Platform
    3. Jenkins Docker Workflow DSL
    4. Docker Traceability
    5. Docker Hub Trigger Plugin
    6. Docker Custom Build Environment plugin

Discover how Docker, Jenkins and DevOps are coming together to accelerate innovation. Brought to you in partnership with CloudBees.

Topics:
docker ,kubernetes ,jenkins ,devops ,deployment ,orchestration

Published at DZone with permission of Tracy Kennedy, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}