Extract the shared MachineImage, ClusterRelease and NodePoolRelease definitions into a catalog chart, preserving the NVKE controller’s default installation and ownership. Reuse canonical definitions across Helm, Kustomize, generation and CLI packaging.
Closes#2165
Created with AI assistance
Signed-off-by: Mark Stillwell <mstillwell@nvidia.com>
* chore: publish the controller chart as charts/controller
The last path segment of an OCI chart reference is the chart's `name:`, so
moving the artifact to ghcr.io/nvidia/nke/charts/controller means renaming
the chart itself: the directory, `name:` in Chart.yaml, and the
cloud-workflow-engine.* helper templates.
Renaming the chart would otherwise rename every object it owns, because the
name helper falls back to .Chart.Name. So nameOverride is pinned to
cloud-workflow-engine: it feeds app.kubernetes.io/name, every resource name
derived from the fullname template, and the serviceMonitor.matchLabels
selector, which would stop matching its Service on upgrade of an existing
release. The container name moves from .Chart.Name to the same helper for
the same reason -- a renamed container breaks every `kubectl logs -c` and
every log or metric selector keyed on it. Rendered output is unchanged
except for the helm.sh/chart label.
The NVCR mirror gains the `charts/` segment GHCR already had. Without it the
chart would land in nvcr.io/<org>/controller, the same OCI repository as the
controller image, told apart only by whether the tag carries a "v".
Charts published through controller/v0.1.1-rc.1 keep the old name and the
old path; nothing republishes them. The malware backfill scans those tags,
so it tries the new path and falls back to the old one.
Signed-off-by: Terry Howe <thowe@nvidia.com>
* fix(chart): resolve the helpers renamed with the chart package
configmap-auth.yaml and rbac-jwks-discovery.yaml landed on main after the
chart rename was branched, so they call the pre-rename helper names:
error calling include: template:
no template "cloud-workflow-engine.fullname" associated with template "gotpl"
_helpers.tpl had ended up with two naming schemes. The core helpers moved to
controller.* with the package, while the apiAuth.* helpers arrived afterwards
and kept the old prefix, so deployment.yaml still resolved and the breakage
was confined to the two newer templates.
Normalise all 16 references onto controller.*. Helper names are internal to
the chart, so rendered output is unchanged.
helm lint and kubeconform both pass on the broken chart because the failure
only appears with apiAuth.enabled=true, which the default render never
exercises. controller/hack/chart-auth-assertions.sh is what caught it.
* fix: repoint chart-path consumers after the rename
Consumers of controller/deploy/charts/cloud-workflow-engine that were added
to main after the chart rename was branched, so the rename never saw them:
make/checks.mk CHART, which four merge-gate targets read:
helm lint, chart render, chart-rbac-check
and chart-package-check
docs/README.md dangling link; hack/docs-check.sh fails on it
docs/architecture.md names the chart directory in prose
RELEASE.md says the chart publishes to
charts/cloud-workflow-engine
chart-auth-assertions.sh CHART fallback default
chart-package-assertions.sh CHART fallback default
Also moves nkectl's chart resolver. resolveChartPath joins the chart
directory literally and stats it, so bootstrap fails outright once the
directory moves. That is NKX-15142's story, but leaving it would put
nkectl-bootstrap-e2e red for no reason.
cweReleaseName and cweNamespace stay as they are. Those are deployed
identities, not paths, and this change moves nothing that runs.
Chart.yaml still described "the cloud-workflow-engine service" under
name: controller; the description is published with the chart.
* test(chart): guard the deployed identities the rename must preserve
The chart package is controller; everything it renders stays
cloud-workflow-engine, held there by nameOverride in values.yaml. That split
is permanent rather than transitional: existing sites keep the legacy runtime
naming indefinitely, and only new site installs take controller naming. So
"default values render the legacy names" is a durable invariant.
Nothing asserted it. Emptying nameOverride renames the container to
controller, changes app.kubernetes.io/name in the Deployment selector, and
renames six resources -- while helm lint, helm template and kubeconform all
still pass. Fleet dashboards select on container="cloud-workflow-engine", and
spec.selector is immutable once applied, so an upgrade would fail rather than
rename.
Adds chart-identity-check to chart-check. Verified by emptying the pin and
confirming the check fails with each of those findings.
Not asserted: helm.sh/chart and the "# Source:" comments. Both encode the
chart's own name by design and both moved with the package. Neither is a
selector or a consumer-visible identity, so rendered output is identical
apart from them -- confirmed against the pre-rename chart with default values
and with apiAuth.enabled=true.
Co-authored-by: Terry Howe <thowe@nvidia.com>
---------
Signed-off-by: Terry Howe <thowe@nvidia.com>
Co-authored-by: Terry Howe <thowe@nvidia.com>