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.
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.
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