Getting To Know K8s | Lab #7: Continuous Deployment with Jenkins and Kubernetes
This post was updated on September 18th, 2017 for Kubernetes version 1.7.6 & Kops version 1.7.0
In the previous lab, we went through how to deploy Jenkins and integrate it with your Kubernetes cluster.
And in this lab, we will setup an example continuous deployment pipeline with Jenkins, using the same Hugo site that we have used in previous labs.
The four main stages of the pipeline that we will create are:
- Build: Build the Hugo site
- Test: Test the Hugo site to confirm there are no broken links
- Push: Create a new Docker image with the Hugo site and push it to your Docker Hub account
- Deploy: Trigger a rolling update to the new Docker image in your Kubernetes cluster
The configuration of the pipeline will be defined in a Jenkinsfile, which will be stored in your GitHub repository for the Hugo site.
And after configuring the GitHub plugin in Jenkins, the pipeline will be automatically triggered at every commit.