Setup Jenkins with JCasc on top Kubernetes
Requirements and tested on these versions:
- Minikube(v1.1.1)
- Virtualbox or KVM
- Kubectl(v1.11.7)
- Helm(v2.11.0)
-
Follow this official guide to deploy Minikube locally https://kubernetes.io/docs/tasks/tools/install-minikube/
-
minikube start --cpus 2 --memory 4000
-
After up and running you can find the kubeconfig file in ~/.kube/config
-
minikube status
make sure all components are up and runningClone the repo
git clone https://github.com/janavenkat/jenkin.git
cd jenkin
-
Install tiller in minikube by following this command
helm init
-
Install helm jenkins chart
helm install --name jenkins jenkins/.
-
To get minikube IP
minikube ip
-
Wait for until jenkins pod up and running
kubectl get pods
-
Get the nodeport for jenkins to access it from browser
kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services jenkins
-
Enter your minikube ip with port example
http://192.168.99.100:31995
-
Get credentials for jenkins.
username:
admin
to get the password execute this command
printf $(kubectl get secret --namespace default jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
-
After successfully logged-in have to approve our script to run our job
Go to Manage Jenkins
Now search for in process script approval need to approve the script in order to run our job
-
Now it's time to run the job
-
After successfull job run, pipeline view
#Information
Local Helm chart is pre-configured with JCasc job and dependencies and also for the job project configure from this repo https://github.com/mendix/pluggable-widgets-typing-generator
the workers are dynamically created on-demand in kubernetes as a pod
All changes for this deployment are in jenkins/values.yaml
- Changes for minikube deployment
Line 93 in 213245f
- JcasC changes
Line 206 in 213245f
- Pipeline job configuration
Line 234 in 213245f
#Additional one deployed on GKE k8's
Password is encrypted like kubernetes secret you know how to use :) it