Skip to content

Setting up jenkins on a microk8s with configuration-as-code

Notifications You must be signed in to change notification settings

hansso90/Jenkins-in-microk8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins on K8s

Jenkins on microk8s:

Deploy jenkins on microk8s

  1. we want to see what we are doing, so spin up the dashboard
microk8s.enable dns dashboard
microk8s.kubectl proxy

now serving to http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy

  1. We trying to push or own docker images so we need a registry
microk8s.enable registry
  1. Build de images en push them to the registry:
# Build images en push to registry of microk8s
microk8s.docker build -t localhost:32000/jenkins:1.0 jenkins
microk8s.docker push localhost:32000/jenkins:1.0

microk8s.docker build -t localhost:32000/jenkins-slave:1.0 jenkins-slave
microk8s.docker push localhost:32000/jenkins-slave:1.0
  1. spin up jenkins deployment:
microk8s.kubectl apply -f ./jenkins/jenkins-serviceaccount.yaml
microk8s.kubectl apply -f ./jenkins/jenkins-config.yaml
microk8s.kubectl apply -f ./jenkins/jenkins-deployment.yaml

After deploying on k8s, port-forward jenkins to your system.

microk8s.kubectl port-forward svc/jenkins 9000

With http://localhost:9000 you could connect to jenkins

search for ip adresses for configuration

Setup k8s on jenkins in configure system

# get service ip van kubernetes
microk8s.kubectl cluster-info | grep master #e.g. local-ip:8080

# search for the ip from pod `jenkins`
microk8s.kubectl get pods | grep jenkins #e.g. jenkins-5fdbf5d7c5-dj2rq
microk8s. kubectl describe pod jenkins-5fdbf5d7c5-dj2rq #e.g. 10.1.1.117:8080

add new cloud:

About

Setting up jenkins on a microk8s with configuration-as-code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published