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.
Verification Commands β
After deploying, verify the integration works correctly:
bash
# 1. Check LynqNodes created Argo CD Applications
kubectl get applications -n argocd -l node.lynq.sh/uid
# Example output:
# NAME SYNC STATUS HEALTH STATUS AGE
# acme-corp-app Synced Healthy 5m
# beta-inc-app Synced Healthy 5m
# 2. Verify Application points to correct Git path
kubectl get application acme-corp-app -n argocd -o jsonpath='{.spec.source.path}'
# Expected: nodes/acme-corp
# 3. Check sync status
kubectl get application acme-corp-app -n argocd -o jsonpath='{.status.sync.status}'
# Expected: Synced
# 4. Check health status
kubectl get application acme-corp-app -n argocd -o jsonpath='{.status.health.status}'
# Expected: Healthy
# 5. View sync history
argocd app history acme-corp-app
# 6. Force sync (if needed)
argocd app sync acme-corp-app
# 7. Check downstream workloads
kubectl get all -n acme-corp-workspace
# 8. View Application events
kubectl describe application acme-corp-app -n argocd | tail -20Monitor Both Systems:
bash
# Combined health check
echo "=== LynqNode Status ===" && \
kubectl get lynqnode acme-corp-web-app -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' && \
echo "" && \
echo "=== Argo CD Application Status ===" && \
kubectl get application acme-corp-app -n argocd -o jsonpath='{.status.sync.status}/{.status.health.status}'
# Expected: True (LynqNode Ready) + Synced/Healthy (Argo CD)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.
