Skip to content

learnwithabhishek/argocd-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

argocd-project

Jenkins-Argocd-Pileline2

Docker image of vpro-app is built from cicd-Jenkins-Docker project and the latest image is used here to deploy on kubernetes cluster with Argocd. Argocd will maintain the state of deployment on kubernetes cluster and will use this repo as a single source of truth.

#Install awscli and configure it with IAM user of admin access.

sudo apt update

sudo apt install awscli -y

aws configure # (After that enter your user's access key id and secret access key)

#Install kubectl

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

#Install kops

curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64

chmod +x kops-linux-amd64

sudo mv kops-linux-amd64 /usr/local/bin/kops

#kops uses DNS for discovery, both inside the cluster and outside, so that you can reach the kubernetes API server from clients.

#Purchge a domain (ex. godaddy.com) then created a public hosted zone in aws Route53.

#In Godaddy created NS records for subdomain pointing to Route53 hosted zone NS servers.

#Created a S3 bucket to store the cluster's state.

#After completing all prerequisites create cluster using kops command

kops create cluster --name=k8.learnwithabhi.xyz --state=s3://mykopsbucketfork8 --zones=us-east-1a --node-count=1 --node-size=t3.small --master-size=t3.medium --dns-zone=k8.learnwithabhi.xyz --node-volume-size=8 --master-volume-size=8

kops update cluster --name k8.learnwithabhi.xyz --state=s3://mykopsbucketfork8 --yes --admin

kops validate cluster --state=s3://mykopsbucketfork8

Install Argocd

kubectl create namespace argocd

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Download & install Argocd Cli

curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64

sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd

rm argocd-linux-amd64

#To access argocd api-server change the argocd-server service type to LoadBalancer

kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'

argocd-loadbalancer

#To login copy loadbalancer address and paste in browser. username is admin, to get initial password run below command:

argocd admin initial-password -n argocd

argocd-login-page

#To change password go to user info and click on update password

argocd-password-change

#Clone this git repo & create application using application.yaml file

git clone https://github.com/learnwithabhishek/argocd-project.git

kubectl apply -f application.yaml

argocd-browser-application-successful

#We can check details of deployments, replicaset, pods etc by clicking on the application.

argocd-browser-details1

argocd-browser-details2

#To get details about prod cluster enter below command:

kubectl get all -n prod

k8cluster-after-deploy

#Access your vpro-app with loadbalancer external-ip in browser

vpro-app-browser

#Can login with username: admin_vp , password: admin_vp

vpro-app-browser2

#Click on "All Users" , it will show list of users

vpro-app-browser-allusers

#click on any user id, data will be fetched from database and inserted in cache

vpro-app-browser-allusers2

#Go back and click same user id again, now data will be displayed from cache

vpro-app-browser-allusers3

#Return back to main page of app and click on RabbitMq to initiate it

rmq-tested

#After completing the project delete the application and then delete kubernetes cluster on aws

kops delete cluster --name k8.learnwithabhi.xyz --state=s3://mykopsbucketfork8 --yes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published