Skip to content

GitOps Import with ArgoCD

This guide walks through a complete working example of importing GitOps-managed applications into ConfigHub using ArgoCD. It uses a local Kubernetes cluster to demonstrate the full setup then import into the Confighub UI.

Requirements

How It Works

  • ArgoCD continuously syncs your Git repo to the cluster — your repo structure is your deployment config
  • ConfigHub Worker runs inside the cluster, reads ArgoCD application state, and reports it back to ConfigHub
  • ConfigHub uses that data to let you discover, import, and manage your apps through the UI

This can also be achieved via CLI using cub gitops discover, cub gitops import, and cub gitops cleanup. When a single worker hosts the discovery, renderer, and OCI bridges, one target is sufficient for all three steps:

cub gitops discover --space my-space my-k8s-target
cub gitops import --space my-space my-k8s-target

For the full end-to-end flow — what discover and import do in ConfigHub, how rendered manifests are stored, and how re-renders preserve modifications — see Render manifests from DRY formats.

Note
This example uses confighub/examples/gitops-import which is based on jesperfj/gitops-argocd having the following directory structure:
  apps/
    cubbychat/
      backend/
      frontend/
      postgres/
  platform/
    alloy/
    cert-manager/
    external-dns/
    external-secrets/
    grafana/
    traefik/

1. Create a Local Cluster

bin/create-cluster

Creates a Kind (Kubernetes in Docker) cluster named gitops-import. The kubeconfig is saved to var/gitops-import.kubeconfig — isolated from your global ~/.kube/config.

2. Install ArgoCD

bin/install-argocd

This installs ArgoCD into the cluster and configures it for local access:

  • Installs ArgoCD from the official stable manifests
  • Exposes the ArgoCD UI at http://localhost:9080 (no port-forward needed)
  • Pre-provisions a confighub-worker service account in ArgoCD with read-only access to applications — this is the account ConfigHub uses to query ArgoCD

The admin password is printed at the end and saved to var/argocd-admin-password.txt.

3. Set Up Applications

bin/setup-apps

Creates two ArgoCD AppProjects (logical tenants) and two ApplicationSets pointed at the example GitOps repo:

AppProject ApplicationSet Watches
app-cubbychat app-cubbychat apps/cubbychat/*
platform platform platform/*

ArgoCD scans those directories and creates Applications. They are configured with CreateNamespace=true but not with automated sync — ConfigHub's ArgoCDRenderer bridge requires autosync to be off on imported Applications so it (not ArgoCD) owns the rendered output. Initial bootstrap is done manually or through ConfigHub after import.

4. Install the ConfigHub Worker

CUB_SPACE=<your-space> bin/install-worker

This is the bridge between ArgoCD and ConfigHub. The script:

  1. Creates a ConfigHub space (if it doesn't exist) and registers a worker in it
  2. Generates a non-expiring API token for the confighub-worker ArgoCD account
  3. Deploys the worker as a Kubernetes Deployment in the confighub namespace, configured with three capabilities:
  4. kubernetes — can read cluster resources and apply manifests
  5. argocdrenderer — can query ArgoCD and render application configs into ConfigHub
  6. argocdoci — can create Argo CD Application resources that deploy rendered manifests from ConfigHub's OCI registry
  7. The worker talks to ArgoCD via internal cluster DNS (argocd-server.argocd.svc.cluster.local) and calls back to ConfigHub

Because a single worker hosts all three bridges, one target — worker-kubernetes-yaml-cluster — is enough for discovery, rendering, and deployment via cub gitops discover / cub gitops import.

Access

Resource URL
ArgoCD UI http://localhost:9080
Username admin
Password cat var/argocd-admin-password.txt

To use kubectl directly:

export KUBECONFIG=$PWD/var/gitops-import.kubeconfig
kubectl get applications -n argocd

Importing into ConfigHub

Once the worker is running, you can import these applications into ConfigHub through the UI:

Go to the GitOps Import Link in the app navigation:

Link See the overview for an explanation of each step then proceed to the Discovery Step: Overview

Select ArgoCD Renderer as the import type and choose your discovery target (the kubernetes worker) and render target (the argocdrenderer worker) The default space is default but you can select another space or create a space on the fly for the temporary ArgoCD discovery unit. Then follow the wizard to bring your ArgoCD applications into ConfigHub: Discovery Step

What Happened
Configub creates a scratch unit that stores ArgoCD Applications as resources. Those resources use a ConfigHub function to extract and parse application resources then return a list of these resources to the UI. The UI will then display these resources in a table representing each ArgoCD Application.

Select the ArgoCD Applications for import: Select Apps

Import the applications: Import

Start the Configuration Renderering process to create rendered units that will be linked to the dry application units: Apply

View the apply results: Apply Result

What Happened
ConfigHub uses a dry unit → link → wet unit (a unit containing the rendered configuration) pipeline for rendering workflows (Helm, ArgoCD, Flux, etc.).
  • A dry unit is attached to a renderer bridge target and contains an ArgoCD Application resource that refers to the DRY configuration in git, such as Helm chart or kustomization. When Applied, its bridge worker renders a template (e.g., Helm chart → Kubernetes manifests) and returns the output as LiveState. No infrastructure is directly affected — the unit exists solely to produce rendered configuration.
  • A link connects a downstream wet unit (FromUnit) to an upstream dry unit (ToUnit). MergeUnits links are created with UseLiveState: true, meaning the wet unit receives the dry unit's rendered LiveState rather than its Data.
  • A wet unit receives rendered configuration through the link and applies it to live infrastructure (Kubernetes, ArgoCD CD, etc.). Its Data is populated by link resolution, not written directly.

Finally inspect a summary of all units created for the imported applications: Summary

Step by Step Tutorial

Further Reading