# Continuous Deployment using Argo CD

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. It automates the deployment and management of applications through Git repositories. Argo CD uses Git as the single source of truth for application definitions, configurations, and environments. This makes it easy to track changes, roll back deployments, and audit application deployments.

Argo CD offers a number of features that make it a powerful continuous delivery tool, including:

* Declarative configuration: Argo CD uses declarative configuration files to define application deployments. This makes it easy to specify the desired state of an application, and Argo CD will automatically sync the live state to the desired state.
    
* GitOps: Argo CD uses GitOps to manage application deployments. This means that all changes to application definitions are made through Git. This helps to ensure that all changes are tracked and auditable.
    
* Automatic synchronization: Argo CD can automatically synchronize application state with the current version of declarative configuration. This eliminates the need to manually sync applications.
    
* Visual feedback: Argo CD provides visual feedback on the status of application deployments. This makes it easy to see which applications are in sync, and which applications need to be synced.
    

Argo CD is a powerful continuous delivery tool that can help you to automate the deployment and management of applications on Kubernetes. It is easy to use, and it offers a number of features that make it a valuable tool for any Kubernetes deployment.

Here are some of the benefits of using Argo CD:

* **Increased reliability:** Argo CD can help to improve the reliability of your applications by automating the deployment and management process. This can help to reduce the risk of human error and improve the overall stability of your applications.
    
* **Reduced costs:** Argo CD can help to reduce the costs associated with managing your applications. This is because Argo CD can automate many of the manual tasks that are typically associated with application deployment and management.
    
* **Improved security:** Argo CD can help to improve the security of your applications by automating the deployment and management process. This can help to reduce the risk of security vulnerabilities being introduced into your applications.
    
    # *<mark>Installation of Argo CD</mark>*
    
* **1- Create namspace for argocd**
    
    `kubectl create namespace argocd`
    
* **2-Install ArgoCD**
    
    \# Download the Argo CD image from docker hub and run
    
    `docker pull argoproj/argocd:latest`
    
    (or)
    
    `kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml`  
    3-**Check installed argocd with namspace**
    
    `kubectl -n argocd get all`
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684574869543/1cf51db7-bf68-4fa4-a4b8-8c884663776c.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684574803264/7d1b2a3c-4c77-4b5b-b698-c5290873197c.png align="center")
    
    4- By default all services are in ClusterIP
    
* To access ARGOCD dashboard "edit argocd-server"
    
* `kubectl -n argocd edit svc argocd-server`
    
* Replace ***ClusterIP*** with ***NodePort*** or *LoadBalancer*.
    
* Here i am using ***NodePort***
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684575066834/5367ac78-f8ab-4566-b7de-5fbc9e62f1c5.png align="center")
    
    5-Check the NodePort number `kubectl -n argocd get svc`
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684575285571/3e950256-1346-4fef-84eb-49089f2560ae.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684575356311/5c9a5efd-1e55-4e6c-9631-693ab7978ec9.png align="center")
    
    6- Check node IP `kubectl get nodes -o wide`  
    Access argocd dashboard using open http://&lt;LoadBalancerIP&gt;:&lt;NodePort&gt;
    
    7-login to Argocd. By default, the username and password are ***<mark>admin</mark>***
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684575624966/e5ad39b4-31f7-4905-b253-d10d7dd57663.png align="center")
    
    8- Connect git repository
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684575975666/5d4e9b7b-fd70-4d1b-a403-5bffa2d7903c.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576011094/84148b45-191e-44fa-870e-a51579061e49.png align="center")
    
    Copy and paste your Repository url
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576160429/c41361d2-5e2b-4c7e-896e-4960578c2e94.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576188508/977865f0-0a6a-40c6-b324-ee59bc18651e.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576214607/7795a2ef-a378-479f-9ff2-55330a555255.png align="center")
    
    9- Click "NEW APP"
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576300613/9992879e-2404-4117-8388-aceddc61a8fe.png align="center")
    
    \--&gt;Select project name default from the list( you can create manually as well)
    
    \--&gt;SYNC POLICY (manual and automatic)
    
* \--&gt;Choose Cluster ULR from dropdown list
    
* \--&gt;Click the "Namespace" field and type default (use application's namespace)
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576515368/4fb616e0-70f3-4364-b100-c4145668039d.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576648907/bc5843b0-94ca-4fb0-abd4-8e767b441716.png align="center")
    
    **Click "CREATE"**
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576818790/7b249de0-90f4-4e24-975b-f21e43ce91dd.png align="center")

10-Click "SYNC" (if you are using Automatic SYNC ..it will sync in few minutes automatically)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576916233/fdb6acd1-d3c4-419f-bd6b-203e025103ec.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684576999571/96070af4-d17b-4d16-afde-bbf4f0c38b58.png align="center")

Get inside the application.

My Pods are running(i used 4 replicas )

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684578561313/443f00f4-3813-40b2-a514-8b3a1520aad2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684577063952/8b970134-4f0c-4948-a393-d8faa2208800.png align="center")

11-Verify with terminal (i deployed in default namespace)

`kubectl get all`

Copy NodePort number and access with node's public IP

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684577167114/da6515fd-ab34-45a8-be30-a3aa02f01d1c.png align="center")

Sample Todo list App is running

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684577439819/f11755d2-83ed-478c-9c22-4912673fd77b.png align="center")
