Component C108 – ArgoCD Controller
By Raj Marni. March 26, 2025. Revised. Version: 0.0.01
1. Overview
C108 – ArgoCD Controller is a critical component within the k8or Orbit ecosystem that facilitates GitOps-based continuous deployment for Kubernetes applications. It operates as the bridge between Git repositories (as the single source of truth for deployment configurations) and Kubernetes clusters, ensuring that the current state of applications in the cluster always matches the desired state defined in the Git repository.

ArgoCD automates the synchronization of Kubernetes resources using a declarative approach, ensuring applications are continuously updated and deployed based on the Git repository's state. This allows for automated, predictable, and traceable deployments across multiple environments (dev, test, prod).
2. Internal Architecture
2.1 Core Modules
Git Synchronization Module
Function: Monitors Git repositories for changes and triggers synchronization with Kubernetes clusters.
Process:
Continuously watches Git repositories for any changes to Kubernetes manifests (Helm charts, YAML files).
When a change is detected, the synchronization module updates the Kubernetes cluster to reflect the new desired state.
Kubernetes Sync Engine
Function: Responsible for comparing the desired state (from Git) with the current state of the Kubernetes cluster and performing updates accordingly.
Process:
The engine continuously checks the current state of deployed applications and resources in the Kubernetes cluster.
It then calculates the differences between the actual state in the cluster and the desired state defined in the Git repository.
Syncing: If discrepancies are found, the sync engine will either automatically or manually (based on user configuration) sync the changes to the cluster, ensuring that the two states match.
Helm and Kustomize Integration
Function: Supports Helm charts and Kustomize overlays for Kubernetes resource templating and deployment.
Process:
Helm and Kustomize are used to generate dynamic Kubernetes manifests that can be customized per environment (dev, test, prod).
ArgoCD fetches Helm charts from the repository, applies the necessary overlays, and deploys the resulting configurations to the cluster.
For Kustomize, ArgoCD handles environment-specific customizations and generates the appropriate manifests.
Health & Status Monitoring
Function: Monitors the health of applications and resources deployed in the cluster and reports the deployment status.
Process:
Continuously monitors the health of resources deployed in the cluster (e.g., Pods, Deployments, Services) using Kubernetes health checks (readiness, liveness probes).
Tracks deployment success, failure, and sync status.
Provides real-time updates on whether the application is successfully synced, in progress, or has failed.
Role-Based Access Control (RBAC) & Security Module
Function: Manages security by enforcing RBAC policies to control who can deploy or modify applications via ArgoCD.
Process:
Integrates with Kubernetes RBAC to control which users or service accounts have permission to modify configurations, trigger deployments, and sync resources.
Ensures that only authorized users and applications can perform actions on Kubernetes resources.
3. Data Flows and Communication Patterns
3.1 Continuous Sync with Git Repositories
Git Repository Sync
Git Repositories: ArgoCD continuously watches Git repositories (GitLab) for any updates to the deployment manifests, whether they are Helm charts or raw YAML files.
Event Trigger: When changes are detected in the Git repository (e.g., a new commit), ArgoCD triggers a sync operation to reflect those changes in the Kubernetes clusters.
Sync Logic:
Desired State: The desired state is defined in the Git repository as Helm charts or Kustomize configuration files.
Current State: The current state is the live configuration of applications in the Kubernetes cluster.
Delta Calculation: ArgoCD compares the desired state with the current state and computes the differences (delta). Based on this comparison, it triggers the necessary actions to bring the cluster into alignment with the desired state.
Sync Action:
Automatic Sync: Depending on the configuration, ArgoCD can automatically apply the changes detected in the Git repository to the Kubernetes cluster.
Manual Sync: If manual approval is required, the changes can be manually approved by the user, and then ArgoCD will apply the changes.
3.2 Health Monitoring and Reporting
Health Check API
ArgoCD uses Kubernetes health checks (readiness/liveness probes) to assess whether the deployed application is running correctly.
If an application is not healthy, ArgoCD provides a detailed report of the health status, indicating what might be wrong and whether a redeployment or rollback is needed.
Sync Status API
ArgoCD tracks whether applications are in sync with their Git repository, providing feedback on whether the deployment has been successfully synced or if there were any issues during the sync operation.
Status Types:
Synced: The application is in the desired state.
Out of Sync: The application has diverged from the desired state, usually because of manual changes in the cluster.
Pending: Sync operation is in progress.
Failed: Sync operation has failed due to errors (e.g., invalid configuration or failed resources).
3.3 Multi-Cluster Management
Cluster Registration
ArgoCD can manage deployments across multiple Kubernetes clusters. Each cluster is registered in the ArgoCD system, and ArgoCD syncs resources to each cluster independently based on the Git repository's configurations.
Cluster Sync: When a change is pushed to the Git repository, ArgoCD syncs the resources across all registered clusters, ensuring consistency in deployments across different environments.
Cluster-Specific Customization
Multi-Cluster Synchronization: ArgoCD supports custom configurations for each cluster, allowing different deployment settings or environments (e.g., dev, test, prod) to have different configurations based on the same Git repository.
Override Mechanism: Each cluster may apply overlays (via Kustomize or Helm values) that are specific to the cluster, allowing for environment-specific configurations (e.g., resource limits, scaling).
3.4 Communication with Other Components
To and From C8 – K8or Portal
The K8or Portal (C8) provides a user interface to interact with ArgoCD. Users can trigger deployments, view application health status, and manually sync resources through the portal.
SyncMaster ensures that any updates from the portal are synchronized across all relevant components in the system, including ArgoCD-managed clusters.
From C12 – Manifestor
The Manifestor (C12) provides the Kubernetes manifests (Helm charts, YAML) that ArgoCD uses to manage deployments.
ArgoCD syncs these manifests to the clusters, ensuring they are continuously updated in alignment with the Git repository.
To C20 – Chart Store
ArgoCD can pull Helm charts from C20 (Chart Store) and deploy them to clusters.
SyncMaster ensures that the correct charts from the Chart Store are used during deployments and are consistent with the latest configurations in the Git repository.
4. Technology & Protocols
GitOps:
ArgoCD follows the GitOps approach, where Git repositories serve as the source of truth for Kubernetes configurations.
Helm & Kustomize:
ArgoCD integrates with Helm and Kustomize to allow for flexible and dynamic deployments based on reusable templates and environment-specific customizations.
Kubernetes APIs:
ArgoCD interacts with the Kubernetes API to deploy resources, monitor their health, and manage sync operations.
RESTful APIs:
ArgoCD exposes a RESTful API for integration with external systems and tools, allowing users to trigger deployments, view status reports, and manage clusters programmatically.
RBAC & IAM:
ArgoCD integrates with Kubernetes RBAC for user authorization and access control, ensuring secure deployment operations.
5. Benefits & Impact
Automated and Consistent Deployments
ArgoCD automates the deployment process, ensuring that applications remain consistent across all environments, reducing human error and operational overhead.
Declarative Infrastructure
With GitOps, ArgoCD ensures that infrastructure changes are always tracked in Git, making it easy to audit changes and ensure that deployments are predictable and repeatable.
Multi-Cluster and Multi-Environment Support
ArgoCD can manage multiple clusters simultaneously, ensuring deployments are consistent across various environments (e.g., dev, test, prod), even across different geographical regions.
Real-Time Feedback and Monitoring
Provides real-time deployment status, allowing operators to take quick action in case of any failures or discrepancies between the desired and actual states.
Security and Compliance
With RBAC and audit logging, ArgoCD ensures that deployments are secure, traceable, and compliant with organizational standards.
Last updated