- Contributors
- AWS URLs
- Installation and Setup
- Kubernetes Ingress with Nginx Controller
- Helm Chart and Argo CD
- Nimit Jogani (G01379296)
- Sourav Singh (G01390520)
- Divyansh Joshi (G01399172)
- AWS account with appropriate permissions to create EC2 instances.
- EC2 instance running with a compatible Linux distribution (e.g., Ubuntu 20.04 LTS).
-
SSH into your EC2 Instance:
ssh -i /path/to/your-key.pem ec2-user@ec2-instance-public-ip
-
Install Docker
sudo apt-get update sudo apt-get install -y docker.io
-
Install Rancher
sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
-Access Rancher Web UI using your EC2 instance's public IP address.
-Follow Rancher's on-screen instructions to set up the custom Kubernetes cluster.
-After the cluster is set up, ensure it is in a healthy state before proceeding to the next step.
This guide will walk you through setting up Jenkins on an AWS EC2 instance, establishing a CI/CD pipeline using a Jenkinsfile and Dockerfile, and integrating the pipeline with a Git repository.
-
Install Jenkins on AWS EC2 Instance
ssh -i /path/to/your-key.pem ec2-user@ec2-instance-public-ip sudo apt-get update sudo apt-get install -y openjdk-11-jdk wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get update sudo apt-get install -y jenkins sudo systemctl start jenkins
-
Retrieve the initial admin password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
-
Create Dockerfile
-
Create Jenkinsfile
-
Integrate with Git Repository
-
Trigger the Pipeline
1. Acquire Domain Name: Obtain a domain name from a reputable domain registrar to access the deployed applications via the internet.
2. DNS Configuration: Create a hosted zone in AWS Route 53 and configure the DNS settings to link the acquired domain name to the hosted zone.
3. Ingress Object Creation: Develop an Ingress manifest file specifying routing rules that map the domain name to the relevant services within the Kubernetes cluster.
4. Deploy Hello-World Application: Deploy a containerized Nginx web server serving a basic web page in a namespace named nginx.
5. Ingress Updation: Ensure the Ingress object routes traffic to the Survey API Service and the Hello-World Application.
- Verify the accessibility of both the survey API and the hello-world application by navigating to the configured DNS name. Ensure the routing rules in the Ingress object correctly forward traffic to the respective Kubernetes services.
1. Create a New EC2 Instance and Set Up a New Cluster: Follow the steps from the lecture slides to create a new cluster using Rancher command.
2. Install Helm: Use the helm create chart-name command to create necessary files and directories, then upload them to a new GitHub repository.
3. Install ArgoCD: Install ArgoCD on the new Kubernetes cluster in the argocd1 namespace.
4. Configure EC2 Security Group: Add necessary port numbers to access the ArgoCD application UI.
5. Create a New App in ArgoCD: Configure the app with the GitHub repository link, specifying the source and destination for the deployment.
6. Monitor Changes with ArgoCD: Ensure ArgoCD monitors any changes in the GitHub repository, maintaining synchronization between the desired and current state.
- Nimitkumar Jogani
- Sourav Singh
- Divyansh Joshi