Advanced End-to-End Kubernetes DevSecOps Project
Advanced End-to-End Kubernetes DevSecOps Project
Step1: create an ec2 instance and install docker, Jenkins, docker, terraform, kubectl, awscli, trivy,
eksctl using user-data.
You will see a page asking for the initial admin password. Retrieve it using:
Enter the password, install suggested plugins, and create your first admin user.
Goto plugins and install AWS Credentials , AWS Steps and Terraform
Step 3: Create Access key and Secret key for IAM user with Administrator access and Add those
credentials in Jenkins credentials
Step4: Install terraform in Jenkins
https://github.com/Madeep9347/EKS-Terraform-GitHub-Actions/blob/master/Jenkinsfile
edit the backend configuration with your s3 bucket name and dynamo table
Step 6: Create an instance ( Jump server) in the vpc created by Terraform and install the eksctl ,
awscli, kubectl, helm.
Step 9: Now, we will configure the Load Balancer on our EKS because our application will have an
ingress controller.
curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-
controller/v2.5.4/docs/install/iam_policy.json
Step 10: Create the IAM policy using the below command
Step 11: Create a Service Account by using below command and replace your account ID with your
one
Step 12: Run the below command to deploy the AWS Load Balancer Controller
After 2 minutes, run the command below to check whether your pods are running or not.
Step 15: Now access the Argocd with loadbalancer dns name
We are running the sonarqube in the port 9000 and use the same Jenkins ip address
Access SonarQube:
Copy the token and add this token in the Jenkins credentials
Step3: create the projects for frontend and backend
Click on setup and select manually and use the generated token
Step 5: Create the ECR repositories
Click on create repository → choose the private repo and enter the repository.
And also add the GitHub credentials and Personal Access Token (PAT) in the Jenkins Credentials.
Jenkinsfile: https://github.com/Madeep9347/End-to-End-Kubernetes-Three-Tier-DevSecOps-
Project/blob/master/Jenkins-Pipeline-Code/Jenkinsfile-Frontend
Step 10 : Create the Jenkins job for Backend Application
We will be deploying our application on a three-tier namespace. To do that, we will create a three-
tier namespace on EKS.
these command will create all the required pods and services of the argocd server in the argocd
namespace.
Now, expose the argoCD server as LoadBalancer using the below command:
You can validate whether the Load Balancer is created or not by going to the AWS Console:
To access the argoCD, copy the LoadBalancer DNS and hit on your favorite browser.
You will get a warning like Your connection is not private then Click on Advanced.
Now, we need to get the password for our argoCD server to perform the deployment.
Enter the username (admin) and password in argoCD and click on SIGN IN.
Now we need to add the Github Repository to the argocd by going to the setting.
Go to the settings add the repo using the connect repo using the HTTPS and add the github
repository URL.
And Click on connect then the repo will be connected to the argocd:
Step 13:Now create the separate apps for Frontend, Backend, Database and the ingress manifest
files:
Create these apps same for the Backend, Database and Ingress.
This is the Frontend Application Deployment in ArgoCD:
If you observe, we have configured the Persistent Volume & Persistent Volume Claim. So, if the pods
get deleted then, the data won’t be lost. The Data will be stored on the host machine.
Step 14:To ensure all the pods and the service are running are not check in the eks cluster using
command:
Step 16: Create the DNS record for ingress-controller load balancer
Step 17: Wait for 2-3 minutes and Access the Application using the Domain name
Step 3: Now, we need to access our Prometheus and Grafana consoles from outside of the cluster.
For that, we need to change the Service type from ClusterType to LoadBalancer