Skip to content

cub k8s source

cub k8s source

Find the ConfigHub source of a Kubernetes resource

Synopsis

Retrieve a Kubernetes resource and trace it back to its ConfigHub unit.

This command gets a Kubernetes resource and uses ConfigHub annotations to determine which unit manages the resource. It then opens a browser window to view the unit in the ConfigHub UI.

The resource must have ConfigHub annotations (confighub.com/UnitSlug and confighub.com/SpaceID) to be traced back to its source.

The kubeconfig file is loaded with the following precedence:

  1. --kubeconfig flag (highest priority, no merging)
  2. KUBECONFIG environment variable (merges multiple files)
  3. $HOME/.kube/config (default)

Examples:

  # Find the source of a deployment
  cub k8s source deployment my-app

  # Find the source of a deployment in a specific namespace
  cub k8s source deployment my-app --namespace my-namespace

  # Find the source of a cluster-scoped resource
  cub k8s source clusterrole my-role

  # Use a specific kubeconfig file
  cub k8s source deployment my-app --kubeconfig /path/to/config
cub k8s source <kind> <name> [flags]

Options

      --api-version string    API version of the resource (e.g., 'apps/v1', 'v1'). If not specified, common versions will be tried.
  -h, --help                  help for source
      --kube-context string   Kubernetes context to use
      --kubeconfig string     Path to the kubeconfig file to use for CLI requests
  -n, --namespace string      Namespace of the resource (ignored for cluster-scoped resources) (default "default")

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output

SEE ALSO