This is an example setup to run Jenkins.
- In jenkins build docker image of app
- pull branch
- build image in jenkins worker.
- rely on image being available in local docker registry
- Launch deployer job to build new customization configs
- pass in url to configs
- pass in images name
- pass in options for environment that need to overridden
- Apply configs to cluster to test namespace.
- Launch test job to test namespace, wait for job to finish.
- When job is finished clean up namespace.
- If test passed push image up to docker hub
- Notify user of build and test results.
These are the dependencies this project has. Sorry not everything will have a link
- Kind
- Kubectl
- docker
This jenkins example was built around building and deploying this sample project.
kind create cluster --name=test-env
kubectl create ns jenkins
kubectl config set-context --current --namespace=jenkins
kubectl apply -k kubernetes
kubectl port-forward service/jenkins 8080:8080 -n jenkins
Find the pod name using kubectl get pods
. It will be prefixed with jenkins
.
For example my pods name was jenkins-5c497b9b-t57s2
. Replace my pod id with yours.
kubectl exec -it jenkins-5c497b9b-t57s2 -c jenkins bash
Main Source: https://www.youtube.com/watch?v=eRWIJGF3Y2g