Deployment template is a tool that quickly sets up CI/CD integration with your Kubernetes cluster.
- Install kubectl cli
- Provision a Kubernetes cluster
- Install
helmcli - Create access tokens for git repository and container registry
- Create a namespace to deploy your Jenkins release to
kubectl create namespace jenkins
- Provision a persistent volume resource and a persistent volume claim resource so that the Jenkins service can have persistent data.
kubectl apply -f pv-volume.yaml
- Provision the persistent volume claim for Jenkins
kubectl apply -f pv-claim.yaml
- Using
helmand the values file injeknins/values.yaml, deploy a release of the Jenkins chart onto your cluster
helm install jenkins stable/jenkins -f values.yaml --namespace jenkins
- Access the Jenkins UI
. helpers/jenkins-ui.sh
helm upgrade jenkins stable/jenkins -f values.yaml --atomic --timeout 1m45s --install --namespace jenkins
- Add Git repo access token
kubectl apply -f git-credentials.yaml
- Add container registry access token
kubectl apply -f cr-credentials.yaml
- Add container registry configuration
kubectl apply -f cr-configmap.yaml
- Deploy the Kubernetes dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
- Deploy the secrets required to access the dashboard
kubectl apply -f dashboard-adminuser.yaml
- Access dashboard
. helpers/dashboard-ui.sh
- add git credentials as secrets
- add icr credentials as secrets
- k apply -f jenkins/icr-configmap.yaml
k --namespace dev create secret docker-registry container-registry --docker-server=us.icr.io --docker-username=iamapikey --docker-password=<apikey> --docker-email=a@b.c
kubectl get secret <secret_name> --namespace=default --export -o yaml |\
kubectl apply --namespace=<new_namespace> -f -