cub variant upload
cub variant upload
Upload rendered Kubernetes resources into a Space as Units
Synopsis
Upload already-rendered Kubernetes manifests into a ConfigHub Space.
The input is a stream of rendered resources — from the installer, "kustomize build", or "helm template" — supplied as files, directories (walked for .yaml/.yml), or "-" for stdin. This command does not render anything; it ingests what you give it.
Resources become Units in one of two granularities (--granularity): minimal one Unit for everything, with CRDs split into their own Unit and each AppConfig file split into its own Unit set (the default). per-resource one Unit per resource.
In minimal mode the resources in the combined Unit are ordered by install priority (Namespaces, RBAC, config, then workloads) and by their references to one another. A Namespace resource is synthesized if --namespace is given and none is present. AppConfig ConfigMaps (carrying installer.confighub.com annotations) are expanded into an AppConfig data Unit, a render-configmap Invocation, a placeholder Unit, and an Upsert link. Rendered Secrets are never uploaded — apply them out-of-band.
Links between Units are inferred from references, label selectors, and custom-resource → CRD relationships. Because ConfigHub does not break dependency cycles, any cycle found in the ordering or the links is broken here — the weakest edge is dropped (a selector before a reference; a cross-scope reference before a same-namespace one) and the broken edge is reported.
The Space is created if missing and stamped with the well-known labels from --component, --variant, --environment, --region, --layer, and --owner. --component and --variant are required. The Space slug comes from --space-pattern (a Go template over .Labels), or from --space to set it explicitly.
Examples:
# Minimal upload of a kustomize build into a derived Space slug "web-base".
kustomize build overlays/base | cub variant upload --component web --variant base -
# One Unit per resource, into an explicit Space, bound to a target.
cub variant upload --component web --variant prod --space web-prod \
--granularity per-resource --target web-prod/cluster ./rendered/
# Helm output, ensuring a namespace and a regional label.
helm template myapp ./chart | cub variant upload --component myapp --variant prod \
--environment Prod --region us-east1 --namespace myapp -
cub variant upload [flags] <file|dir|-> [<file|dir> ...]
Options
--allow-exists tolerate Spaces, Units, Invocations, and Links that already exist (retry a partial upload)
--annotation strings annotation key=value to set on every created Unit (repeatable)
--change-desc string change description recorded on each created Unit
--component string value for the well-known "Component" Space label (required)
--environment string value for the well-known "Environment" Space label (e.g. Prod)
--granularity string how resources map to Units: minimal or per-resource (default "minimal")
-h, --help help for upload
--label strings label key=value to set on every created Unit (repeatable)
--layer string value for the well-known "Layer" Space label (e.g. App)
--namespace string ensure a Namespace resource with this name exists (unless "default")
--owner string value for the well-known "Owner" Space label (e.g. Engineering)
--region string value for the well-known "Region" Space label (e.g. us-east1)
--space string explicit Space slug; overrides --space-pattern
--space-pattern string Go template (prefix 'template:') for the Space slug, evaluated over .Labels (default "template:{{.Labels.Component}}-{{.Labels.Variant}}")
--target string target for the created Units, in <target-slug> or <space-slug>/<target-slug> form
--variant string value for the well-known "Variant" Space label (required)
Options inherited from parent commands
--context string The context to use for this command
--debug Debug output
SEE ALSO
- cub variant - Variant commands