Skip to content
English
  • There are no suggestions because the search field is empty.

Configuring Custom Resources' Owner References to Render in the ArgoCD UI

How Argo CD accurately displays standard Kubernetes resource hierarchies using ownerReferences metadata

Argo CD builds its Resource Tree in the UI by inspecting Kubernetes resource relationships. These relationships are typically defined using the ownerReferences field in each resource’s metadata. While this works out of the box for standard Kubernetes resources (e.g., Deployment → ReplicaSet → Pod), you may notice that Custom Resource Definitions (CRDs) or operator-managed resources don’t always appear with their correct parent-child relationships in Argo CD.

How Relationships Work in Kubernetes

Kubernetes provides the ownerReferences field inside resource metadata. This field defines a parent/child hierarchy:

  • Parent resource: The resource that owns one or more children.

  • Child resource: A resource that lists its parent under ownerReferences.

For example, in native Kubernetes:

  • A Deployment sets itself as the owner of a ReplicaSet.

  • That ReplicaSet then sets itself as the owner of the managed Pods.

Argo CD uses these references to render the Resource Tree in the UI.

The Problem With CRDs

When working with Custom Resources (CRs) and operators, such as Prometheus (from the Prometheus Operator) custom resources, you might already see ownerReferences properly set in the manifests. However, Argo CD does not automatically understand how these CRDs fit into the resource tree hierarchy.

Even if the owner references are present (as shown in the screenshot with a StatefulSet owned by a Prometheus CR), Argo CD does not render the relationship unless explicitly configured.

Why This Happens

Argo CD only has built-in knowledge of native Kubernetes controllers (e.g., Deployment, StatefulSet, Job). For CRDs, Argo CD does not know the parent/child mappings out of the box. This results in:

  • Child resources being shown at the top level instead of under their parent.

  • Missing hierarchy in the UI.

Key Takeaways

  • Argo CD can track and sync Custom Resources (CRs) produced by CRDs the same way it tracks core K8s objects.

  • Ensure that your operator/controller correctly sets ownerReferences in created resources.

  • After configuration, the Argo CD UI will show the expected parent-child tree for your custom resources.

Example Use Case

  • A Prometheus CR creates a StatefulSet and Service.

  • Without customization → Argo CD shows them as top-level resources.

  • With customization → Argo CD displays them nested under the Prometheus CR.


Related Links: