3-tier-project-ci--jenkins-cd--argocd-with mysqlrds (1)
3-tier-project-ci--jenkins-cd--argocd-with mysqlrds (1)
Project Overview:
Prerequisites
Here, you will see that you got the credentials and also you can
download the CSV file for the future.
htps://github.com/CloudTechDevOps/2nd10WeeksofCloudOps-
main/tree/main/terraform_main_ec2
Let’s Create the main server by using terraform, login into the Jenkins and
create the EKS by using Jenkins terraform.
After complete the creation jump host server, please check below
tools weather installed or not Note: Tools installation provision
enabled by using user data for same terraform script.
htps://github.com/CloudTechDevOps/2nd10WeeksofCloudOps-
main/tree/main/eks-terraform
Note: before keep it ready for EKS script we are going to run
EKS by using Jenkins pipeline
That is done now go to Jenkins and add a terraform plugin to provision the
AWS EKS using the Pipeline Job.
let’s find the path to our Terraform (we will use it in the tools section of
Terraform)
which terraform
Now in our EKS script we have configured backeen.tf (to maintain state file
remote(s3)
Choose option pipeline from SCM as our Jenkins script is already available in
GitHub
We have to give the path of the Jenkins file or you can copy paste script into
Jenkins pipeline editor.
let’s apply and save and Build with parameters and select action as apply
Jenkins-script:
pipeline {
agent any
parameters {
stages {
steps{
stage('Terraform version'){
steps{
sh 'terraform --version'
stage('Terraform init'){
steps{
dir('eks-terraform') {
stage('Terraform validate'){
steps{
dir('eks-terraform') {
sh 'terraform validate'
stage('Terraform plan'){
steps{
dir('eks-terraform') {
sh 'terraform plan'
stage('Terraform apply/destroy'){
steps{
dir('eks-terraform') {
Click on Generate
Click on Create
Provide the name of your project and in the URL, provide the
Jenkins server public IP with port 8080 add sonarqube-webhook in
the suffix, and click on Create.
http://<jenkins-server-public-ip>:8080/sonarqube-webhook/
Click on Manually.
Click on Locally.
After performing the above steps, you will get the command which
you can see in the below snippet.
Provide the name of your project name and click on Set up.
Click on Locally.
After performing the above steps, you will get the command which
you can see in the below snippet.
Now, use the command in the Jenkins Backend Pipeline where Code
Quality Analysis will be performed.
Select the kind as Secret text paste your token in Secret and keep
other things as it is.
Click on Create
Now, we have to store the GitHub Personal access token to push the
deployment file which will be modified in the pipeline itself for the
ECR image.
Aws & devops by veera nareshit
Aws & devops by veera nareshit
Select the kind as Secret text and paste your GitHub Personal
access token(not password) in Secret and keep other things as it is.
Click on Create
Select the kind as Secret text paste your AWS Account ID in Secret
and keep other things as it is.
Click on Create
Now, we need to provide our ECR image name for frontend which
is frontend only.
Select the kind as Secret text paste your frontend repo name in
Secret and keep other things as it is.
Click on Create
Now, we need to provide our ECR image name for the backend
which is backend only.
Select the kind as Secret text, paste your backend repo name in
Secret, and keep other things as it is.
Click on Create
Docker
Docker Commons
Docker Pipeline
Docker API
docker-build-step
Eclipse Temurin installer
NodeJS
OWASP Dependency-Check
SonarQube Scanner
Search for jdk and provide the configuration like the below snippet.
Search for the sonarqube scanner and provide the configuration like
the below snippet.
Search for node and provide the configuration like the below
snippet.
Search for docker and provide the configuration like the below
snippet.
Provide the name as it is, then in the Server URL copy the sonarqube
public IP (same as Jenkins) with port 9000 select the sonar token
that we have added recently, and click on Apply & Save.
Copy the 1st command for login and past it on jumphost server
Open your git forke project edit config.js file here place your domain name my end
api.narni.co.in,, for example your end api.xyz.com. don’t remove api because we call this
api in route53 record creation time.
After making these changes our frontend of the application will send all the API
calls on the domain name https://api.narni.co.in And lastly, that will point to
our backend server.
Go to Jenkins Dashboard
FRONTEND
htps://github.com/CloudTechDevOps/2nd10WeeksofCloudOps-
main/blob/main/Jenkins-Pipeline-Code/Jenkinsfile-Frontend
OUTPUT
BACKEND
htps://github.com/CloudTechDevOps/fpjt/blob/main/Jenkins-
Pipeline-Code/Jenkinsfile-Backend
ArgoCD
To access the argoCD, copy the LoadBalancer DNS and hit on your
favorite browser.
Click on Advanced.
Now, we need to get the password for our argoCD server to perform
the deployment.
• You need to run the below command to get the value of the
secret.
Step-1. We need to add the Helm Stable Charts for your local client.
Execute the below command:
Insstall prometheus
successfully
there is no need of installing Grafana as a separate tool it comes
along with Prometheus
2. through LoadBalancer
you guys can see I have a load balancer for my Prometheus which I
can access from that link
let’s change the SVC file of the Grafana and expose it to the
outer world
use the link of the LoadBalancer and access from the Browser
3. Pod up history
4. HPA
5. Resources by Container
This is optional
Now, provide the repository name where your Manifests files are
present.
Provide the username and GitHub Personal Access token and click
on CONNECT.
After that you need to change the the rds end point in secrets.yaml
file by using base encode 64 formate
Click on CREATE.
You can check out the load balancer named with k8s-three.
This is frontend ui
Here you will get front end page now wee need to ini�alize the database
ex:::::::mydetails::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
mysql -h book-rds.cru0eyk6ukru.us-east-1.rds.amazonaws.com -u admin -psrivardhan
ex:::::::mydetails::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
mysql -h book-rds.cru0eyk6ukru.us-east-1.rds.amazonaws.com -u admin -psrivardhan test < test.sql
Then hit with frontend load balancer url you will get books then add the books