ArgoCD Curriculum
On this page
- What Is An Application
- 1. Defining the Application Custom Resource (CRD)
- 2. The Lifecycle of an Application Resource
- Phase 1: Registration
- Phase 2: Discovery
- Phase 3: Manifest Pull
- Phase 4: Initial Diff Evaluation
- Phase 5: Continuous Monitoring
- 3. Operational Sizing and Application Scope
- The Microservice Application Pattern (Recommended)
- The Monolithic Application Pattern (AVOID for production)
- 4. Troubleshooting Application Manifest Failures
- 5. Application Resource Reference Summary
What Is An Application
In the previous module, we finished our setup of ArgoCD's global settings, covering TLS configurations, RBAC ConfigMaps, secret mappings, and configuration best practices. With the system environment secured, we will now start Module 3: Core Concepts. This module focuses on the logical abstractions that ArgoCD uses to coordinate GitOps workflows, starting with the primary resource: the Application.
At the heart of ArgoCD's model is the concept of a declarative application. In ArgoCD, an Application is not just a concept; it is implemented as a custom Kubernetes resource (CRD) that binds a Git source configuration to a cluster destination.
This guide provides an in-depth exploration of the Application CRD, its schema structure, its controller operations, and how it reconciles states.
1. Defining the Application Custom Resource (CRD)
Kubernetes allows you to extend its API using Custom Resource Definitions (CRDs). When you install ArgoCD, the operator registers several CRDs, the most critical being the Application resource under the API group argoproj.io/v1alpha1.
An ArgoCD Application is a declarative resource that defines:
- The Source: The location of the desired state (a Git repository, branch, commit, and folder path containing YAML manifests, Helm charts, or Kustomize overlays).
- The Destination: The target Kubernetes cluster and namespace where those manifests should be applied.
- The Policy: Instructions on how the controller should sync changes (manual vs. automatic, prune policies, self-healing options).
By defining deployments as standard Kubernetes resources:
- You can write, version control, and review Application definitions just like deployment files.
- You can manage ArgoCD using standard Kubernetes tools (like
kubectl). - The ArgoCD controller tracks changes to the Application manifest automatically, managing the resource lifecycle.
2. The Lifecycle of an Application Resource
When you apply an Application manifest to your cluster:
Phase 1: Registration
The Kubernetes API server accepts the resource definition, validates it against the applications.argoproj.io CRD schema, and writes it to the database.
Phase 2: Discovery
The argocd-application-controller detects the new resource. It parses the source repository details and target cluster destinations.
Phase 3: Manifest Pull
The controller contacts the argocd-repo-server, which clones the target Git repository, parses the manifests, and compiles any template frameworks (like Helm values or Kustomize overlays).
Phase 4: Initial Diff Evaluation
The controller compares the compiled manifests with the resources currently running in the target cluster, setting the initial sync status to OutOfSync.
Phase 5: Continuous Monitoring
The controller starts a monitoring loop. Every 3 minutes (or when triggered by a webhook), it runs comparisons to verify that the cluster matches Git.
3. Operational Sizing and Application Scope
As your engineering organization grows, the way you group resources into Applications determines the stability and performance of your controller:
The Microservice Application Pattern (Recommended)
You create a separate ArgoCD Application for each microservice (e.g., payment-service, auth-service, frontend-service).
- Pros: Scoped blast radius. If one microservice configuration is broken, only that specific application is flagged as failed.
- Cons: Larger number of resources for the controller to track.
The Monolithic Application Pattern (AVOID for production)
You bundle all cluster resources, namespaces, databases, and microservices into a single large Application pointing to the root of your Git repository.
- Pros: Only one Application card to manage in the dashboard.
- Cons: High blast radius. If a single config map update fails, the entire application shows a degraded status, masking other deploy statuses.
4. Troubleshooting Application Manifest Failures
If your Application is stuck in an Unknown or Degraded status, run these diagnostic commands:
Review the status block in the output:
If you see ComparisonError, it indicates that either:
- The credentials configured for the target Git repository are invalid.
- The branch name specified in the source configuration does not exist.
- The target cluster is unreachable.
5. Application Resource Reference Summary
Now that we have covered the conceptual framework of the Application Custom Resource, the next step is analyzing its schema. In the next section, we will cover the structure of the Application YAML manifest file.