Setting up the Kubernetes Plugin on Jenkins Setting up the Kubernetes Plugin on Jenkins kubernetes kubernetes

Setting up the Kubernetes Plugin on Jenkins


You'll need to tell Jenkins how and where to run your builds by adding your Kubernetes cluster as a 'cloud' in the Jenkins configuration. Go to Manage Jenkins -> Configure System -> Cloud -> Add new cloud and select 'Kubernetes'. You'll find the server certificate key, user name and password in your local kubectl configuration (usually in ~/.kube/config). The values for 'Kubernetes URL' and 'Jenkins URL' depend on your cluster setup.

Next, you'll need to configure the docker images that should be used to run your builds by selecting 'Add Docker Template'. Use labels to define which tasks should be run with which image!

Here's a good video tutorial and here you'll find a nice tutorial which explains everything in detail.


The important bit after you've installed the plugin, set up access to your Kubernetes cluster, and set up your first Kubernetes Pod Template with a label like jnlp-slave, is that in your Jenkinsfile you need to begin with something like node('jnlp-slave') {}. Then the pod will be started when you trigger a build.


There's also a helm chart for easy deployment if that helps :)

This example might also help once you've set the plugin up too.