How to setup Jenkins on Minikube
Setting up Jenkins on Kubernetes is very efficient than setting it up on a local agent.
Hence, I have listed down steps to setup Jenkins on Minikube so that you get a good understanding of how Jenkins works on Kubernetes before you set it up on multi node clusters.
1. minikube config set memory 16384(If space is full or your total memory is only 16384 then set to lower, 8192)
2. minikube config set cpus 4
3. minikube config set kubernetes-version 1.16.0
4. minikube start --driver=virtualbox
5. Create a namespace yaml file:
4. minikube start --driver=virtualbox
5. Create a namespace yaml file:
jenkins-namespace.yaml
Contents:
apiVersion: v1
kind: Namespace
metadata:
name: jenkins
_________________________________________________
kubectl apply -f jenkins-namespace.yaml
6. Persistent volume :
jenkins-volume.yaml
kubectl apply -f jenkins-namespace.yaml
6. Persistent volume :
jenkins-volume.yaml
Contents:
apiVersion: v1
kind: PersistentVolume
metadata:
name: jenkins-pv
namespace: jenkins
spec:
storageClassName: jenkins-pv
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /data/jenkins-volume/
_________________________________________________kubectl apply -f jenkins-volume.yaml
7. helm repo add bitnami https://charts.bitnami.com/bitnami
8. helm install jenkins -f bitnami_values.yaml bitnami/jenkins --namespace jenkins --set serviceType=NodePort
9. kubectl get pods -n jenkins NAME READY STATUS RESTARTS AGE jenkins-759cb4547c-x9qwm 1/1 Running 0 18m
10. kubectl port-forward jenkins-759cb4547c-h8jbm 8088:8080 -n jenkins
11. Access Jenkins on http://127.0.0.1:8088/
12. Username : user
Password -
echo Password: $(kubectl get secret --namespace jenkins jenkins -o jsonpath="{.data.jenkins-password}" | base64 --decode)
Thats it ! Enjoy Jenkins on http://127.0.0.1:8088/ !
Comments
Post a Comment