Skip to content

A simple CI/CD workflow for Jenkins to deploy code into a Kubernetes Cluster

Notifications You must be signed in to change notification settings

mfabriczy/kubernetes-jenkins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jenkins-kubernetes

This project builds a war and deploys it into a Kubernetes Cluster using the Pipeline Multibranch Plugin.

Deploys and updates a canary, production and development environment when pushing code through the Pipeline Multibranch job.

Setup

Add the Jenkins repository:

helm repo add jenkins https://charts.jenkins.io

In your Kubernetes cluster create a namespace called "jenkins":

kubectl create ns jenkins

Start a Jenkins instance using Helm:

helm install jenkins --values=jenkins-override-values.yml --namespace jenkins jenkins/jenkins

In your Kubernetes cluster create a namespace called "production":

kubectl create ns production

Create a Pipeline Multibranch job and link it to your repository.

Add your Docker Hub credentials to Jenkins via Jenkins credentials. The credential ID must be "docker-hub-credentials" - this is for pushing newly built Docker images.

Usage notes

If the repository has branches called "canary" or "master", Jenkins will deploy any newly pushed code into their respective environments. if a branch is named any other, Jenkins will create a new namespace and environment for that branch.

You can apply resource limits for a namespace by applying the dev_namespace_quota.yml resource quota:

kubectl create -f dev/dev-namespace-quota--namespace=myspace

About

A simple CI/CD workflow for Jenkins to deploy code into a Kubernetes Cluster

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published