In this project I have deployed simple java based application into Kubernetes (EKS) Deployment consist of 6 pods using Jenkins pipeline. Below tools are integrated with this pipeline:
- Git: Application code repository
- Maven: To build code into package and create artifact
- Nexus: Backup repository for release candidate and artifact
- Docker: To build docker image and push to docker hub repository
- Kubernetes (EKS): To deploy application into K8S deployment consist of 6 pods
1.Create total 2 EC2 instances of Amazon Linux with t2.medium
2.On 1st server:
- Install jenkins (with java 17)
- Configure jenkins
- Install Git
- Install maven (with java 11)
- Install Docker and add jenkins user in docker group. Also modify permission for docker.sock file. This will allow to run docker command in jenkins shell
- Install Kubectl CLI
- Configure IAM user in Jenkins shell. Same IAM user need to be used to create EKS cluster
3.On 2rd server:
- Install nexus with java 11
- Configure nexus
4.Create EKS Cluster and Node groups with 2 worker nodes
5.On 1st server, switch to jenkins shell and get kubernetes config file using below command
aws eks update-kubeconfig --region {REGION} --name {EKS_CLUSTER_NAME}
7.On Github modify pom.xml for Nexus and Deployment.yaml for K8S as per docker image name