9.4 ArgoCD

Note

Argo CD is a GitOps-based continuous delivery platform for Kubernetes applications. It provides a way to declaratively manage applications deployed in a Kubernetes cluster, using Git as the source of truth for application definitions and configurations.

Application definitions, configurations, and environments should be declarative and version controlled. Application deployment and lifecycle management should be automated, auditable, and easy to understand.

Argo CD continuously monitors the state of the deployed applications and automatically syncs them with the desired state defined in Git. If a drift is detected between the deployed application and the desired state, Argo CD will automatically reconcile the drift to bring the application back to the desired state.

Some key features of Argo CD include:

  1. GitOps: Using Git as the source of truth for application definitions and configurations.

  2. Continuous Deployment: Automatically syncing deployed applications with the desired state defined in Git.

  3. Drift Detection and Reconciliation: Detecting and automatically reconciling any drift between deployed applications and the desired state.

  4. Role-Based Access Control: Defining and enforcing fine-grained access control policies for Argo CD users.

  5. Application Management: Managing the lifecycle of applications, including rollouts, rollbacks, and scaling.

Argo CD provides a simple and efficient way to manage applications deployed in a Kubernetes cluster while ensuring that the deployed applications are always in sync with the desired state defined in Git.

Install ArgoCD

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

Access The Argo CD API Server

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

Port Forwarding

kubectl port-forward svc/argocd-server -n argocd 8080:443

Login Using The CLI

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo

Remove everything

kubectl delete namespace argocd

Create first application

Steps to create a new application in the Portal:

  1. Click on the New Application button.

  2. Enter the application name.

  3. Enter the project name.

  4. Enter the repository URL.

  5. Enter the path to the application manifest.

  6. Select the cluster where the application will be deployed.

  7. Click on the Create button.