Difficulty: intermediate
Estimated Time: 15-20 minutes

Digital Academy Logo

Welcome to the Digial Academy's "Kubernetes Fundamentals" series. This is Module 6 - CI/CD pipeline with Jenkins and Kubernetes.

In this lab, we will learn learn how to run a simple CI/CD pipeline with Jenkins and Kubernetes.

Jenkins

Jenkins is an open source automation server written in Java. Jenkins helps to automate the non-human part of the software development process, with continuous integration and facilitating technical aspects of continuous delivery.

The following topics will be covered:

  • Install and configure Jenkins from Helm chart
  • Demonstrating Kubernetes plugin for Jenkins
  • Build, deploy and run container from Jenkinsfile
  • Update container with canary deployment

Note: Canary release is a technique to reduce the risk of introducing a new software version in production by rolling out the change to a subset of users before the entire infrastructure.

Developer(s): William Hearn and Zachary Seguin

Congratulations, you have now completed all of Kubernetes Fundamentals 2.

You now have a rough understanding of a relatively simple CI/CD pipeline using Jenkins and Kubernetes.

Note: The use of Jenkins was just as an example there are a range of tooling available such as:

  • Azure DevOps
  • Drone
  • GitLab Runner
  • CodeFresh
  • etc

References

Acknowledgments

Module 6 - CI/CD pipeline with Jenkins and Kubernetes

Step 1 of 4

Kubernetes Cluster

As you see, your Kubernetes cluster is started. Verify it's ready for your use.

kubectl version && kubectl cluster-info && kubectl get nodes

Verify the Kubernetes cluster is empty.

kubectl get deployments,pods,services

The Helm package manager used for installing applications on Kubernetes is also available.

helm version

Kubernetes Dashboard

As an administrator, you can control the cluster with the kubectl CLI tool. You can also use the Kubernetes Dashboard. Because the dashboard can be accessed publicly, it is protected and requires the secret access token to sign in. Because you have administration access to this cluster, copy the token from this secret.

echo -e "\n--- Copy and paste this token for dashboard access ---" && kubectl describe secret $(kubectl get secret | awk '/^dashboard-token-/{print $1}') | awk '$1=="token:"{print $2}' && echo "---"

To access the dashboard, click on the Kubernetes Dashboard tab above the command line or from this link: https://[[HOST_SUBDOMAIN]]-30000-[[KATACODA_HOST]].environments.katacoda.com/. At the sign in prompt select Token and paste in the token, you copied a moment ago.