Automated Deployment of a AWS EKS cluster with EFS CSI driver pre-configured for jenkins deployment on the EKS cluster.
- In the terraform folder run
terraform init
- Modify the custom.tfvars.TEMPLATE file to your liking and then rename to
custom.tfvars
- Then run
terraform apply --var-file="custom.tfvars"
this will take about 25min to deploy - Open
cluster-efs-pv.yaml
and apply the access-point-id, and efs-file-system-id like the example in the yaml file. - Once terraform has deployed the cluster you will need to update your Kubernetes context by using
aws eks --region us-east-1 update-kubeconfig --name jenkins_playground
- Check that the Kubernetes service is running
kubectl get svc
- Deploy the Amazon EFS CSI driver
kubectl apply -k "github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master"
- Next cd into the k8s folder
cd ../k8s/jenkins-pv
- Now run the pv yaml's
kubectl apply -f .\cluster-efs-claim.yaml,.\cluster-efs-pv.yaml,.\cluster-efs-sc.yaml
- Check that they are running
kubectl get sc,pv,pvc
- Update helm repo to stable
helm repo add stable https://charts.helm.sh/stable
- Install jenkins to the cluster
helm install jenkins stable/jenkins --set rbac.create=true,master.servicePort=80,master.serviceType=LoadBalancer,persistence.existingClaim=efs-claim
- Get external IP for jenkins
kubectl get svc jenkins
kubectl delete svc jenkins
kubectl delete -f .\cluster-efs-claim.yaml,.\cluster-efs-pv.yaml,.\cluster-efs-sc.yaml
cd ..\..\terraform\
terraform destroy