samnoon1971 / jenkins-master-slave

Jenkins master slave-agent architecture using k8s

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jenkins Master Slave Helm Chart

A Jenkins master slave-agent architecture using k8s and helm

Badges

GPLv3 License AGPL License

Authors

Installation:

Run following command to create / update ingress controller:

helm upgrade --install ingress-nginx ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace

Run following command to install the Helm chart:

helm install jenkins-cicd .  

Post Installation:

  1. Run following command:

Windows:

set POD_NAME=$(kubectl get pods --namespace ingress-nginx -l "app.kubernetes.io/name=jenkins-msarch,app.kubernetes.io/instance=jenkins-cicd" -o jsonpath="{.items[0].metadata.name}")

Linux based OS:

EXPORT POD_NAME=$(kubectl get pods --namespace ingress-nginx -l "app.kubernetes.io/name=jenkins-msarch,app.kubernetes.io/instance=jenkins-cicd" -o jsonpath="{.items[0].metadata.name}")
  1. Run Following command:

Windows:

set CONTAINER_PORT=$(kubectl get pod --namespace ingress-nginx $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")

Linux based OS:

EXPORT CONTAINER_PORT=$(kubectl get pod --namespace ingress-nginx $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
  1. Update hosts file by browsing to C:\Windows\System32\drivers\etc\hosts for Windows and /etc/hosts for Linux systems, and add following lines to hosts file:
127.0.0.1 jenkins.master.local
127.0.0.1 jenkins.slave1.local
127.0.0.1 jenkins.slave2.local

Note: You must replace 127.0.0.1 with the host IP of your environment.

Optional, but not recommended to expose Pods

  1. To forward a local port to Jenkins GUI port (8080) on a Pod, get the pods by running following command:
kubectl get pods -l app.kubernetes.io/name=jenkins-msarch  --namespace ingress-nginx

Then type following command replacing POD_ID and HOST_PORT for any of the pods:

kubectl --namespace ingress-nginx port-forward POD_ID HOST_PORT:8080

example usage:

kubectl --namespace ingress-nginx port-forward jenkins-cicd-jenkins-msarch-6cd98fbdf4-hffmd 8082:8080

Support

For support, email samnoonabrar@gmail.com

Also, read the official Helm documentation and K8s documentation for additional information.

Feedback

If you have any feedback, please reach out to us at samnoonabrar@gmail.com

About

Jenkins master slave-agent architecture using k8s

License:Creative Commons Zero v1.0 Universal


Languages

Language:Smarty 100.0%