K8s Yaml for deploying Jenkins over Kubernetes as a statefulset
Note: Change the storage class to yours --> storageClassName: nfs-client
- Deploy Jenkins
This deploys Jenkins in the jenkins
namespace
kubectl apply -f jenkins.yml
- Create Ingress resource for Jenkins
Modify it to match your needs & ingress controller
kubectl apply -f jenkins-ingress.yml
- Create Service account to give Jenkins permissions on the build namespace.
kubectl apply -f sa-jenkins-build.yml
Optionally
- Create service account to give pods running in the build namespace permissions to create & manage resources in staging & prod namespaces
kubectl apply -f sa-build-staging-and-prod.yml
Thats it.