From 52d8b147745a680a86830b158b907ea631b4e47d Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Thu, 15 Oct 2026 14:01:27 +0000 Subject: [PATCH 1/4] helm: add CRD sub-chart as operator dependency CRDs are shipped in a separate sub-chart (bootc-operator-crds) and declared as a Helm dependency of the operator chart. This keeps CRDs in templates/ so helm upgrade can update them, while preserving install/upgrade ordering automatically. The dependency is conditional on crds.install (default true), allowing users who manage CRDs separately to disable it. Assisted-by: AI Signed-off-by: Alice Frosi --- .gitignore | 3 +++ chart/bootc-operator-crds/.helmignore | 6 ++++++ chart/bootc-operator-crds/Chart.yaml | 14 ++++++++++++++ chart/bootc-operator/Chart.yaml | 5 +++++ chart/bootc-operator/values.yaml | 3 +++ hack/sync-helm.sh | 7 ++++--- 6 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 chart/bootc-operator-crds/.helmignore create mode 100644 chart/bootc-operator-crds/Chart.yaml diff --git a/.gitignore b/.gitignore index e048405..01dc05d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ kubeconfig-* docs/book/ user-docs chart/bootc-operator/crds/ +chart/bootc-operator/charts/ +chart/bootc-operator/Chart.lock +chart/bootc-operator-crds/templates/ chart/bootc-operator/templates/controller-clusterrole.yaml chart/bootc-operator/templates/daemon-clusterrole.yaml chart/bootc-operator/templates/leader-election-role.yaml diff --git a/chart/bootc-operator-crds/.helmignore b/chart/bootc-operator-crds/.helmignore new file mode 100644 index 0000000..fafdb7f --- /dev/null +++ b/chart/bootc-operator-crds/.helmignore @@ -0,0 +1,6 @@ +.DS_Store +.git/ +.gitignore +*.swp +*.bak +*.tmp diff --git a/chart/bootc-operator-crds/Chart.yaml b/chart/bootc-operator-crds/Chart.yaml new file mode 100644 index 0000000..5f817ae --- /dev/null +++ b/chart/bootc-operator-crds/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +name: bootc-operator-crds +description: CRDs for the bootc-operator +type: application +version: 0.1.0 +appVersion: "v0.1.1" +kubeVersion: ">= 1.34.0" +home: https://github.com/bootc-dev/bootc-operator +sources: + - https://github.com/bootc-dev/bootc-operator +keywords: + - bootc + - operator + - crd diff --git a/chart/bootc-operator/Chart.yaml b/chart/bootc-operator/Chart.yaml index 155c945..1aca653 100644 --- a/chart/bootc-operator/Chart.yaml +++ b/chart/bootc-operator/Chart.yaml @@ -13,3 +13,8 @@ keywords: - operator - os-update - node-management +dependencies: + - name: bootc-operator-crds + version: "0.1.0" + repository: "file://../bootc-operator-crds" + condition: crds.install diff --git a/chart/bootc-operator/values.yaml b/chart/bootc-operator/values.yaml index 31651db..9aaacc5 100644 --- a/chart/bootc-operator/values.yaml +++ b/chart/bootc-operator/values.yaml @@ -1,3 +1,6 @@ +crds: + install: true + image: repository: ghcr.io/bootc-dev/bootc-operator tag: "" diff --git a/hack/sync-helm.sh b/hack/sync-helm.sh index fd67a75..f55df97 100755 --- a/hack/sync-helm.sh +++ b/hack/sync-helm.sh @@ -7,14 +7,15 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" CHART_DIR="$REPO_ROOT/chart/bootc-operator" +CRD_CHART_DIR="$REPO_ROOT/chart/bootc-operator-crds" CONFIG_DIR="$REPO_ROOT/config" YQ="${YQ:-yq}" command -v "$YQ" >/dev/null 2>&1 || { echo "error: yq required (run: make yq)" >&2; exit 1; } -# --- CRDs --- -mkdir -p "$CHART_DIR/crds" -cp "$CONFIG_DIR"/crd/bases/*.yaml "$CHART_DIR/crds/" +# --- CRDs (separate chart) --- +mkdir -p "$CRD_CHART_DIR/templates" +cp "$CONFIG_DIR"/crd/bases/*.yaml "$CRD_CHART_DIR/templates/" echo "Synced CRDs" # --- RBAC --- From e37902ac56b48ea5ffa7af8d83c2634eaa5da6fd Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Thu, 15 Oct 2026 14:01:35 +0000 Subject: [PATCH 2/4] ci: publish CRD chart and build operator dependency Publish the CRD chart to the OCI registry before the operator chart. Run helm dependency build for the operator so the CRD sub-chart is bundled into the package. Sync the dependency version at release time. Assisted-by: AI Signed-off-by: Alice Frosi --- .github/workflows/helm.yaml | 3 ++- .github/workflows/release.yaml | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 9b470f0..4a9fa18 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -77,8 +77,9 @@ jobs: - name: Generate Helm chart run: make helm - - name: Install Helm chart + - name: Install Helm charts run: | + helm dependency build ./chart/bootc-operator helm install bootc-operator ./chart/bootc-operator \ --kubeconfig $(pwd)/kubeconfig-e2e \ --create-namespace --namespace bootc-operator \ diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d6d31bf..dc12749 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -131,7 +131,7 @@ jobs: TAG: ${{ steps.version.outputs.tag }} run: make release-manifest IMG="${IMAGE}:${TAG}" - - name: Package and push Helm chart + - name: Package and push Helm charts env: VERSION: ${{ steps.version.outputs.version }} TAG: ${{ steps.version.outputs.tag }} @@ -139,10 +139,18 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | make helm + helm registry login -u "${ACTOR}" -p "${GH_TOKEN}" ghcr.io + + ./bin/yq -i ".version = \"${VERSION}\"" chart/bootc-operator-crds/Chart.yaml + ./bin/yq -i ".appVersion = \"${TAG}\"" chart/bootc-operator-crds/Chart.yaml + helm package chart/bootc-operator-crds + helm push "bootc-operator-crds-${VERSION}.tgz" oci://ghcr.io/${{ github.repository }}/charts + ./bin/yq -i ".version = \"${VERSION}\"" chart/bootc-operator/Chart.yaml ./bin/yq -i ".appVersion = \"${TAG}\"" chart/bootc-operator/Chart.yaml + ./bin/yq -i ".dependencies[0].version = \"${VERSION}\"" chart/bootc-operator/Chart.yaml + helm dependency build chart/bootc-operator helm package chart/bootc-operator - helm registry login -u "${ACTOR}" -p "${GH_TOKEN}" ghcr.io helm push "bootc-operator-${VERSION}.tgz" oci://ghcr.io/${{ github.repository }}/charts - name: Create release From ce5b83539013be0ddd90dc6713ccee3cc1c71b8e Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Thu, 15 Oct 2026 14:01:42 +0000 Subject: [PATCH 3/4] docs: document Helm install and upgrade Document single-chart install and upgrade using the CRD dependency. Include instructions for managing CRDs separately with crds.install=false. Assisted-by: AI Signed-off-by: Alice Frosi --- docs/src/helm.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/src/helm.md b/docs/src/helm.md index ebb67c0..2de130d 100644 --- a/docs/src/helm.md +++ b/docs/src/helm.md @@ -7,6 +7,11 @@ ## Install +The operator chart includes the CRDs as a +[dependency](https://helm.sh/docs/helm/helm_dependency/). CRDs are +installed in a sub-chart (instead of the `crds/` directory) so that +`helm upgrade` can update them. + Install from the OCI registry: ```bash @@ -18,17 +23,26 @@ To install a specific version: ```bash helm install bootc-operator oci://ghcr.io/bootc-dev/bootc-operator/charts/bootc-operator \ - --version 0.1.0 \ - --create-namespace --namespace bootc-operator + --version 0.1.0 --create-namespace --namespace bootc-operator ``` Alternatively, install from a local checkout: ```bash +helm dependency build ./chart/bootc-operator helm install bootc-operator ./chart/bootc-operator \ --create-namespace --namespace bootc-operator ``` +To manage CRDs separately (e.g. with a GitOps tool), disable the +dependency and install the CRD chart on its own: + +```bash +helm install bootc-operator-crds oci://ghcr.io/bootc-dev/bootc-operator/charts/bootc-operator-crds +helm install bootc-operator oci://ghcr.io/bootc-dev/bootc-operator/charts/bootc-operator \ + --create-namespace --namespace bootc-operator --set crds.install=false +``` + By default the chart uses the image `ghcr.io/bootc-dev/bootc-operator:` where `appVersion` is defined in `Chart.yaml`. @@ -88,6 +102,16 @@ kubectl create secret generic my-pull-secret \ --type=kubernetes.io/dockerconfigjson ``` +## Upgrade + +```bash +helm upgrade bootc-operator oci://ghcr.io/bootc-dev/bootc-operator/charts/bootc-operator \ + --version --namespace bootc-operator +``` + +Replace `` with the chart version (e.g. `0.2.0`). The CRD +sub-chart is upgraded automatically. + ## Regenerating the chart Most Helm templates are generated from the kustomize manifests. After @@ -102,6 +126,7 @@ make helm | Key | Default | Description | |-----|---------|-------------| +| `crds.install` | `true` | Install the CRD sub-chart | | `image.repository` | `ghcr.io/bootc-dev/bootc-operator` | Operator image repository | | `image.tag` | `""` (uses `appVersion`) | Operator image tag | | `image.pullPolicy` | not set | Kubernetes image pull policy | From 3fe0fc9d792b59e249a2ea94356c584d917bcabf Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Thu, 15 Oct 2026 14:01:48 +0000 Subject: [PATCH 4/4] docs: add Helm uninstall instructions Assisted-by: AI Signed-off-by: Alice Frosi --- docs/src/helm.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/src/helm.md b/docs/src/helm.md index 2de130d..91a73e4 100644 --- a/docs/src/helm.md +++ b/docs/src/helm.md @@ -112,6 +112,15 @@ helm upgrade bootc-operator oci://ghcr.io/bootc-dev/bootc-operator/charts/bootc- Replace `` with the chart version (e.g. `0.2.0`). The CRD sub-chart is upgraded automatically. +## Uninstall + +```bash +helm uninstall bootc-operator --namespace bootc-operator +``` + +> **Warning**: uninstalling the chart also removes the CRDs and all +> their instances cluster-wide. + ## Regenerating the chart Most Helm templates are generated from the kustomize manifests. After