Deploy Jenkins

Once Operator Service for Jenkins® is up and running let’s deploy actual Jenkins instance. Create manifest e.g. jenkins_instance.yaml with following data and save it on drive.

apiVersion: operator-service.com/v1beta1
kind: Jenkins
metadata:
  name: example
  namespace: default
spec:
  podSpec:
    containers:
      - name: jenkins-controller
        image: jenkins/jenkins:2.289.3-lts-alpine
        imagePullPolicy: IfNotPresent

Deploy a Jenkins to Kubernetes:

$ kubectl create -f jenkins_instance.yaml

Watch the Jenkins instance being created:

$ kubectl get pods -w

Get the Jenkins credentials:

$ kubectl get secret <cr_name>-credentials -o 'jsonpath={.data.user}' | base64 -d
$ kubectl get secret <cr_name>-credentials -o 'jsonpath={.data.password}' | base64 -d

Connect to the Jenkins instance (minikube):

$ minikube service <cr_name>-http --url

Connect to the Jenkins instance (actual Kubernetes cluster):

$ kubectl port-forward <cr_name> 8080:8080

Then open browser with address http://localhost:8080.

jenkins