Skip to content

cub k8s collect

cub k8s collect

Collect facts from a Kubernetes cluster and store them on a Target

Synopsis

Collect facts about a Kubernetes cluster (version, CRDs, storage classes, ingress classes) and store them on a Target under the reserved "Cluster." fact prefix.

Collection owns the "Cluster." namespace: it (re)writes those facts and removes stale ones, while leaving user-defined facts (any key outside the prefix) untouched.

The kubeconfig is loaded with the same precedence as 'cub k8s source':

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

Examples:

  # Collect facts and store them on a target
  cub k8s collect --space my-space --kube-context kind-kind my-target

  # Preview the facts without updating any target
  cub k8s collect --kube-context kind-kind --dry-run
cub k8s collect [<target-slug-or-id>] [flags]

Options

      --cluster-name string   value for the Cluster.Name fact (defaults to the kube context name)
      --dry-run               print the collected facts without updating any target
  -h, --help                  help for collect
      --kube-context string   kubeconfig context of the cluster to collect facts from (defaults to the current context)
      --kubeconfig string     path to the kubeconfig file to use
      --space string          space ID to perform command on

Options inherited from parent commands

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

SEE ALSO