zRBasics
ArgoCD is a declarative gitops-based delviery tool for kubernetes. It continuously monitors the workloads and compares live state vs. stored state.
How does ArgoCD work?
- Uses git repos as the source of truth
- Supports kustomize, helm charts, etc.
Concepts and Terminology
Application- a group of kubernetes resources as defined by a manifestApplicationState:- Target State: the ‘stored’ state
- Live State: the ‘live’ state
Features
- Auto deployment of apps to speficified target environments in multiple clusters
- Support for 3rd party templating tools such as kustomize, helm, etc.
- SSO Integration
- Multi-tenancy and RBAC policies for authorization
- Rollback/roll of applicatoins
- Health status analysis of apps
- Auatomated configuration drift dsetection and visualzation
- out of the box prometheus metrics
- audit trails
- webhook integration
- CLI and access tokens for automation and CI integration
- Web UI which provides real-time view of applications
- Automated or manual sync of apps to the desired state
ArgoCD Architecture
- Microservices architecture, there is no single “ArgoCD” component. Multiple distributed services working together
- Built on as many native kubernetes primitives as possible (controllers, CRDs, configmaps, secrets)
Components
- Application Controller / ApplicationSet Controller
- Both are kubernetes operators (and therefore controllers)
- Continuously watch
Application/ApplicationSetresources and compare live state vs. desired state from the source repo - Also responsible for lifecycle events of the content they reconcile
- Repository Server
- Keeps a local cache of the remote repo content
- Generates the kubernetes manifests based on:
- repo type
- repo location
- path within the repo
- template tool parameters (helm, kustomize, etc.)
- Custom plugins run here too since they influence manifest generation
- API Server
- gRPC/REST server
- Handles:
- Application management and status reporting
- Operations: sync, rollback, user defined actions
- Cluster and repo management
- RBAC enforcement
- The UI, CLI and external CI/CD systems all depend on this
- Also serves the web UI
- Redis
- In-memory cache. Caches repo contents, k8s resource state, and connection status of repos/clusters
- NOT persisted, always rebuilt at startup
- CLI (
argocd)- Talks to the API. Superset of what the UI can do
- SSO
- Local users or external users
- OIDC supported directly
- Dex is bundled for identity providers that don’t speak OIDC (acts as a bridge)
- Notifications
- Included by default since 2.3
- Triggers + templates based on application lifecycle events
- Slack, email, webhooks, etc.
Custom Resources
Every install includes 3 CRDs:
ApplicationAppProjectApplicationSet
These CRDs are effectively your interface for managing your cluster(s).
Key Themes
- Declarative: everything (including argo’s own config in ConfigMaps/Secrets) is declarative. This means ArgoCD can manage itself via GitOps
- Stateless: config is the state, can be rebuilt at any time
- etcd is the persistent store
- If state needs to be tracked against a resource, use the
statusfield - Redis is only a volatile cache
- **FlexiblezR: multiple repo types, built in support for Kustomize, Helm, Jsonnet, and user defined tools