Skip to content

helm/v2-alpha: Add optional flag to generate a separate CRD chart (subchart/sibling chart) following Helm best practices #5391

@camilamacedo86

Description

@camilamacedo86

Add an optional mode/flag to scaffold a separate chart for CRDs (as a subchart or sibling chart). This is intended for advanced use cases and to align with Helm best practices around CRD installation and chart ordering.

References:

Motivation

Today the Helm plugin places CRDs under templates/crd so Helm applies them like normal resources and upgrades them (Helm’s crds/ directory installs once and does not manage upgrades). This is intentional.

However, there are common operational needs where users want:

  • CRDs installed ahead of everything else (and potentially by cluster admins)
  • a clean separation between “cluster-scoped API installation” (CRDs) and “namespaced operator installation”
  • the ability to install CRs after CRDs are registered (without relying on hooks)

Helm docs explicitly describe the “separate charts” approach for CRDs/resources ordering.

Proposed feature

Introduce an optional flag/mode for the Helm plugin, for example:

  • kubebuilder edit --plugins=helm/v2-alpha --crd-chart

Expected output (one possible layout)

subchart dependency

  • dist/chart/
    • charts/<project>-crds/ (CRDs only, installed separately or as dependency)
    • (document recommended install ordering)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions