GitOps Integration
Shoehorn integrates with ArgoCD and FluxCD to provide visibility into GitOps deployments across your Kubernetes clusters.
Overview
Section titled “Overview”When GitOps discovery is enabled, the K8s agent watches GitOps custom resources (CRDs) and pushes sync status, health, and drift information to Shoehorn. This gives you a unified view of all GitOps-managed deployments alongside your service catalog.
Supported Tools
Section titled “Supported Tools”ArgoCD
Section titled “ArgoCD”The agent watches Application resources from argoproj.io/v1alpha1:
- Sync status: Synced, OutOfSync, Unknown
- Health status: Healthy, Progressing, Degraded, Suspended, Missing
- Source URL: Git repository
- Revision: Current and target revisions
- Auto-sync: Whether auto-sync is enabled
FluxCD
Section titled “FluxCD”The agent watches multiple FluxCD CRDs:
| CRD | Group | Purpose |
|---|---|---|
Kustomization |
kustomize.toolkit.fluxcd.io/v1 |
Kustomize deployments |
HelmRelease |
helm.toolkit.fluxcd.io/v2 |
Helm chart deployments |
GitRepository |
source.toolkit.fluxcd.io/v1 |
Git source tracking |
For FluxCD, drift detection compares lastAppliedRevision vs lastAttemptedRevision to identify stuck reconciliations.
Enabling GitOps Discovery
Section titled “Enabling GitOps Discovery”In your K8s agent values file:
agent: gitops: argocd: enabled: true # the one switch to turn on ArgoCD namespace: argocd # where Application CRs live serverURL: https://argocd.example.com # optional: enables Sync/Refresh in the UI token: "" # optional: set via secret, for Sync/RefreshUse fluxcd.enabled: true for Flux. (The older gitops.tool: argocd setting still works, but enabled is clearer.) If you set the ArgoCD credentials without enabling ArgoCD, the chart fails the install with a clear message instead of doing nothing.
The agent watches without a token (read-only). With a token it can also drive sync and refresh from the Shoehorn UI. Generate one with:
argocd account generate-token --account shoehornThe Helm chart adds the CRD-read RBAC automatically when a tool is enabled.
Terraform module
Section titled “Terraform module”The shoehorn-kubernetes Terraform module exposes these as first-class variables:
| Variable | Purpose |
|---|---|
agent_gitops_tool |
argocd or fluxcd |
argocd_namespace |
Defaults to argocd |
argocd_server_url |
Public ArgoCD URL |
argocd_token |
Sensitive. Wires the token into the agent secret. |
Viewing GitOps Resources
Section titled “Viewing GitOps Resources”Operations
Section titled “Operations”The GitOps drift card on Operations counts the Argo CD and Flux apps that are out of sync. Click it, or open the Drifting view, to list the workloads those apps manage.
Some out-of-sync apps have no workloads in Shoehorn. They’re listed under the table in Out-of-sync apps without workloads, each with the reason:
| Reason | What it means |
|---|---|
| Nothing deployed | The app lists workloads that aren’t on the cluster. Argo CD usually reports the app as Missing. |
| Outside watched namespaces | Shoehorn sees nothing in the namespace the app’s workloads run in, so the agent probably doesn’t watch it. See Namespace Filtering. |
| No workloads listed | Argo CD or Flux lists no workloads for the app, for example an app that only manages ConfigMaps. |
| Workload kind not shown yet | The app deploys a kind Shoehorn doesn’t show as a workload yet, such as an Argo Rollout. |
| Contents unknown | A Flux HelmRelease. Flux doesn’t list what a HelmRelease deploys. |
| Agent needs an update | The cluster’s agent is too old to report what the app deploys. |
An Argo CD app links to Argo CD when the agent reports an https server address a browser can reach (serverURL in the agent values). Otherwise it links to the source repository. A Flux app shows its source reference.
From the CLI, shoehorn get gitops --without-workloads lists the same apps with their reason.
When an app is deleted
Section titled “When an app is deleted”When you delete an Argo CD Application, Flux Kustomization or HelmRelease, it leaves Shoehorn after the agent’s next GitOps push. That includes apps deleted while the agent was down and the last app on a cluster. If the cluster doesn’t serve a GitOps CRD at all (for example Flux without helm-controller), the agent treats it as having no apps.
This needs an agent with the snapshot fix. An older agent keeps deleted apps in Shoehorn until you upgrade it.
Entity Detail View
Section titled “Entity Detail View”For entities linked to GitOps resources, the Operations tab shows:
- Current sync and health status
- Source repository and revision
- Last sync time
- Drift detection alerts
Entity Linking
Section titled “Entity Linking”GitOps resources are automatically linked to catalog entities using:
- Annotation match: The resource has a
shoehorn.dev/entity: <service-id>annotation - Name match: The resource name matches an entity’s service ID
You can also manually link resources to entities in the UI.
GitOps Commands
Section titled “GitOps Commands”From the Shoehorn UI, you can trigger GitOps operations:
- Sync: Request a sync for an ArgoCD Application or FluxCD Kustomization
- Refresh: Force a refresh of the resource state
Commands are queued and picked up by the K8s agent on its next poll cycle (typically within 30 seconds).
Stats and Monitoring
Section titled “Stats and Monitoring”The GitOps Stats endpoint provides aggregate counts:
| Metric | Description |
|---|---|
| Total | All tracked GitOps resources |
| Synced | Resources in sync |
| Out of Sync | Resources with pending changes |
| Failed | Resources in error state |
| Suspended | Manually suspended resources |
Stats are cached for 30 seconds per tenant and refreshed on each agent push.