Skip to content

samali0996/deployment-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

218 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deployment Template

Deployment template is a tool that quickly sets up CI/CD integration with your Kubernetes cluster.

Prerequisites

  • Install kubectl cli
  • Provision a Kubernetes cluster
  • Install helm cli
  • Create access tokens for git repository and container registry

Deploy Jenkins onto Cluster

  1. Create a namespace to deploy your Jenkins release to
kubectl create namespace jenkins
  1. 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
  1. Provision the persistent volume claim for Jenkins
kubectl apply -f pv-claim.yaml 
  1. Using helm and the values file in jeknins/values.yaml, deploy a release of the Jenkins chart onto your cluster
helm install jenkins stable/jenkins -f values.yaml --namespace jenkins
  1. Access the Jenkins UI
. helpers/jenkins-ui.sh 

Redeploy

helm upgrade jenkins stable/jenkins -f values.yaml  --atomic --timeout 1m45s --install --namespace jenkins

Set up Secrets and Config

  1. Add Git repo access token
kubectl apply -f git-credentials.yaml
  1. Add container registry access token
kubectl apply -f cr-credentials.yaml
  1. Add container registry configuration
kubectl apply -f cr-configmap.yaml

Deploy Kubernetes Dashboard (Optional)

  1. Deploy the Kubernetes dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
  1. Deploy the secrets required to access the dashboard
kubectl apply -f dashboard-adminuser.yaml
  1. 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

Copy secret from one namespace to another

kubectl get secret <secret_name> --namespace=default --export -o yaml |\
   kubectl apply --namespace=<new_namespace> -f - 

About

Deployment template is a tool that quickly sets up CI/CD integration with your Kubernetes cluster.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors