Argo CD is a declarative, GitOps-based continuous delivery (CD) tool designed specifically for Kubernetes. It acts as a controller that monitors running applications, compares their live state to the desired state defined in a Git repository, and automatically syncs them to ensure consistency.
Key Aspects of an Argo CD Application:
- GitOps Source of Truth: Git repositories hold the desired state (manifests, Helm charts, Kustomize configs), which Argo CD pulls to apply to clusters.
- Automated Synchronization: It automatically detects "OutOfSync" applications—where the live cluster state differs from Git—and can automatically or manually sync them to match.
- Continuous Monitoring: It acts as a Kubernetes controller that continuously monitors applications.
- Visualization & Management: It provides a web UI to visualize application structure, monitor status, and manage rollbacks.
- Key Capabilities: Supports automated deployment, drift detection, and easy rollbacks.
Argo CD is often used to ensure that the actual state of a Kubernetes cluster matches the configuration stored in a Git repository, making the deployment process more reliable and transparent.
ArgoCD GitOps flow:
- Commit and push infra code changes (Terraform, Helm values etc) to the main branch of your GitHub repository.
- ArgoCD Sync:
- Manual: Log in to our ArgoCD Dashboard and click the "Sync" or "Refresh" button on the psmdb-default-sharded application.
- Automatic: If "Self-Heal" or "Auto-Sync" is enabled, ArgoCD will detect the Git change within ~3 minutes and apply it to the cluster automatically.
- Monitor the Operator: Once ArgoCD syncs, infra will get changed e.g. operators will see the updated custom resources and then trigger the further actions.
Installation
Installing ArgoCD in a Kubernetes cluster is primarily done using manifests or Helm charts. The most common and recommended approach for beginners is using the Official Argo CD Manifests.
Prerequisites:
- A running Kubernetes cluster (v1.22 or later).
- kubectl command-line tool installed and configured to your cluster.
- At least 2GB of available memory in your cluster.
Applications
ArgoCD defines custom Kubernetes objects like Application, AppProject, settings...which can be defined declaratively using Kubernetes manifests and deployed via kubectl apply to the ArgoCD namespace which is argocd by default.
To check ArgoCD applications:
% kubectl get applications -A
NAMESPACE NAME SYNC STATUS HEALTH STATUS
argocd my-app Synced Progressing
Dashboard
If you don't know the url of the ArgoCD dashboard, find the IP of the ArgoCD server and port-forward it:
% kubectl get svc argocd-server -n argocd
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
argocd-server ClusterIP 172.21.103.127 <none> 80/TCP,443/TCP 1d
By default, ArgoCD includes a built-in admin user with full super-user access. For better security practices, it is recommended that you use the admin account only for the initial configuration, then disable it once all required users have been added.
For this example, we can stick to this default admin user. Its password can be obtain via this command:
% kubectl get secret \
argocd-initial-admin-secret \
-n argocd \
-o jsonpath="{.data.password}" \
| base64 -d
Port forwarding:
% kubectl port-forward svc/argocd-server -n argocd 8080:443
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
...
We can now open the address http://localhost:8080/ in the browser to get the ArgoCD dashboard and log in with credentials above.
If there are no application registered with ArgoCD, we will see something like this:
![]() |
---


No comments:
Post a Comment