Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.49 KB

README.md

File metadata and controls

41 lines (30 loc) · 1.49 KB

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