Kubernetes: Jenkins

If you wish to use your own namespace for this installation, be sure to replace itsmetommy with your own.

Create namespace

kubectl create ns itsmetommy

Clone git repository

git clone https://github.com/itsmetommy/kubernetes-jenkins.git


kubectl apply -f .
service/jenkins-master created
statefulset.apps/jenkins-master created


Method 1

It should be the first URL.

minikube -n itsmetommy service jenkins-master --url

Method 2

# view service
kubectl -n itsmetommy get services jenkins-master NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE jenkins-master NodePort 8080:31147/TCP,50000:30011/TCP 7m

# view minikube ip
minikube ip

Open browser

You should see the unlock screen.


Method 1

Get the logs from the pod.

kubectl -n itsmetommy logs jenkins-master-0
Jenkins initial setup is required. An admin user has been created and a password generated.

Please use the following password to proceed to installation:


This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

Method 2

cat the file from the pod.

kubectl -n itsmetommy exec jenkins-master-0 -- cat /var/jenkins_home/secrets/initialAdminPassword

Clean up

kubectl delete -f .
service "jenkins-master" deleted
statefulset.apps "jenkins-master" deleted

Delete pvc

kubectl -n itsmetommy delete pvc jenkins-master-home-jenkins-master-0
persistentvolumeclaim "jenkins-master-home-jenkins-master-0" deleted