Argo CD Integration Guide
Deliver GitOps-driven node environments by mapping each LynqNode to an Argo CD Application.
Overview
Lynq can render Argo CD Application manifests for every active node row. Each LynqNode becomes the canonical source of truth for a corresponding Argo CD Application, enabling GitOps workflows, progressive delivery, and automated cleanup.
Core Benefits
- 1:1 Mapping – Every LynqNode owns exactly one Argo CD Application (
LynqNode↔️Application). - Automatic Sync – Application source paths follow node metadata (UID, plan, region).
- Declarative Cleanup – When a LynqNode is deleted (or deactivated), the Argo CD Application and downstream workloads are removed.
- GitOps Alignment – Teams keep delivery pipelines in Git, while Lynq handles orchestration and lifecycle.
Prerequisites
- Argo CD installed (v2.8+ recommended) and accessible from the node namespace.
- ServiceAccount and RBAC granting Lynq permission to create Argo CD
Applicationobjects in the Argo CD namespace (oftenargocd). - Lynq chart deployed with namespace permissions covering the Argo CD API group.
- Git repository that hosts node application configuration.
Baseline Template (1 LynqNode ➝ 1 Application)
The following template renders an Argo CD Application per LynqNode. Each Application points to a unique Git path derived from node metadata.
yaml
apiVersion: operator.lynq.sh/v1
kind: LynqForm
metadata:
name: argocd-app-template
spec:
hubId: saas-registry
manifests:
- id: argocd-app
nameTemplate: "{{ printf \"%s-app\" (.uid | trunc63) }}"
spec:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
namespace: argocd
labels:
node.lynq.sh/uid: "{{ .uid }}"
node.lynq.sh/region: "{{ .region | default \"global\" }}"
spec:
project: nodes
source:
repoURL: https://github.com/your-org/node-configs.git
targetRevision: main
path: "nodes/{{ .uid }}"
destination:
server: https://kubernetes.default.svc
namespace: "{{ .uid }}-workspace"
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=trueFlow
Advanced Sync Patterns
| Pattern | Description | LynqForm Template Hints |
|---|---|---|
| Environment Branching | Target different Git branches per region or plan (targetRevision: "{{ ternary \"main\" \"staging\" (eq .planId \"enterprise\") }}"). | Use extra value mappings for planId, region. |
| Dynamic Paths | Compose repo paths from UID segments (path: "nodes/{{ .region }}/{{ .uid }}"). | Use Sprig splitList, join, default. |
| App-of-Apps | Point each node to an Application that references node-specific sub-apps. | Render Application with path: nodes/{{ .uid }}/apps. |
| Multi-Cluster Delivery | Route nodes to dedicated clusters using Argo CD credentials (destination.server). | Map datasource columns to clusterServer, clusterName. |
| Progressive Rollouts | Annotate Applications for Argo Rollouts or Progressive Sync plugins. | Add metadata.annotations via templates. |
Additional Use Cases
1. AppSet Fan-Out per Node Plan
- Combine Lynq with Argo CD ApplicationSet.
- Lynq renders a control-plane Application that references an ApplicationSet generator.
- Generator reads node metadata (via ConfigMap/Secret) to produce feature-specific Applications per plan tier.
2. Multi-Cluster Nodes with Cluster Secrets
- Add
extraValueMappingsfor cluster credentials. - LynqForm template creates:
- An Argo CD
ClusterSecret(with kubeconfig) in the Argo CD namespace. - An
Applicationtargeting that cluster secret.
- An Argo CD
- Enables dedicated clusters per enterprise node.
3. Canary and Blue/Green Releases
- Render two Applications per node (
node-app-canary,node-app-stable) with differenttargetRevision. - Use
creationPolicy: Onceon the stable Application andWhenNeededon the canary for rapid rollback. - Combine with Argo Rollouts by templating
analysisand promotion hooks.
Operational Tips
- Label Applications with node metadata for quick filtering (
node.lynq.sh/uid). - Grant the operator service account access to
argoproj.ioAPI group via ClusterRole. - Monitor Argo CD sync status alongside LynqNode status; both must be healthy for end-to-end readiness.
- Use the
Retaindeletion policy when you need to keep Applications for post-mortem analysis.
What to Read Next
- Templates Guide – Advanced templating and function usage.
- Policies Guide – Control resource lifecycle (Retain vs. Delete).
- Monitoring Guide – Capture Argo CD and Lynq metrics together.
