Pipeline to do deployment on EKS cluster using jenkins, based on the envornment selected.
Assumptions :
You have already eks cluster and jenkins installed. On jenkins server install git, kubectl .
[root@ip-172-31-24-61 eks-deploy]# cp /root/bin/kubectl /usr/bin [root@ip-172-31-24-61 eks-deploy]# cp /root/bin/kubectl /usr/local//bin
Create a role using which ec2 instance can generate the kubeconfig file of eks cluster and assing it to jenkins server.
Create new job "eks-deploy" of the type pieline.
Make this job as a parametrized and add two parameter "environment and aws-region" Depending on the envirnment and region we can select the cluster.
Now past the jenkinsfile code in pipeline and save it.
And build the job with parameter.
And check the output in console section.
Have attach output in console.log section.