Argo CD
repository·master·Indexed 12 days ago
https://github.com/argoproj/argo-cdA declarative GitOps continuous delivery tool for Kubernetes that automates application deployment by ensuring cluster state matches configurations defined in a Git repository. It includes features for manifest hydration, a GitOps Engine library for Go projects, and support for high availability (HA) installations.
What's inside Argo CD
- Argo CD is a declarative GitOps continuous delivery tool designed for Kubernetes. It follows the GitOps pattern where application definitions, configurations, and environments are stored in version control, and the tool automates the deployment and lifecycle management of those applications to ensure the live state in the cluster matches the desired state defined in Git.
Integrate Google Workspace login with Argo CD
masterArgo CD supports three primary methods for integrating Google Workspace users via Dex:
- OpenID Connect (OIDC) using Dex: The recommended method if you do not require Google Group membership information for RBAC.
- SAML App Auth using Dex: Uses SAML to authenticate. Warning: Dex documentation recommends avoiding this method as SAML is considered unsafe and the module may be deprecated.
- OpenID Connect plus Google Groups using Dex: The recommended method if you need to use Google Group membership in your RBAC configuration (e.g., assigning roles to
sysadmins@yourcompany.com).
After setting up any of these, you must configure permissions in the
argocd-rbac-cmConfigMap.apiVersion: v1 kind: ConfigMap metadata: name: argocd-rbac-cm namespace: argocd data: policy.default: role:readonlyCore features of the GitOps Engine library
masterThe GitOps Engine is a library that implements core GitOps capabilities. It provides the following features:
- Kubernetes resource cache: Efficiently manages and retrieves Kubernetes resources.
- Resources reconciliation: Handles the logic for bringing the cluster state in line with the desired state.
- Sync Planning: Generates plans for synchronizing resources.
- Access to Git repositories: Provides mechanisms to interact with Git-based source control.
- Manifest Generation: Supports the creation of manifests from source definitions.
Understand Argo CD scalability benchmarking goals
masterArgo CD is undergoing scalability benchmarking to provide empirical evidence for large-scale deployments. The goal is to move beyond general scaling documentation and provide specific, quantified guidelines.
Key objectives include:
- Creating repeatable benchmarking procedures (via a proposed
argoproj-labs/argo-cd-benchmarkingrepository). - Determining the baseline performance of default configurations (resource allocations and replicas).
- Quantifying how parameters like replicas, sharding, and parallelism impact performance.
- Establishing metrics and thresholds for automated scaling and performance alerting.
- Providing vendor-agnostic recommendations for different deployment topologies.
- Creating repeatable benchmarking procedures (via a proposed
What is the ApplicationSet controller?
masterThe ApplicationSet controller is a Kubernetes controller that manages the
ApplicationSetCustomResourceDefinition (CRD). It is designed to automate and scale the management of Argo CDApplicationresources across multiple clusters and within monorepos.Key capabilities include:
- Multi-cluster targeting: Use a single manifest to deploy to many clusters.
- Multi-app deployment: Use a single manifest to deploy multiple applications from one or more Git repositories.
- Monorepo support: Efficiently manage multiple Argo CD
Applicationresources defined within a single Git repository. - Multitenancy: Enables individual tenants in a cluster to deploy applications without requiring privileged cluster administrator intervention.
Starting with Argo CD v2.3, the ApplicationSet controller is bundled with the main Argo CD installation.
What is the ArgoCD Repository Server?
masterThe ArgoCD Repository Server is an internal service responsible for maintaining a local cache of the Git repositories that hold application manifests. Its primary role is to generate and return Kubernetes manifests to the rest of the Argo CD system. Theargocd-repo-servercommand runs this service in the foreground.Understand Argo CD versioning and upgrade rules
masterArgo CD follows semver-like versioning rules that dictate the complexity of an upgrade:
- Patch releases (e.g., v1.5.1 to v1.5.3): Do not introduce breaking changes. No special instructions are typically required.
- Minor releases (e.g., v1.3.0 to v1.5.2): May introduce minor changes that require workarounds. You must review the upgrade instructions for every minor version jump in the sequence (e.g., check both v1.3 to v1.4 and v1.4 to v1.5).
- Major releases: Introduce backward incompatible behavior changes. It is highly recommended to perform a backup of Argo CD settings using the disaster recovery guide before proceeding.
Understand Go Template limitations in ApplicationSet
masterGo templates in ApplicationSet have specific constraints that you must follow to avoid errors:
- Field Type Restriction: Templates can only be applied to string fields. You cannot use templating on
booleanfields (e.g.,useCredentials) orobjectfields (e.g.,syncPolicy). - No Cross-Field Control Flow: You cannot use control keywords (like
{{range}}or{{end}}) that span across multiple YAML fields. Each field is evaluated as an independent template. For example, you cannot start a{{range}}in one list item and end it in another. - Git Generator Restriction: When using the Git generator, signature verification is not supported for the templated
projectfield.
- Field Type Restriction: Templates can only be applied to string fields. You cannot use templating on
Security considerations for Git and Helm repositories
masterThe
repo-servermanages Git and Helm repositories. While it does not have Kubernetes privileges or store credentials, users should be aware of the following risks:- Unauthorized Deployments: Anyone with write access to a trusted Git repository can modify manifests to deploy malicious images or delete resources.
- Tool Command Invocation: Argo CD executes
helm templateandkustomize build. An attacker with Git access could craft malicious charts/kustomizations to attempt out-of-tree file reads on therepo-server. - Remote Bases and Dependencies: Kustomize and Helm can reference external repositories (remote bases/dependencies) that may not be in your Argo CD allow-list, potentially introducing un-audited resources.
Configure AppProject sourceNamespaces for multi-namespace ApplicationSets
masterWhen using
ApplicationSetin multiple namespaces, you must ensure yourAppProjectresources are configured to allow the source namespaces where theApplicationSetresides.If an
ApplicationSetis created in namespaceteam-one-cd, theAppProjectit uses must includeteam-one-cdin itsspec.sourceNamespacesfield. If this is not configured, the generated Applications will be rejected because they are being sourced from an unauthorized namespace.kind: AppProject apiVersion: argoproj.io/v1alpha1 metadata: name: team-one-project namespace: argocd spec: sourceNamespaces: - team-one-cdDeduplicate and prioritize Helm values files
masterArgo CD handles duplicate file matches through specific rules:
- Explicit vs. Glob: Explicitly listed files take priority over glob matches. If a file is matched by a glob but also listed explicitly, the glob skips it and the explicit entry is placed at its declared position.
- Multiple Globs: If the same file is matched by two different glob patterns, it is included at the position of the first match. Subsequent matches for that path are silently dropped.
Example: Pinning a high-precedence file You can use a glob to pick up most files and then use an explicit entry to ensure a specific file has the highest precedence:
valueFiles: - envs/*.yaml # expands to base.yaml, prod.yaml - envs/prod.yaml # prod.yaml is skipped by the glob and placed here (last)valueFiles: - envs/*.yaml # matches envs/base.yaml, envs/prod.yaml - envs/**/*.yaml # envs/prod.yaml already matched above and is skipped; # envs/nested/prod.yaml is a different path and is still includedHow impersonation scope is determined for Applications
masterThe service account used for impersonation is determined at the Application level, not the individual resource level.
- If
spec.destination.namespaceis set: The impersonation logic uses this namespace to match against theAppProject.spec.destinationServiceAccountslist. - If
spec.destination.namespaceis NOT set: The Application's own namespace (where theApplicationCR resides) is used to scope the service account lookup. - Cross-namespace service accounts: If you provide a service account in the format
mynamespace:my-sa, Argo CD will attempt to usesystem:serviceaccount:mynamespace:my-saregardless of the application's destination namespace.
- If