Skip to content

itsnehagarg/GitOpsInAction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 

Repository files navigation

What is GitOps?

GitOps is a mechanism to automate infrastructure for the DevOps and other specialized engineers. GitOps is mainly defined as "GitOps uses Git repositories as a single source of truth to deliver infrastructure as code."

GitOps Tools

~ ArgoCD ~ FluxCD ~ Code Fresh ~ Jenkins X

ArgoCD Installation

Go to: https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/

  1. Start the minikube which starts the local Minikube Kubernetes cluster.

    Use the below command:

    minikube start

    image

  2. Use the below command to create the ArgoCD namespace: kubectl create namespace argocd

  3. Use the below command to install ArgoCD, a GitOps-based continuous delivery tool for Kubernetes, by applying the resource definitions provided in the specified YAML file to the argocd namespace in your Kubernetes cluster.

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

  1. Let's check if the pods have come up using the below command:

`` kubectl get pods -n argocd -w

`` image

  1. kubectl get svc image

  2. kubetcl get svc -n argocd

image

  1. argocd server interacts with the CLI. We are going to edit the file by using the below command. We are editing the service because by default it comes with the service type as ClusterIP mode and we want this to be NodePort mode so that we can access this service over the web browser.

kubectl edit svc argocd-server -n argocd

  1. We need port forwarding to access:

minikube service list -n argocd

  1. Minikube creates a tunnel and provides the Ip address as shown below using the cmd:

minikube service argocd-server -n argocd

  1. We can access the ArgoCD on our browser using the IPs given by above command.

  2. ArgoCD UI is up! Yay!

image

  1. Let's try to login now.

Now use the command to check the password prseent in the ArgoCD secret file. `` kubectl get secret -n argocd

`` image

kubectl edit secret argocd-initial-admin-secret -n argocd

Now get the password and then decrypt the secrets.

echo secret_password | base64 --decode Now paste the password in the browser and we can login!

image

Lets try out some projects:

  1. Click on Create Application button on your ArrgoCD UI: image

  2. In Sync Policy, select Automatic so, ARgo CD automatically deploys the app.

  3. Provide the URL of the repository and the path: image

  4. Provide the Cluster URL and the namespace image

  5. Click on Create button. image

  6. Now ArgoCD is getting the application from the GitHub link that we have provided earlier. It will start fetching the configurations mentioned in guestbook-ui-deployment.yaml & guestbook-ui-svc.yaml

  7. It will deploy it on Kubernetes cluster. image

  8. Run the command kubectl get deploy

  9. Now we can also check the ArgoCD UI: image

  10. We can delete the resources that got created by clicking on the "Delete" button.

  11. If we are not able to access the ArgoCD UI then all the steps can be performed by using ArgoCD CLI.

ArgoCD Architecture

ArgoCD Architecture comprises of below components: ~ API Server (exposes the API consumed by the Web UI, CLI, and CI/CD systems) ~ Repository Server (connects to Git and fetches the state) ~ Application Controller (connects to K8s and fetches the state)

image

References and Image Credits:

https://argo-cd.readthedocs.io/en/stable/

GitOps tools, ArgoCD, Architecture, Implementation

About

GitOps tools, ArgoCD, Architecture, Implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published