From e9f55708e9cdbda4dff73e38f879cd1ed57b1f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sat, 24 Oct 2026 01:00:06 +0200 Subject: [PATCH 01/12] Document the OCI registry as the default Helm chart source Makes oci://ghcr.io/apache/solr-operator/helm the documented way to install both charts, and marks the HTTPS Helm repository at https://solr.apache.org/charts as deprecated. Installing from an OCI registry needs no 'helm repo add' and no credentials. Charts are published to both the OCI registry and the HTTPS repository throughout the 0.x releases, so nobody has to change anything on a patch upgrade. Starting with v1.0.0, charts will be published to the OCI registry only. A major version is the natural place to drop the old channel, and it gives users a version-anchored deadline rather than a date that slips with the release schedule. Artifact Hub still indexes the HTTPS repository. Migrating it would need one repo entry per chart and would change every existing artifacthub.io/packages/helm/apache-solr/... URL, so it is better done as part of the v1.0.0 cutover. Dual publishing keeps the current Artifact Hub entry accurate in the meantime. Requires the publishing tooling to be in place and the ghcr.io packages to be public first. Fixes #813 --- README.md | 7 ++- .../getting-started/pages/local-tutorial.adoc | 24 ++++---- .../pages/running-the-operator.adoc | 28 ++++++--- .../upgrade-notes/pages/upgrade-notes.adoc | 34 ++++++++++- helm/solr-operator/README.md | 57 +++++++++++++++---- helm/solr/README.md | 20 ++++++- 6 files changed, 136 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index d3a0f36e4..2bf751a78 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,12 @@ Join us on the [#solr-operator](https://kubernetes.slack.com/messages/solr-opera Please visit the following pages for documentation on using and developing the Solr Operator: - [Local Tutorial](https://solr.apache.org/guide/operator/latest/getting-started/local-tutorial.html) -- [Helm Instructions via Artifact Hub](https://artifacthub.io/packages/helm/apache-solr/solr-operator) +- **Helm Chart Installation** + - The Helm charts are published as OCI artifacts (recommended): + - **Solr Operator**: `helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version ` + - **Solr Cloud**: `helm install solr oci://ghcr.io/apache/solr-operator/helm/solr --version ` + - Or via the deprecated HTTPS repository: [Helm Instructions via Artifact Hub](https://artifacthub.io/packages/helm/apache-solr/solr-operator) + - Charts are published to both locations throughout the 0.x releases. Starting with `v1.0.0`, charts will be published to the OCI registry only. - The released helm charts and their instructions should be used for all safe and stable deployments. The charts found in `helm/` are not guaranteed to be compatible with the last stable release, and should only be used for development purposes. - [Running the Solr Operator](https://solr.apache.org/guide/operator/latest/getting-started/running-the-operator.html) diff --git a/docs/modules/getting-started/pages/local-tutorial.adoc b/docs/modules/getting-started/pages/local-tutorial.adoc index c1da57b9d..42a86a50c 100644 --- a/docs/modules/getting-started/pages/local-tutorial.adoc +++ b/docs/modules/getting-started/pages/local-tutorial.adoc @@ -79,15 +79,10 @@ You can follow along here, or follow the instructions in the https://artifacthub Now that we have the prerequisites setup, let us install Solr Operator which will let us easily manage a large Solr cluster: -Now add the Solr Operator Helm repository. (You should only need to do this once) +The Helm charts are published to the GitHub Container Registry as OCI artifacts, so there is +no Helm repository to add and no credentials to configure. -[source,bash] ----- -$ helm repo add apache-solr https://solr.apache.org/charts -$ helm repo update ----- - -Next, install the Solr Operator chart. Note this is using Helm v3, in order to use Helm v2 please consult the https://hub.helm.sh/charts/solr-operator/solr-operator[Helm Chart documentation]. +Install the Solr Operator chart with the commands below. This will install the https://github.com/pravega/zookeeper-operator[Zookeeper Operator] by default. [source,bash,subs="verbatim,attributes"] @@ -95,9 +90,16 @@ This will install the https://github.com/pravega/zookeeper-operator[Zookeeper Op # Install the Solr & Zookeeper CRDs $ kubectl create -f https://solr.apache.org/operator/downloads/crds/v{operator-version}/all-with-dependencies.yaml # Install the Solr operator and Zookeeper Operator -$ helm install solr-operator apache-solr/solr-operator --version {operator-version} +$ helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version {operator-version} ---- +[NOTE] +==== +The charts are also still served from the HTTPS Helm repository at `https://solr.apache.org/charts`, +which is deprecated. Charts are published to both locations throughout the 0.x releases. +Starting with `v1.0.0`, charts will be published to the OCI registry only. +==== + _Note that the Helm chart version does not contain a `v` prefix, which the downloads version does. The Helm chart version is the only part of the Solr Operator release that does not use the `v` prefix._ After installing, you can check to see what lives in the cluster to make sure that the Solr and ZooKeeper operators have started correctly. @@ -128,7 +130,7 @@ To start a Solr Cloud cluster, we will create a yaml that will tell the Solr Ope [source,bash,subs="verbatim,attributes"] ---- # Create a 3-node cluster v9.10.0 with 300m Heap each: -helm install example-solr apache-solr/solr --version {operator-version} \ +helm install example-solr oci://ghcr.io/apache/solr-operator/helm/solr --version {operator-version} \ --set image.tag=9.10.0 \ --set solrOptions.javaMemory="-Xms300m -Xmx300m" \ --set addressability.external.method=Ingress \ @@ -224,7 +226,7 @@ So we wish to upgrade to a newer Solr version: curl -s http://default-example-solrcloud.ing.local.domain/solr/admin/info/system | grep solr-i # Update the solrCloud configuration with the new version, keeping all previous settings and the number of nodes set by the autoscaler. -helm upgrade example-solr apache-solr/solr --version {operator-version} \ +helm upgrade example-solr oci://ghcr.io/apache/solr-operator/helm/solr --version {operator-version} \ --reuse-values \ --set image.tag=9.10.0 diff --git a/docs/modules/getting-started/pages/running-the-operator.adoc b/docs/modules/getting-started/pages/running-the-operator.adoc index 93fc388a4..82f0486f2 100644 --- a/docs/modules/getting-started/pages/running-the-operator.adoc +++ b/docs/modules/getting-started/pages/running-the-operator.adoc @@ -26,23 +26,33 @@ The helm chart provides abstractions over the Input Arguments described below, a The official documentation for installing the Solr Operator Helm chart can be found on https://artifacthub.io/packages/helm/apache-solr/solr-operator[Artifact Hub]. -The first step is to add the Solr Operator helm repository. +The chart is published to the GitHub Container Registry as an OCI artifact. +Nothing needs to be added or configured first, and no credentials are required. -[source,bash] +Install the Solr Operator chart with the command below. +This will install the https://github.com/pravega/zookeeper-operator[Zookeeper Operator] by default. + +[source,bash,subs="verbatim,attributes"] ---- -$ helm repo add apache-solr https://solr.apache.org/charts -$ helm repo update +$ kubectl create -f https://solr.apache.org/operator/downloads/crds/v{operator-version}/all-with-dependencies.yaml +$ helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version {operator-version} ---- -Next, install the Solr Operator chart. Note this is using Helm v3, use the official Helm chart documentation linked to above. -This will install the https://github.com/pravega/zookeeper-operator[Zookeeper Operator] by default. +[NOTE] +==== +The chart is also still served from the HTTPS Helm repository at `https://solr.apache.org/charts`, which is deprecated: [source,bash,subs="verbatim,attributes"] ---- -$ kubectl create -f https://solr.apache.org/operator/downloads/crds/v{operator-version}/all-with-dependencies.yaml +$ helm repo add apache-solr https://solr.apache.org/charts +$ helm repo update $ helm install solr-operator apache-solr/solr-operator --version {operator-version} ---- +Charts are published to both locations throughout the 0.x releases. +Starting with `v1.0.0`, charts will be published to the OCI registry only. +==== + _Note that the Helm chart version does not contain a `v` prefix, which the downloads version does. The Helm chart version is the only part of the Solr Operator release that does not use the `v` prefix._ After installing, you can check to see what lives in the cluster to make sure that the Solr and ZooKeeper operators have started correctly. @@ -73,9 +83,9 @@ Helm 3 automatically installs the Solr CRDs in the /crds directory, so no furthe If you have solr operator installations in multiple namespaces that are managed separately, you will likely want to skip installing CRDs when installing the chart. This can be done with the `--skip-crds` helm option. -[source,bash] +[source,bash,subs="verbatim,attributes"] ---- -helm install solr-operator apache-solr/solr-operator --skip-crds --namespace solr +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version {operator-version} --skip-crds --namespace solr ---- *Helm will not upgrade CRDs once they have been installed. diff --git a/docs/modules/upgrade-notes/pages/upgrade-notes.adoc b/docs/modules/upgrade-notes/pages/upgrade-notes.adoc index e0d5a26cf..7b710a02f 100644 --- a/docs/modules/upgrade-notes/pages/upgrade-notes.adoc +++ b/docs/modules/upgrade-notes/pages/upgrade-notes.adoc @@ -97,6 +97,31 @@ It is always encouraged to upgrade to the latest patch version of the minor and There is no need to upgrade one patch version at a time (e.g. `v0.2.5` -> `v0.2.6` -> `v0.2.7` -> `v0.2.8`), instead you can leap to the latest patch version (e.g. `v0.2.5` -> `v0.2.8`). +[#where-the-helm-charts-are-published] +== Where the Helm charts are published + +The Solr Operator and Solr Helm charts are published as OCI artifacts to the GitHub Container Registry: + +[source,bash,subs="verbatim,attributes"] +---- +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version {operator-version} +helm install example oci://ghcr.io/apache/solr-operator/helm/solr --version {operator-version} +---- + +Installing from an OCI registry requires no `helm repo add`, and no credentials. + +[WARNING] +==== +The HTTPS Helm repository at `https://solr.apache.org/charts` is *deprecated*. + +Charts are published to both the OCI registry and the HTTPS repository throughout the 0.x releases, +so there is no rush to migrate. Starting with `v1.0.0`, charts will be published to the OCI registry +only, and the HTTPS repository will receive no further releases. + +If you install or upgrade the charts through automation, update it to use the `oci://` URLs above +before upgrading to `v1.0.0`. +==== + == Installing the Solr Operator vs Solr CRDs Installing the Solr Operator, especially via the https://artifacthub.io/packages/helm/apache-solr/solr-operator[Helm Chart], @@ -127,7 +152,7 @@ If you are using the Solr Helm chart to deploy the Zookeeper operator, then you ---- # Just replace the Solr CRDs and all CRDs it might depend on (e.g. ZookeeperCluster) kubectl replace -f "http://solr.apache.org/operator/downloads/crds/v{operator-version}/all-with-dependencies.yaml" -helm upgrade solr-operator apache-solr/solr-operator --version {operator-version} +helm upgrade solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version {operator-version} ---- _Note that the Helm chart version does not contain a `v` prefix, which the downloads version does. The Helm chart version is the only part of the Solr Operator release that does not use the `v` prefix._ @@ -136,6 +161,13 @@ _Note that the Helm chart version does not contain a `v` prefix, which the downl === v0.10.0 +* *Helm charts are now published to an OCI registry* ++ +The charts are published as OCI artifacts to `oci://ghcr.io/apache/solr-operator/helm`, alongside the +existing HTTPS Helm repository. The HTTPS repository at `https://solr.apache.org/charts` is deprecated +and will receive no further releases starting with `v1.0.0`. +See <>. + * *Logging now defaults to JSON format* + The new default for CLI flag `--zap-devel` is now `false`, causing log encoding to be `json` and log level to be `info`. diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md index 79acc1a40..3d290d620 100644 --- a/helm/solr-operator/README.md +++ b/helm/solr-operator/README.md @@ -31,19 +31,39 @@ If you do not wish to use the Zookeeper Operator, set: - `zookeeper-operator.use: false` -### Adding the Solr Operator Helm Chart Repository -You should only need to add the solr operator helm chart repository once, by running the following command: +### Installing the Chart + +The Solr Operator Helm chart can be installed either from the OCI registry (recommended) or from the deprecated HTTPS repository. + +> **Note:** The HTTPS Helm repository at `https://solr.apache.org/charts` is deprecated. +> Charts are published to both locations throughout the 0.x releases. +> Starting with `v1.0.0`, charts will be published to the OCI registry only. + +#### Installation via OCI Registry (Recommended) + +The Helm chart is published to the GitHub Container Registry as an OCI artifact. +No repository needs to be added, and no credentials are required. ```bash -helm repo add apache-solr https://solr.apache.org/charts +# Install CRDs first +kubectl create -f https://solr.apache.org/operator/downloads/crds/v0.10.0-prerelease/all-with-dependencies.yaml + +# Install the Solr Operator from OCI registry +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version 0.10.0-prerelease ``` -### Installing the Chart +#### Installation via HTTPS Repository (Deprecated) -To install the Solr Operator for the first time in your cluster, you can use the latest version or a specific version, run with the following commands: +The chart is also still served from the deprecated HTTPS Helm repository. ```bash +# Add the repository (only needed once) +helm repo add apache-solr https://solr.apache.org/charts + +# Install CRDs first kubectl create -f https://solr.apache.org/operator/downloads/crds/v0.10.0-prerelease/all-with-dependencies.yaml + +# Install the Solr Operator from the HTTPS repository helm install solr-operator apache-solr/solr-operator --version 0.10.0-prerelease ``` @@ -57,7 +77,14 @@ _Note that the Helm chart version does not contain a `v` prefix, which the downl If you are upgrading your Solr Operator deployment, you should always use a specific version of the chart and pre-install the Solr CRDS: ```bash +# Upgrade the CRDs first, then the chart kubectl replace -f https://solr.apache.org/operator/downloads/crds/v0.10.0-prerelease/all-with-dependencies.yaml +helm upgrade solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version 0.10.0-prerelease +``` + +Or, from the deprecated HTTPS repository: + +```bash helm upgrade solr-operator apache-solr/solr-operator --version 0.10.0-prerelease ``` @@ -67,18 +94,20 @@ If you want to specify the namespace for the installation, use the `--namespace` All resources will be deployed to the given namespace. ```bash -helm install solr-operator apache-solr/solr-operator --namespace solr +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version 0.10.0-prerelease --namespace solr ``` If you want to only watch that namespace, or others, then you will have to provide the `watchNamespaces` option. ```bash # Watch the namespace where the operator is deployed to (just pass the boolean true) -helm install solr-operator apache-solr/solr-operator --namespace solr --set watchNamespaces=true +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version 0.10.0-prerelease --namespace solr --set watchNamespaces=true + # Watch a single namespace different than the one being deployed to -helm install solr-operator apache-solr/solr-operator --namespace solr --set watchNamespaces=other -# Watch multiple namespaces (commmas must be escaped in the set string) -helm install solr-operator apache-solr/solr-operator --namespace solr --set watchNamespaces="team1\,team2\,team3" +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version 0.10.0-prerelease --namespace solr --set watchNamespaces=other + +# Watch multiple namespaces (commas must be escaped in the set string) +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version 0.10.0-prerelease --namespace solr --set watchNamespaces="team1\,team2\,team3" ``` Note: Passing `false` or `""` to the `watchNamespaces` variable will both result in the operator watchting all namespaces in the Kube cluster. @@ -91,7 +120,13 @@ If you have solr operator installations in multiple namespaces that are managed This can be done with the `--skip-crds` helm option. ```bash -helm install solr-operator apache-solr/solr-operator --skip-crds --namespace solr +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version 0.10.0-prerelease --skip-crds --namespace solr +``` + +Or, from the deprecated HTTPS repository: + +```bash +helm install solr-operator apache-solr/solr-operator --version 0.10.0-prerelease --skip-crds --namespace solr ``` **Helm will not upgrade CRDs once they have been installed. diff --git a/helm/solr/README.md b/helm/solr/README.md index 52eaa4cf3..949569773 100644 --- a/helm/solr/README.md +++ b/helm/solr/README.md @@ -33,7 +33,19 @@ There may be breaking changes between the version you are using and the version ### Installing the Chart -To install a SolrCloud for the first time in your cluster, you can use the latest version or a specific version, run with the following commands: +The Solr Helm chart can be installed either from the OCI registry (recommended) or from the deprecated HTTPS helm repository. + +> **Note:** The HTTPS Helm repository at `https://solr.apache.org/charts` is deprecated. +> Charts are published to both locations throughout the 0.x releases. +> Starting with `v1.0.0`, charts will be published to the OCI registry only. + +To install a SolrCloud for the first time in your cluster, you can use the latest version or a specific version: + +```bash +helm install example oci://ghcr.io/apache/solr-operator/helm/solr --version 0.10.0-prerelease --set image.tag=9.10.0 +``` + +Or, from the deprecated HTTPS Helm repository: ```bash helm install example apache-solr/solr --version 0.10.0-prerelease --set image.tag=9.10.0 @@ -49,6 +61,12 @@ _Note that the Helm chart version does not contain a `v` prefix, which the Solr If you are upgrading your SolrCloud deployment, you should always use a specific version of the chart and upgrade **after [upgrading the Solr Operator](https://artifacthub.io/packages/helm/apache-solr/solr-operator#upgrading-the-solr-operator) to the same version**: +```bash +helm upgrade example oci://ghcr.io/apache/solr-operator/helm/solr --version 0.10.0-prerelease --reuse-values --set image.tag=9.10.0 +``` + +Or, from the deprecated HTTPS Helm repository: + ```bash helm upgrade example apache-solr/solr --version 0.10.0-prerelease --reuse-values --set image.tag=9.10.0 ``` From 4a00a35aff1de013357543db62f309f417076fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sat, 24 Oct 2026 14:35:51 +0200 Subject: [PATCH 02/12] Add Artifact Hub changelog entries, and stop pointing at Artifact Hub for install docs Both charts gain 'added' and 'deprecated' artifacthub.io/changes entries for the OCI switch, so the change shows up in the Artifact Hub changelog for v0.10.0. running-the-operator.adoc called Artifact Hub "the official documentation for installing the Solr Operator Helm chart" a few lines above the text deprecating the HTTPS repository. Artifact Hub generates its install snippet from how the repository is registered, which is still the HTTPS Helm repo, so it contradicted the page it was on. Artifact Hub is now referenced once, as the place the chart's values and changelog are listed, with a note that its install command still uses the deprecated repository. --- .../getting-started/pages/running-the-operator.adoc | 5 +++-- helm/solr-operator/Chart.yaml | 12 ++++++++++++ helm/solr/Chart.yaml | 12 ++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/modules/getting-started/pages/running-the-operator.adoc b/docs/modules/getting-started/pages/running-the-operator.adoc index 82f0486f2..702fc2bc8 100644 --- a/docs/modules/getting-started/pages/running-the-operator.adoc +++ b/docs/modules/getting-started/pages/running-the-operator.adoc @@ -18,13 +18,14 @@ == Using the Solr Operator Helm Chart -The easiest way to run the Solr Operator is via the https://artifacthub.io/packages/helm/apache-solr/solr-operator[provided Helm Chart]. +The easiest way to run the Solr Operator is via the provided Helm Chart. The helm chart provides abstractions over the Input Arguments described below, and should work with any official images in docker hub. === How to install via Helm -The official documentation for installing the Solr Operator Helm chart can be found on https://artifacthub.io/packages/helm/apache-solr/solr-operator[Artifact Hub]. +The chart's values and changelog are listed on https://artifacthub.io/packages/helm/apache-solr/solr-operator[Artifact Hub], +though the install command shown there still uses the deprecated HTTPS Helm repository. The chart is published to the GitHub Container Registry as an OCI artifact. Nothing needs to be added or configured first, and no credentials are required. diff --git a/helm/solr-operator/Chart.yaml b/helm/solr-operator/Chart.yaml index 1088131b2..f078bf00b 100644 --- a/helm/solr-operator/Chart.yaml +++ b/helm/solr-operator/Chart.yaml @@ -138,6 +138,18 @@ annotations: url: https://github.com/apache/solr-operator/issues/535 - name: GitHub PR url: https://github.com/apache/solr-operator/pull/571 + - kind: added + description: The Helm charts are now also published as OCI artifacts to oci://ghcr.io/apache/solr-operator/helm, which needs no `helm repo add` and no credentials + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/813 + - name: Github PR + url: https://github.com/apache/solr-operator/pull/814 + - kind: deprecated + description: The HTTPS Helm repository at https://solr.apache.org/charts is deprecated. Charts are published to both it and the OCI registry throughout the 0.x releases, but starting with v1.0.0 they will be published to the OCI registry only + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/813 artifacthub.io/images: | - name: solr-operator image: apache/solr-operator:v0.10.0-prerelease diff --git a/helm/solr/Chart.yaml b/helm/solr/Chart.yaml index 29a4bafbf..192db5d32 100644 --- a/helm/solr/Chart.yaml +++ b/helm/solr/Chart.yaml @@ -60,6 +60,18 @@ annotations: url: https://github.com/apache/solr-operator/issues/338 - name: Github PR url: https://github.com/apache/solr-operator/pull/832 + - kind: added + description: The Helm charts are now also published as OCI artifacts to oci://ghcr.io/apache/solr-operator/helm, which needs no `helm repo add` and no credentials + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/813 + - name: Github PR + url: https://github.com/apache/solr-operator/pull/814 + - kind: deprecated + description: The HTTPS Helm repository at https://solr.apache.org/charts is deprecated. Charts are published to both it and the OCI registry throughout the 0.x releases, but starting with v1.0.0 they will be published to the OCI registry only + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/813 artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/recommendations: | - url: https://artifacthub.io/packages/helm/apache-solr/solr-operator From b3a293c5c7c81d183939755f66f8b21dc863aa6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sat, 24 Oct 2026 15:52:51 +0200 Subject: [PATCH 03/12] Small doc fix --- docs/modules/getting-started/pages/running-the-operator.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/modules/getting-started/pages/running-the-operator.adoc b/docs/modules/getting-started/pages/running-the-operator.adoc index 702fc2bc8..1518af14f 100644 --- a/docs/modules/getting-started/pages/running-the-operator.adoc +++ b/docs/modules/getting-started/pages/running-the-operator.adoc @@ -24,8 +24,7 @@ The helm chart provides abstractions over the Input Arguments described below, a === How to install via Helm -The chart's values and changelog are listed on https://artifacthub.io/packages/helm/apache-solr/solr-operator[Artifact Hub], -though the install command shown there still uses the deprecated HTTPS Helm repository. +The chart's values and changelog are listed on https://artifacthub.io/packages/helm/apache-solr/solr-operator[Artifact Hub]. The chart is published to the GitHub Container Registry as an OCI artifact. Nothing needs to be added or configured first, and no credentials are required. From 0cb5fc1d6387fe6c17224f1ad822ea42056a1b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sun, 25 Oct 2026 15:49:02 +0100 Subject: [PATCH 04/12] Revise instructions for adding Apache Solr Helm repo Update Helm repository instructions for Apache Solr. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- helm/solr/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/helm/solr/README.md b/helm/solr/README.md index 949569773..0707caf72 100644 --- a/helm/solr/README.md +++ b/helm/solr/README.md @@ -48,6 +48,7 @@ helm install example oci://ghcr.io/apache/solr-operator/helm/solr --version 0.10 Or, from the deprecated HTTPS Helm repository: ```bash +helm repo add apache-solr https://solr.apache.org/charts helm install example apache-solr/solr --version 0.10.0-prerelease --set image.tag=9.10.0 ``` From ce830b9d673a0d94d09365c53fb35a4e87c7a5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sun, 25 Oct 2026 15:53:17 +0100 Subject: [PATCH 05/12] Install the CRDs before either chart source The step only appeared in the OCI block, so following the HTTPS alternative left the ZookeeperCluster CRD missing. --- .../getting-started/pages/running-the-operator.adoc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/modules/getting-started/pages/running-the-operator.adoc b/docs/modules/getting-started/pages/running-the-operator.adoc index 1518af14f..75b891a2f 100644 --- a/docs/modules/getting-started/pages/running-the-operator.adoc +++ b/docs/modules/getting-started/pages/running-the-operator.adoc @@ -29,12 +29,19 @@ The chart's values and changelog are listed on https://artifacthub.io/packages/h The chart is published to the GitHub Container Registry as an OCI artifact. Nothing needs to be added or configured first, and no credentials are required. -Install the Solr Operator chart with the command below. -This will install the https://github.com/pravega/zookeeper-operator[Zookeeper Operator] by default. +First install the CRDs. This step is the same whichever chart source you use, and it is required: +the chart installs the https://github.com/pravega/zookeeper-operator[Zookeeper Operator] by default, +but does not create its `ZookeeperCluster` CRD. [source,bash,subs="verbatim,attributes"] ---- $ kubectl create -f https://solr.apache.org/operator/downloads/crds/v{operator-version}/all-with-dependencies.yaml +---- + +Then install the Solr Operator chart: + +[source,bash,subs="verbatim,attributes"] +---- $ helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version {operator-version} ---- From 434411def8fbc9977b3fb6f3a4f6135393de200a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sun, 25 Oct 2026 15:53:27 +0100 Subject: [PATCH 06/12] Replace the CRDs before either upgrade path The HTTPS alternative skipped the step its own introduction calls for. --- helm/solr-operator/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md index 3d290d620..6a0733721 100644 --- a/helm/solr-operator/README.md +++ b/helm/solr-operator/README.md @@ -74,11 +74,17 @@ _Note that the Helm chart version does not contain a `v` prefix, which the downl ### Upgrading the Solr Operator -If you are upgrading your Solr Operator deployment, you should always use a specific version of the chart and pre-install the Solr CRDS: +If you are upgrading your Solr Operator deployment, you should always use a specific version of the chart and pre-install the Solr CRDS. + +Upgrade the CRDs first. Helm does not update CRDs that are already installed, so this step is required whichever chart source you use: ```bash -# Upgrade the CRDs first, then the chart kubectl replace -f https://solr.apache.org/operator/downloads/crds/v0.10.0-prerelease/all-with-dependencies.yaml +``` + +Then upgrade the chart: + +```bash helm upgrade solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version 0.10.0-prerelease ``` From 0ce1a78023bf96b22254237c7934569162bfdba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sat, 24 Oct 2026 16:39:38 +0200 Subject: [PATCH 07/12] Do not commit to a version for retiring the HTTPS Helm repository The docs said charts would be published to the OCI registry only "starting with v1.0.0". We are not ready to commit to when the HTTPS repository stops being updated, so the wording is now open-ended: charts go to both locations for now, and the HTTPS repository will be retired in a future release. The deprecation itself is unchanged, and the upgrade notes promise the retirement will be announced in advance rather than naming a version. Removing the deadline also drops the "update your automation before upgrading to v1.0.0" instruction, which is now phrased as a recommendation. --- README.md | 2 +- .../getting-started/pages/local-tutorial.adoc | 4 ++-- .../getting-started/pages/running-the-operator.adoc | 4 ++-- docs/modules/upgrade-notes/pages/upgrade-notes.adoc | 12 ++++++------ helm/solr-operator/Chart.yaml | 2 +- helm/solr-operator/README.md | 4 ++-- helm/solr/Chart.yaml | 2 +- helm/solr/README.md | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 2bf751a78..09bbdd8f9 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Please visit the following pages for documentation on using and developing the S - **Solr Operator**: `helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version ` - **Solr Cloud**: `helm install solr oci://ghcr.io/apache/solr-operator/helm/solr --version ` - Or via the deprecated HTTPS repository: [Helm Instructions via Artifact Hub](https://artifacthub.io/packages/helm/apache-solr/solr-operator) - - Charts are published to both locations throughout the 0.x releases. Starting with `v1.0.0`, charts will be published to the OCI registry only. + - Charts are published to both locations for now. The HTTPS repository will be retired in a future release, announced in advance. - The released helm charts and their instructions should be used for all safe and stable deployments. The charts found in `helm/` are not guaranteed to be compatible with the last stable release, and should only be used for development purposes. - [Running the Solr Operator](https://solr.apache.org/guide/operator/latest/getting-started/running-the-operator.html) diff --git a/docs/modules/getting-started/pages/local-tutorial.adoc b/docs/modules/getting-started/pages/local-tutorial.adoc index 42a86a50c..ae45d1095 100644 --- a/docs/modules/getting-started/pages/local-tutorial.adoc +++ b/docs/modules/getting-started/pages/local-tutorial.adoc @@ -96,8 +96,8 @@ $ helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operat [NOTE] ==== The charts are also still served from the HTTPS Helm repository at `https://solr.apache.org/charts`, -which is deprecated. Charts are published to both locations throughout the 0.x releases. -Starting with `v1.0.0`, charts will be published to the OCI registry only. +which is deprecated. Charts are published to both locations for now, and the HTTPS repository will be +retired in a future release. ==== _Note that the Helm chart version does not contain a `v` prefix, which the downloads version does. The Helm chart version is the only part of the Solr Operator release that does not use the `v` prefix._ diff --git a/docs/modules/getting-started/pages/running-the-operator.adoc b/docs/modules/getting-started/pages/running-the-operator.adoc index 75b891a2f..f12bde26f 100644 --- a/docs/modules/getting-started/pages/running-the-operator.adoc +++ b/docs/modules/getting-started/pages/running-the-operator.adoc @@ -56,8 +56,8 @@ $ helm repo update $ helm install solr-operator apache-solr/solr-operator --version {operator-version} ---- -Charts are published to both locations throughout the 0.x releases. -Starting with `v1.0.0`, charts will be published to the OCI registry only. +Charts are published to both locations for now, and the HTTPS repository will be retired in a +future release. ==== _Note that the Helm chart version does not contain a `v` prefix, which the downloads version does. The Helm chart version is the only part of the Solr Operator release that does not use the `v` prefix._ diff --git a/docs/modules/upgrade-notes/pages/upgrade-notes.adoc b/docs/modules/upgrade-notes/pages/upgrade-notes.adoc index 7b710a02f..3864ba986 100644 --- a/docs/modules/upgrade-notes/pages/upgrade-notes.adoc +++ b/docs/modules/upgrade-notes/pages/upgrade-notes.adoc @@ -114,12 +114,12 @@ Installing from an OCI registry requires no `helm repo add`, and no credentials. ==== The HTTPS Helm repository at `https://solr.apache.org/charts` is *deprecated*. -Charts are published to both the OCI registry and the HTTPS repository throughout the 0.x releases, -so there is no rush to migrate. Starting with `v1.0.0`, charts will be published to the OCI registry -only, and the HTTPS repository will receive no further releases. +Charts are published to both the OCI registry and the HTTPS repository for now, so there is no rush +to migrate. The HTTPS repository will be retired in a future release, and that will be announced in +advance in these upgrade notes. -If you install or upgrade the charts through automation, update it to use the `oci://` URLs above -before upgrading to `v1.0.0`. +If you install or upgrade the charts through automation, moving it to the `oci://` URLs above is +recommended. ==== == Installing the Solr Operator vs Solr CRDs @@ -165,7 +165,7 @@ _Note that the Helm chart version does not contain a `v` prefix, which the downl + The charts are published as OCI artifacts to `oci://ghcr.io/apache/solr-operator/helm`, alongside the existing HTTPS Helm repository. The HTTPS repository at `https://solr.apache.org/charts` is deprecated -and will receive no further releases starting with `v1.0.0`. +and will be retired in a future release. See <>. * *Logging now defaults to JSON format* diff --git a/helm/solr-operator/Chart.yaml b/helm/solr-operator/Chart.yaml index f078bf00b..c6147ae07 100644 --- a/helm/solr-operator/Chart.yaml +++ b/helm/solr-operator/Chart.yaml @@ -146,7 +146,7 @@ annotations: - name: Github PR url: https://github.com/apache/solr-operator/pull/814 - kind: deprecated - description: The HTTPS Helm repository at https://solr.apache.org/charts is deprecated. Charts are published to both it and the OCI registry throughout the 0.x releases, but starting with v1.0.0 they will be published to the OCI registry only + description: The HTTPS Helm repository at https://solr.apache.org/charts is deprecated. Charts are published to both it and the OCI registry for now, and the HTTPS repository will be retired in a future release links: - name: Github Issue url: https://github.com/apache/solr-operator/issues/813 diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md index 6a0733721..e667ae233 100644 --- a/helm/solr-operator/README.md +++ b/helm/solr-operator/README.md @@ -36,8 +36,8 @@ If you do not wish to use the Zookeeper Operator, set: The Solr Operator Helm chart can be installed either from the OCI registry (recommended) or from the deprecated HTTPS repository. > **Note:** The HTTPS Helm repository at `https://solr.apache.org/charts` is deprecated. -> Charts are published to both locations throughout the 0.x releases. -> Starting with `v1.0.0`, charts will be published to the OCI registry only. +> Charts are published to both locations for now, and the HTTPS repository will be retired in a +> future release. #### Installation via OCI Registry (Recommended) diff --git a/helm/solr/Chart.yaml b/helm/solr/Chart.yaml index 192db5d32..aa22bdc91 100644 --- a/helm/solr/Chart.yaml +++ b/helm/solr/Chart.yaml @@ -68,7 +68,7 @@ annotations: - name: Github PR url: https://github.com/apache/solr-operator/pull/814 - kind: deprecated - description: The HTTPS Helm repository at https://solr.apache.org/charts is deprecated. Charts are published to both it and the OCI registry throughout the 0.x releases, but starting with v1.0.0 they will be published to the OCI registry only + description: The HTTPS Helm repository at https://solr.apache.org/charts is deprecated. Charts are published to both it and the OCI registry for now, and the HTTPS repository will be retired in a future release links: - name: Github Issue url: https://github.com/apache/solr-operator/issues/813 diff --git a/helm/solr/README.md b/helm/solr/README.md index 0707caf72..3bc22a5e2 100644 --- a/helm/solr/README.md +++ b/helm/solr/README.md @@ -36,8 +36,8 @@ There may be breaking changes between the version you are using and the version The Solr Helm chart can be installed either from the OCI registry (recommended) or from the deprecated HTTPS helm repository. > **Note:** The HTTPS Helm repository at `https://solr.apache.org/charts` is deprecated. -> Charts are published to both locations throughout the 0.x releases. -> Starting with `v1.0.0`, charts will be published to the OCI registry only. +> Charts are published to both locations for now, and the HTTPS repository will be retired in a +> future release. To install a SolrCloud for the first time in your cluster, you can use the latest version or a specific version: From 6418d1bd2325b9753376d6a0f109d5e643c0c22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sat, 24 Oct 2026 16:43:25 +0200 Subject: [PATCH 08/12] State the HTTPS deprecation once, and link to it from everywhere else The deprecation notice was repeated on five pages: the top-level README, the local-tutorial and running-the-operator docs, and both chart READMEs. That is five places to keep in sync, and they had already started to drift. The upgrade notes are now the single place that explains it, under the existing "Where the Helm charts are published" anchor. Everywhere else that needs to mention the old repository links there instead: the Antora pages with an xref, and the Markdown READMEs with an absolute link to the published page, since they are also rendered on Artifact Hub where a relative link would not resolve. The HTTPS install snippet in running-the-operator.adoc is kept, since it is still a working alternative; only the repeated explanation is gone. --- README.md | 3 +-- docs/modules/getting-started/pages/local-tutorial.adoc | 5 ++--- .../modules/getting-started/pages/running-the-operator.adoc | 5 ++--- helm/solr-operator/README.md | 6 +----- helm/solr/README.md | 6 +----- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 09bbdd8f9..0c554e9de 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,7 @@ Please visit the following pages for documentation on using and developing the S - The Helm charts are published as OCI artifacts (recommended): - **Solr Operator**: `helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version ` - **Solr Cloud**: `helm install solr oci://ghcr.io/apache/solr-operator/helm/solr --version ` - - Or via the deprecated HTTPS repository: [Helm Instructions via Artifact Hub](https://artifacthub.io/packages/helm/apache-solr/solr-operator) - - Charts are published to both locations for now. The HTTPS repository will be retired in a future release, announced in advance. + - Or via the [deprecated HTTPS repository](https://solr.apache.org/guide/operator/latest/upgrade-notes/upgrade-notes.html#where-the-helm-charts-are-published) - The released helm charts and their instructions should be used for all safe and stable deployments. The charts found in `helm/` are not guaranteed to be compatible with the last stable release, and should only be used for development purposes. - [Running the Solr Operator](https://solr.apache.org/guide/operator/latest/getting-started/running-the-operator.html) diff --git a/docs/modules/getting-started/pages/local-tutorial.adoc b/docs/modules/getting-started/pages/local-tutorial.adoc index ae45d1095..42bdabe5a 100644 --- a/docs/modules/getting-started/pages/local-tutorial.adoc +++ b/docs/modules/getting-started/pages/local-tutorial.adoc @@ -95,9 +95,8 @@ $ helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operat [NOTE] ==== -The charts are also still served from the HTTPS Helm repository at `https://solr.apache.org/charts`, -which is deprecated. Charts are published to both locations for now, and the HTTPS repository will be -retired in a future release. +The charts are also still served from the deprecated HTTPS Helm repository. +See xref:upgrade-notes:upgrade-notes.adoc#where-the-helm-charts-are-published[Where the Helm charts are published]. ==== _Note that the Helm chart version does not contain a `v` prefix, which the downloads version does. The Helm chart version is the only part of the Solr Operator release that does not use the `v` prefix._ diff --git a/docs/modules/getting-started/pages/running-the-operator.adoc b/docs/modules/getting-started/pages/running-the-operator.adoc index f12bde26f..920bade97 100644 --- a/docs/modules/getting-started/pages/running-the-operator.adoc +++ b/docs/modules/getting-started/pages/running-the-operator.adoc @@ -47,7 +47,8 @@ $ helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operat [NOTE] ==== -The chart is also still served from the HTTPS Helm repository at `https://solr.apache.org/charts`, which is deprecated: +The chart is also still served from the deprecated HTTPS Helm repository +(see xref:upgrade-notes:upgrade-notes.adoc#where-the-helm-charts-are-published[Where the Helm charts are published]): [source,bash,subs="verbatim,attributes"] ---- @@ -56,8 +57,6 @@ $ helm repo update $ helm install solr-operator apache-solr/solr-operator --version {operator-version} ---- -Charts are published to both locations for now, and the HTTPS repository will be retired in a -future release. ==== _Note that the Helm chart version does not contain a `v` prefix, which the downloads version does. The Helm chart version is the only part of the Solr Operator release that does not use the `v` prefix._ diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md index e667ae233..e43df74b3 100644 --- a/helm/solr-operator/README.md +++ b/helm/solr-operator/README.md @@ -33,11 +33,7 @@ If you do not wish to use the Zookeeper Operator, set: ### Installing the Chart -The Solr Operator Helm chart can be installed either from the OCI registry (recommended) or from the deprecated HTTPS repository. - -> **Note:** The HTTPS Helm repository at `https://solr.apache.org/charts` is deprecated. -> Charts are published to both locations for now, and the HTTPS repository will be retired in a -> future release. +The Solr Operator Helm chart can be installed either from the OCI registry (recommended) or from the [deprecated HTTPS repository](https://solr.apache.org/guide/operator/latest/upgrade-notes/upgrade-notes.html#where-the-helm-charts-are-published). #### Installation via OCI Registry (Recommended) diff --git a/helm/solr/README.md b/helm/solr/README.md index 3bc22a5e2..342d9fb52 100644 --- a/helm/solr/README.md +++ b/helm/solr/README.md @@ -33,11 +33,7 @@ There may be breaking changes between the version you are using and the version ### Installing the Chart -The Solr Helm chart can be installed either from the OCI registry (recommended) or from the deprecated HTTPS helm repository. - -> **Note:** The HTTPS Helm repository at `https://solr.apache.org/charts` is deprecated. -> Charts are published to both locations for now, and the HTTPS repository will be retired in a -> future release. +The Solr Helm chart can be installed either from the OCI registry (recommended) or from the [deprecated HTTPS helm repository](https://solr.apache.org/guide/operator/latest/upgrade-notes/upgrade-notes.html#where-the-helm-charts-are-published). To install a SolrCloud for the first time in your cluster, you can use the latest version or a specific version: From 1c9e864d2ba5286d492afb3abe3ba06d12f2046e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Sun, 25 Oct 2026 16:01:14 +0100 Subject: [PATCH 09/12] Add the repo to every HTTPS chart block Installing via OCI never registers apache-solr, so each HTTPS alternative has to add it to stand on its own. --- helm/solr-operator/README.md | 2 ++ helm/solr/README.md | 1 + 2 files changed, 3 insertions(+) diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md index e43df74b3..b0677199a 100644 --- a/helm/solr-operator/README.md +++ b/helm/solr-operator/README.md @@ -87,6 +87,7 @@ helm upgrade solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator Or, from the deprecated HTTPS repository: ```bash +helm repo add apache-solr https://solr.apache.org/charts helm upgrade solr-operator apache-solr/solr-operator --version 0.10.0-prerelease ``` @@ -128,6 +129,7 @@ helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator Or, from the deprecated HTTPS repository: ```bash +helm repo add apache-solr https://solr.apache.org/charts helm install solr-operator apache-solr/solr-operator --version 0.10.0-prerelease --skip-crds --namespace solr ``` diff --git a/helm/solr/README.md b/helm/solr/README.md index 342d9fb52..d234131a6 100644 --- a/helm/solr/README.md +++ b/helm/solr/README.md @@ -65,6 +65,7 @@ helm upgrade example oci://ghcr.io/apache/solr-operator/helm/solr --version 0.10 Or, from the deprecated HTTPS Helm repository: ```bash +helm repo add apache-solr https://solr.apache.org/charts helm upgrade example apache-solr/solr --version 0.10.0-prerelease --reuse-values --set image.tag=9.10.0 ``` From 7883342f246d5d73bfca4298044df3e6f7c6731b Mon Sep 17 00:00:00 2001 From: Houston Putman Date: Tue, 17 Nov 2026 15:11:15 -0800 Subject: [PATCH 10/12] Serve a Helm repository index that points at the OCI charts Starting with v0.10.0 the Helm charts are only distributed as OCI artifacts on ghcr.io. Keep 'helm repo add apache-solr https://solr.apache.org/charts' working by serving an index.yaml from solr-site whose entries point at the OCI copies (oci://ghcr.io/apache/solr-operator/helm/:), instead of at tarballs uploaded to nightlies.apache.org. - hack/release/upload/update_helm_index.sh adds a release to that index. It verifies the released charts, replaces existing entries in place (for backfilling older releases), refuses digest changes, and signs the index. - hack/release/smoke_test/test_oci_index.sh checks that Helm 3.8.2, 3.19.0 and 4.3.1 can consume such an index: repo add/update, search, show, pull, --verify, install-style resolution and dependency update. It runs in the new "Helm OCI Index" workflow. - The release wizard drops the nightlies upload, and adds a website step that updates the index after the charts are published to the OCI registry. - Docs, upgrade notes and the chart changelogs note the Helm 3.8 minimum. --- .github/workflows/helm-oci-index.yaml | 72 ++++ dev-docs/helm-repository.md | 78 ++++ .../pages/running-the-operator.adoc | 4 + .../upgrade-notes/pages/upgrade-notes.adoc | 4 + hack/release/smoke_test/test_oci_index.sh | 349 ++++++++++++++++++ hack/release/upload/update_helm_index.sh | 242 ++++++++++++ hack/release/wizard/releaseWizard.yaml | 80 ++-- helm/solr-operator/Chart.yaml | 5 + helm/solr-operator/README.md | 3 + helm/solr/Chart.yaml | 5 + 10 files changed, 819 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/helm-oci-index.yaml create mode 100644 dev-docs/helm-repository.md create mode 100755 hack/release/smoke_test/test_oci_index.sh create mode 100755 hack/release/upload/update_helm_index.sh diff --git a/.github/workflows/helm-oci-index.yaml b/.github/workflows/helm-oci-index.yaml new file mode 100644 index 000000000..eb71a2ff6 --- /dev/null +++ b/.github/workflows/helm-oci-index.yaml @@ -0,0 +1,72 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: Helm OCI Index + +# The Helm repository at https://solr.apache.org/charts is an index.yaml whose entries point at +# the OCI copies of the charts on ghcr.io. This tests that every Helm version we document can +# consume such an index, using hack/release/smoke_test/test_oci_index.sh. +# +# This is a separate workflow, rather than a job in smoke-tests.yaml, because that workflow +# ignores hack/release/upload/**, where the index generator lives. + +on: + pull_request: + branches: + - 'main' + - 'release-*' + paths: + - '.github/workflows/helm-oci-index.yaml' + - 'hack/release/smoke_test/test_oci_index.sh' + - 'hack/release/upload/update_helm_index.sh' + - 'helm/**' + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + name: Helm ${{ matrix.helm }} + runs-on: ubuntu-latest + timeout-minutes: 20 + + strategy: + fail-fast: false + matrix: + # 3.8 is the first release with OCI out of experimental; 4.3.1 is what + # publish-helm-oci.yaml pins. Keep in sync with DEFAULT_HELM_VERSIONS in the script. + helm: [ '3.8.2', '3.19.0', '4.3.1' ] + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Setup go + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version: '1.27' + + # The host Helm only packages and signs the charts. The Helm version under test runs in a + # container, which the script downloads from get.helm.sh. This SHA must stay on the ASF + # allowlist, see the note in publish-helm-oci.yaml. + - name: Install Helm + uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 + with: + version: 'v4.3.1' + + - run: make yq + - name: Test the OCI index with Helm ${{ matrix.helm }} + run: ./hack/release/smoke_test/test_oci_index.sh -H "${{ matrix.helm }}" diff --git a/dev-docs/helm-repository.md b/dev-docs/helm-repository.md new file mode 100644 index 000000000..3566b7e16 --- /dev/null +++ b/dev-docs/helm-repository.md @@ -0,0 +1,78 @@ +# The Helm Repository + +The Solr Operator Helm charts are distributed as OCI artifacts on the GitHub Container Registry: + +- `oci://ghcr.io/apache/solr-operator/helm/solr-operator` +- `oci://ghcr.io/apache/solr-operator/helm/solr` + +The classic Helm repository, `helm repo add apache-solr https://solr.apache.org/charts`, is kept +as well. It is an `index.yaml` checked into the [solr-site](https://github.com/apache/solr-site) +repository, at `content/charts/index.yaml`. Its entries point at the OCI copies of the charts +rather than at tarballs, so no charts are hosted on the website: + +```yaml +entries: + solr-operator: + - version: 0.10.0 + urls: + - oci://ghcr.io/apache/solr-operator/helm/solr-operator:0.10.0 + digest: + ... +``` + +The signed chart tarballs on dist.apache.org / archive.apache.org remain the official release +artifacts. The OCI copies are byte-identical to them, which is why the `digest` in the index +matches both, and why provenance (`--verify`) works through the index. + +## Helm version support + +An index with `oci://` chart urls needs Helm 3.8 or later. +[`test_oci_index.sh`](../hack/release/smoke_test/test_oci_index.sh) checks every way of consuming +the index (repo add/update, search, show, pull with and without `--verify`, install-style chart +resolution, and `helm dependency update` with a repository url or an `@alias`). It runs against +Helm 3.8.2, 3.19.0 and 4.3.1, in the `Helm OCI Index` GitHub workflow, and locally with: + +```bash +make yq +./hack/release/smoke_test/test_oci_index.sh # or -H "" to test others +``` + +It needs Docker, since the registry, the index server and each Helm version run in containers. + +## Updating the index + +[`update_helm_index.sh`](../hack/release/upload/update_helm_index.sh) adds a release to the index. +It downloads the released charts, verifies their checksums and GPG signatures, writes entries +pointing at the OCI registry, and signs the index. It never commits or uploads anything. + +A release does this in the release wizard's `website_update_helm_index` step, after the charts are +published to the OCI registry (`publish_helm_charts_oci`), and the website change is published with +the rest of the release's website updates. + +If a version is already in the index, its entry is replaced in place, keeping its original +`created` timestamp. The script refuses to do this if the chart's digest has changed, since the +OCI copy must be byte-identical to the released chart. + +## Backfilling older releases + +Releases from before the switch to OCI are listed in the index with relative tarball urls, which +the website redirects to nightlies.apache.org. To move one of them to OCI: + +1. Publish it to the OCI registry, by running the + [Publish Helm Charts to OCI Registry](https://github.com/apache/solr-operator/actions/workflows/publish-helm-oci.yaml) + workflow with its archive.apache.org chart urls, e.g. + `https://archive.apache.org/dist/solr/solr-operator/v0.9.1/helm-charts/solr-operator-0.9.1.tgz`. + Use a dry run first. +2. Rewrite its index entries, in a solr-site checkout: + ```bash + ./hack/release/upload/update_helm_index.sh \ + -r https://archive.apache.org/dist/solr/solr-operator/v0.9.1 \ + -i ../solr-site/content/charts/index.yaml + ``` +3. Commit the updated `index.yaml`, `index.yaml.asc` and `index.yaml.sha512` in solr-site. + +Versions from before the donation to Apache (`v0.2.x`) have no archive.apache.org copy, so they +are left as they are. + +Once every entry points at OCI, the `/charts/*.tgz` redirect to nightlies in solr-site's +`themes/solr/templates/htaccess.template` can be removed. diff --git a/docs/modules/getting-started/pages/running-the-operator.adoc b/docs/modules/getting-started/pages/running-the-operator.adoc index 93fc388a4..a23db7b97 100644 --- a/docs/modules/getting-started/pages/running-the-operator.adoc +++ b/docs/modules/getting-started/pages/running-the-operator.adoc @@ -34,6 +34,10 @@ $ helm repo add apache-solr https://solr.apache.org/charts $ helm repo update ---- +The charts are published as OCI artifacts to `oci://ghcr.io/apache/solr-operator/helm`, and the Helm repository above lists them from there. +This requires Helm `v3.8` or later. +You can also skip adding the repository and install straight from the OCI registry, replacing `apache-solr/solr-operator` below with `oci://ghcr.io/apache/solr-operator/helm/solr-operator`. + Next, install the Solr Operator chart. Note this is using Helm v3, use the official Helm chart documentation linked to above. This will install the https://github.com/pravega/zookeeper-operator[Zookeeper Operator] by default. diff --git a/docs/modules/upgrade-notes/pages/upgrade-notes.adoc b/docs/modules/upgrade-notes/pages/upgrade-notes.adoc index b631f940f..fedc652ba 100644 --- a/docs/modules/upgrade-notes/pages/upgrade-notes.adoc +++ b/docs/modules/upgrade-notes/pages/upgrade-notes.adoc @@ -136,6 +136,10 @@ _Note that the Helm chart version does not contain a `v` prefix, which the downl === v0.10.0 +* The Helm charts are now distributed as OCI artifacts, from `oci://ghcr.io/apache/solr-operator/helm/solr-operator` and `oci://ghcr.io/apache/solr-operator/helm/solr`. +The Helm repository at `https://solr.apache.org/charts` still lists every release, so existing `helm repo add` setups and `helm dependency` references keep working, but its entries now point at the OCI registry, which requires Helm `v3.8` or later. +The signed chart tarballs on the Apache download mirrors remain the official release artifacts. + * The default Solr version has been upgraded from `8.11` to `9.11.0`. This only affects newly created resources, since the operator writes the resolved Solr version into the resource's spec on the first reconcile, so an operator upgrade never changes the Solr version of a running cluster. Note that a Solr `>=9.10` node refuses to start if its `major.minor` version is lower than the highest version already running in the same Solr cluster, so a rolling downgrade of Solr requires setting the `SOLR_CLOUD_DOWNGRADE_ENABLED` envVar to `true` on the pods. diff --git a/hack/release/smoke_test/test_oci_index.sh b/hack/release/smoke_test/test_oci_index.sh new file mode 100755 index 000000000..090b21a55 --- /dev/null +++ b/hack/release/smoke_test/test_oci_index.sh @@ -0,0 +1,349 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# exit immediately when a command fails +set -e +# only exit with zero if all commands of the pipeline exit successfully +set -o pipefail +# error on unset variables +set -u + +show_help() { +cat << EOF +Usage: ./hack/release/smoke_test/test_oci_index.sh [-h] [-k] [-v VERSION] [-H HELM_VERSIONS] [-p PUSH_HELM_VERSION] + +Test that a classic Helm repository index.yaml, whose entries point at oci:// urls, works for the +ways users consume the Solr Operator Helm charts: 'helm repo add', search, show, pull, provenance +verification, install-style chart resolution and 'helm dependency update'. + +Everything runs in Docker containers on a private network, so nothing is bound on the host: + - a TLS-enabled 'registry:2', standing in for ghcr.io. TLS matters: Helm only speaks plain HTTP + to a registry when given --plain-http, which cannot be passed through an index entry. + - a static file server for the index.yaml, standing in for https://solr.apache.org/charts + - one container per Helm version under test, using the official Helm release binaries + +The charts are packaged from this checkout and signed with a throwaway GPG key, pushed with their +.prov files (as the publish-helm-oci.yaml workflow does), and indexed with +hack/release/upload/update_helm_index.sh. + + -h Display this help and exit + -v Chart version to package and test (Optional, defaults to the project version, without any + prerelease suffix, so that the default 'helm search' behaviour is exercised) + -H Space-separated Helm versions to test (Optional, defaults to "${DEFAULT_HELM_VERSIONS}") + -p Helm version used to push the charts (Optional, defaults to ${DEFAULT_PUSH_HELM_VERSION}, + the version publish-helm-oci.yaml pins) + -k Keep the containers, network and working directory after the run, for debugging + +Requires: docker, openssl, gpg, curl, helm (to package the charts) and bin/yq ('make yq'). +EOF +} + +# 3.8 is the first Helm release with OCI support out of experimental. 4.3.1 matches the +# version publish-helm-oci.yaml pins. Pass -H to test others, e.g. the latest 3.x. +DEFAULT_HELM_VERSIONS="3.8.2 3.19.0 4.3.1" +DEFAULT_PUSH_HELM_VERSION="4.3.1" + +OPTIND=1 +while getopts hkv:H:p: opt; do + case $opt in + h) + show_help + exit 0 + ;; + k) KEEP=true + ;; + v) VERSION=$OPTARG + ;; + H) HELM_VERSIONS=$OPTARG + ;; + p) PUSH_HELM_VERSION=$OPTARG + ;; + *) + show_help >&2 + exit 1 + ;; + esac +done +shift "$((OPTIND-1))" # Discard the options and sentinel -- + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +cd "${REPO_ROOT}" + +HELM_VERSIONS="${HELM_VERSIONS:-${DEFAULT_HELM_VERSIONS}}" +PUSH_HELM_VERSION="${PUSH_HELM_VERSION:-${DEFAULT_PUSH_HELM_VERSION}}" +if [[ -z "${VERSION:-}" ]]; then + VERSION="$(make -s version)" + VERSION="${VERSION%%-*}" +fi +CHART_VERSION="${VERSION#v}" + +for tool in docker openssl gpg curl helm; do + if ! command -v "${tool}" >/dev/null 2>&1; then + echo "${tool} is required to run this test" >&2 && exit 1 + fi +done + +RUN_ID="solr-oci-index-$$" +NETWORK="${RUN_ID}" +REGISTRY_CONTAINER="${RUN_ID}-registry" +CHARTS_CONTAINER="${RUN_ID}-charts" +# Containers reach each other by these network aliases. +REGISTRY_HOST="registry" +CHARTS_HOST="charts" +OCI_BASE="oci://${REGISTRY_HOST}:5000/helm" +REPO_URL="http://${CHARTS_HOST}:8080" +CONTAINER_IMAGE="alpine:3" + +WORK_DIR="$(mktemp -d "${TMPDIR:-/tmp}/solr-operator-oci-index-test-XXXXXXXX")" +# Docker Desktop shares /var/folders and /private, but not every realpath form of TMPDIR. +WORK_DIR="$(cd "${WORK_DIR}" && pwd -P)" +HELM_BIN_CACHE="${HELM_BIN_CACHE:-${TMPDIR:-/tmp}/solr-operator-helm-binaries}" + +cleanup() { + if [[ -n "${GPG_HOME:-}" ]]; then + GNUPGHOME="${GPG_HOME}" gpgconf --kill gpg-agent >/dev/null 2>&1 || true + rm -rf "${GPG_HOME}" + fi + if [[ "${KEEP:-}" == "true" ]]; then + echo "Kept the network ${NETWORK}, containers ${REGISTRY_CONTAINER} and ${CHARTS_CONTAINER}, and ${WORK_DIR}" + return + fi + docker rm -f "${REGISTRY_CONTAINER}" "${CHARTS_CONTAINER}" >/dev/null 2>&1 || true + docker network rm "${NETWORK}" >/dev/null 2>&1 || true + rm -rf "${WORK_DIR}" +} +trap cleanup EXIT + +echo "Testing an index of oci:// chart urls, for chart version ${CHART_VERSION}, with Helm ${HELM_VERSIONS}" + +# --- Helm binaries, for the architecture of the Docker engine (not the host) ---------------- + +case "$(docker info --format '{{.Architecture}}')" in + x86_64|amd64) HELM_ARCH=amd64 ;; + aarch64|arm64) HELM_ARCH=arm64 ;; + *) echo "Unsupported Docker architecture: $(docker info --format '{{.Architecture}}')" >&2 && exit 1 ;; +esac + +fetch_helm() { + local version="$1" + local dir="${HELM_BIN_CACHE}/v${version}-linux-${HELM_ARCH}" + if [[ ! -x "${dir}/helm" ]]; then + local tarball="helm-v${version}-linux-${HELM_ARCH}.tar.gz" + mkdir -p "${dir}" + echo "Downloading Helm v${version} (linux/${HELM_ARCH})" >&2 + curl --fail --show-error --silent --location -o "${dir}/${tarball}" "https://get.helm.sh/${tarball}" + expected="$(curl --fail --show-error --silent --location "https://get.helm.sh/${tarball}.sha256sum" | awk '{print $1}')" + actual="$(openssl dgst -sha256 "${dir}/${tarball}" | awk '{print $NF}')" + if [[ "${expected}" != "${actual}" ]]; then + rm -rf "${dir}" + echo "Checksum mismatch for ${tarball}" >&2 && exit 1 + fi + tar -xzf "${dir}/${tarball}" -C "${dir}" --strip-components=1 "linux-${HELM_ARCH}/helm" + rm "${dir}/${tarball}" + fi + echo "${dir}/helm" +} + +PUSH_HELM="$(fetch_helm "${PUSH_HELM_VERSION}")" +for v in ${HELM_VERSIONS}; do + fetch_helm "${v}" >/dev/null +done + +# --- TLS for the registry ---------------------------------------------------------------------- + +TLS_DIR="${WORK_DIR}/tls" +mkdir -p "${TLS_DIR}" +( + cd "${TLS_DIR}" + openssl req -x509 -newkey rsa:2048 -nodes -days 1 -subj "/CN=Solr OCI index test CA" \ + -keyout ca.key -out ca.crt 2>/dev/null + openssl req -newkey rsa:2048 -nodes -subj "/CN=${REGISTRY_HOST}" \ + -keyout registry.key -out registry.csr 2>/dev/null + printf 'subjectAltName=DNS:%s\nextendedKeyUsage=serverAuth\n' "${REGISTRY_HOST}" > registry.ext + openssl x509 -req -in registry.csr -CA ca.crt -CAkey ca.key -CAcreateserial -days 1 \ + -extfile registry.ext -out registry.crt 2>/dev/null + chmod 644 ./* +) + +# --- Throwaway signing key ----------------------------------------------------------------------- + +GPG_DIR="${WORK_DIR}/gpg" +mkdir -p "${GPG_DIR}" +# The gpg-agent socket lives in GNUPGHOME, and a unix socket path is limited to ~104 bytes. The +# macOS TMPDIR (/var/folders/...) is too long for that, so the keyring home goes under /tmp. +GPG_HOME="$(mktemp -d /tmp/solr-gpg-XXXXXX)" +chmod 700 "${GPG_HOME}" +GPG_UID="Solr OCI Index Test " +GNUPGHOME="${GPG_HOME}" gpg --batch --quiet --pinentry-mode loopback --passphrase '' \ + --quick-gen-key "${GPG_UID}" rsa2048 sign 1d +# Helm reads the legacy keyring formats, as build_helm.sh and publish-helm-oci.yaml also rely on. +GNUPGHOME="${GPG_HOME}" gpg --batch --export-secret-keys > "${GPG_DIR}/secring.gpg" +GNUPGHOME="${GPG_HOME}" gpg --batch --export > "${GPG_DIR}/pubring.gpg" +GNUPGHOME="${GPG_HOME}" gpgconf --kill gpg-agent >/dev/null 2>&1 || true +rm -rf "${GPG_HOME}" + +# --- Package and sign the charts ----------------------------------------------------------------- + +CHARTS_DIR="${WORK_DIR}/charts" +mkdir -p "${CHARTS_DIR}" +echo "Packaging and signing the charts at version ${CHART_VERSION}" +SIGNING=(--sign --key "Solr OCI Index Test" --keyring "${GPG_DIR}/secring.gpg") +# This adds the pravega repo the zookeeper-operator dependency comes from, if it is missing. +make -s helm-dependency-build >/dev/null +helm package helm/solr-operator --app-version "v${CHART_VERSION}" --version "${CHART_VERSION}" -d "${CHARTS_DIR}" "${SIGNING[@]}" >/dev/null +helm package helm/solr --version "${CHART_VERSION}" -d "${CHARTS_DIR}" "${SIGNING[@]}" >/dev/null +ls "${CHARTS_DIR}" + +# --- Registry and index server ------------------------------------------------------------------- + +docker network create "${NETWORK}" >/dev/null +docker run -d --name "${REGISTRY_CONTAINER}" --network "${NETWORK}" --network-alias "${REGISTRY_HOST}" \ + -v "${TLS_DIR}:/certs:ro" \ + -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/registry.crt \ + -e REGISTRY_HTTP_TLS_KEY=/certs/registry.key \ + registry:2 >/dev/null + +SITE_DIR="${WORK_DIR}/site" +mkdir -p "${SITE_DIR}" +docker run -d --name "${CHARTS_CONTAINER}" --network "${NETWORK}" --network-alias "${CHARTS_HOST}" \ + -v "${SITE_DIR}:/srv:ro" \ + busybox:stable httpd -f -p 8080 -h /srv >/dev/null + +# Runs a command with the given Helm binary, in a container on the test network. +in_helm_container() { + local helm_bin="$1"; shift + docker run --rm --network "${NETWORK}" \ + -v "${helm_bin}:/usr/local/bin/helm:ro" \ + -v "${WORK_DIR}:/work:ro" \ + -e SSL_CERT_FILE=/work/tls/ca.crt \ + -e HELM_CONFIG_HOME=/tmp/helm/config \ + -e HELM_CACHE_HOME=/tmp/helm/cache \ + -e HELM_DATA_HOME=/tmp/helm/data \ + "$@" +} + +# --- Push, the way publish-helm-oci.yaml does: the .prov next to each chart is uploaded too ------ + +echo "Pushing the charts to ${OCI_BASE} with Helm v${PUSH_HELM_VERSION}" +pushed=false +for attempt in 1 2 3 4 5 6 7 8 9 10; do + if in_helm_container "${PUSH_HELM}" "${CONTAINER_IMAGE}" sh -c " + set -e + helm push /work/charts/solr-operator-${CHART_VERSION}.tgz ${OCI_BASE} + helm push /work/charts/solr-${CHART_VERSION}.tgz ${OCI_BASE} + "; then + pushed=true + break + fi + echo "Push attempt ${attempt} failed, the registry may still be starting. Retrying." + sleep 2 +done +if [[ "${pushed}" != "true" ]]; then + echo "Could not push the charts to the test registry" >&2 && exit 1 +fi + +# --- Generate the index, exactly as a release would ---------------------------------------------- + +./hack/release/upload/update_helm_index.sh -n -c -d "${CHARTS_DIR}" -o "${OCI_BASE}" -i "${SITE_DIR}/index.yaml" + +# --- The checks, run once per Helm version ------------------------------------------------------- + +cat > "${WORK_DIR}/checks.sh" << 'EOF' +#!/bin/sh +# Each check prints 'RESULT||PASS' or 'RESULT||FAIL', followed by its output on failure. +V="$1" +REPO_URL="$2" +OCI_BASE="$3" +KEYRING=/work/gpg/pubring.gpg +# 'helm pull -d' does not create its destination directory. +mkdir -p /tmp/direct /tmp/pull /tmp/pull-verify + +check() { + name="$1"; shift + if "$@" > /tmp/check.log 2>&1; then + echo "RESULT|${name}|PASS" + else + echo "RESULT|${name}|FAIL" + tail -n 5 /tmp/check.log | sed 's/^/ /' + fi +} + +umbrella() { + dir="$1"; repository="$2" + mkdir -p "${dir}" + cat > "${dir}/Chart.yaml" << CHART +apiVersion: v2 +name: umbrella +version: 0.0.1 +dependencies: + - name: solr + version: "${V}" + repository: "${repository}" +CHART + helm dependency update "${dir}" && test -f "${dir}/charts/solr-${V}.tgz" \ + && cmp "${dir}/charts/solr-${V}.tgz" "/work/charts/solr-${V}.tgz" +} + +helm version --short + +# Control: the registry and TLS setup work without the index, so a failure below is the index's. +check "control: helm pull oci:// directly" \ + helm pull "${OCI_BASE}/solr-operator" --version "${V}" -d /tmp/direct + +check "helm repo add" helm repo add apache-solr "${REPO_URL}" +check "helm repo update" helm repo update +check "helm search repo" sh -c "helm search repo apache-solr/solr-operator --versions | grep -q '${V}'" +check "helm show chart" helm show chart apache-solr/solr-operator --version "${V}" +check "helm pull (byte-identical)" sh -c " + helm pull apache-solr/solr-operator --version '${V}' -d /tmp/pull && + cmp '/tmp/pull/solr-operator-${V}.tgz' '/work/charts/solr-operator-${V}.tgz'" +check "helm pull --verify" \ + helm pull apache-solr/solr-operator --version "${V}" --verify --keyring "${KEYRING}" -d /tmp/pull-verify +# 'helm template' resolves the chart through the same code path as 'helm install', without +# needing a cluster. +check "install path: solr-operator" helm template t apache-solr/solr-operator --version "${V}" +check "install path: solr" helm template t apache-solr/solr --version "${V}" +check "install path: --verify" \ + helm template t apache-solr/solr-operator --version "${V}" --verify --keyring "${KEYRING}" +check "dependency update: repository url" umbrella /tmp/umbrella-url "${REPO_URL}" +check "dependency update: @repo alias" umbrella /tmp/umbrella-alias "@apache-solr" +EOF + +RESULTS_FILE="${WORK_DIR}/results.txt" +: > "${RESULTS_FILE}" +for v in ${HELM_VERSIONS}; do + echo "" + echo "=== Helm v${v} ===" + output="$(in_helm_container "$(fetch_helm "${v}")" "${CONTAINER_IMAGE}" \ + sh /work/checks.sh "${CHART_VERSION}" "${REPO_URL}" "${OCI_BASE}" 2>&1 || true)" + echo "${output}" | sed -n 's/^RESULT|\(.*\)|\(.*\)$/ \2 \1/p; /^ /p; /^v[0-9]/p' + echo "${output}" | sed -n "s/^RESULT|\(.*\)|\(.*\)$/v${v}|\1|\2/p" >> "${RESULTS_FILE}" +done + +echo "" +echo "=== Summary ===" +failures="$(grep -c '|FAIL$' "${RESULTS_FILE}" || true)" +total="$(wc -l < "${RESULTS_FILE}" | tr -d ' ')" +grep '|FAIL$' "${RESULTS_FILE}" | sed 's/^\(.*\)|FAIL$/ FAIL \1/' || true +expected=$(( $(grep -c '^check "' "${WORK_DIR}/checks.sh") * $(echo ${HELM_VERSIONS} | wc -w) )) +if [[ "${total}" -ne "${expected}" ]]; then + echo "Only ${total} of ${expected} checks reported a result" >&2 + exit 1 +fi +echo "${total} checks across Helm ${HELM_VERSIONS}: $((total - failures)) passed, ${failures} failed" +if [[ "${failures}" -gt 0 ]]; then + exit 1 +fi diff --git a/hack/release/upload/update_helm_index.sh b/hack/release/upload/update_helm_index.sh new file mode 100755 index 000000000..166e12f42 --- /dev/null +++ b/hack/release/upload/update_helm_index.sh @@ -0,0 +1,242 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# exit immediately when a command fails +set -e +# only exit with zero if all commands of the pipeline exit successfully +set -o pipefail +# error on unset variables +set -u + +show_help() { +cat << EOF +Usage: ./hack/release/upload/update_helm_index.sh [-h] [-g GPG_KEY] [-n] [-c] [-o OCI_BASE] [-v VERSION] (-r RELEASE_URL | -d CHARTS_DIR) -i INDEX_FILE + +Add (or replace) Helm chart versions in a Helm repository index.yaml, whose entries point at +the OCI registry the charts were published to, instead of at HTTPS tarballs. + +The index is served from https://solr.apache.org/charts, and is checked into the solr-site +repository. Point -i at the index.yaml in a solr-site checkout. Nothing is committed or uploaded. + +An entry that already exists for the same chart and version is replaced in place, keeping its +original 'created' timestamp. Its digest must not change, since the OCI copy is required to be +byte-identical to the released chart. This makes it safe to re-run, and is what backfills older +releases once they have been published to the OCI registry. + + -h Display this help and exit + -i The index.yaml to update. + -c Create the index if it does not exist. Without this, a missing index is an error, so that a + wrong path can not silently produce an index that has lost every earlier release. + -r URL of the released Solr Operator artifacts, on dist.apache.org or archive.apache.org + (do not include the 'helm-charts' suffix). The charts are downloaded, and their + checksums and GPG signatures verified. The Solr KEYS must already be imported into gpg. + -d A local directory of chart tarballs to index instead of -r. Nothing is verified. + Meant for testing. + -v Version of the release, e.g. v0.10.0 (Optional, defaults to the last path element of -r) + -o OCI registry the charts were pushed to (Optional, defaults to ${DEFAULT_OCI_BASE}) + -g GPG Key to sign the new index file (Optional, defaults to the gpg default key) + -n Do not sign the index, or write its checksum. Meant for testing. +EOF +} + +DEFAULT_OCI_BASE="oci://ghcr.io/apache/solr-operator/helm" +CHART_NAMES=(solr-operator solr) + +OPTIND=1 +while getopts hi:r:d:v:o:g:nc opt; do + case $opt in + h) + show_help + exit 0 + ;; + i) INDEX_FILE=$OPTARG + ;; + r) RELEASE_URL=$OPTARG + ;; + d) CHARTS_DIR=$OPTARG + ;; + v) VERSION=$OPTARG + ;; + o) OCI_BASE=$OPTARG + ;; + g) GPG_KEY=$OPTARG + ;; + n) NO_SIGN=true + ;; + c) CREATE=true + ;; + *) + show_help >&2 + exit 1 + ;; + esac +done +shift "$((OPTIND-1))" # Discard the options and sentinel -- + +if [[ -z "${INDEX_FILE:-}" ]]; then + echo "Specify the index.yaml to update via -i, or through the INDEX_FILE env var" >&2 && exit 1 +fi +if [[ ! -f "${INDEX_FILE}" && "${CREATE:-}" != "true" ]]; then + echo "The index ${INDEX_FILE} does not exist. Pass -c to create a new one." >&2 && exit 1 +fi +if [[ -z "${RELEASE_URL:-}" && -z "${CHARTS_DIR:-}" ]]; then + echo "Specify either a release url via -r, or a local charts directory via -d" >&2 && exit 1 +fi +if [[ -n "${RELEASE_URL:-}" && -n "${CHARTS_DIR:-}" ]]; then + echo "Specify only one of -r and -d" >&2 && exit 1 +fi +OCI_BASE="${OCI_BASE:-${DEFAULT_OCI_BASE}}" +OCI_BASE="${OCI_BASE%/}" +if [[ "${OCI_BASE}" != oci://* ]]; then + echo "The OCI registry must start with oci:// : ${OCI_BASE}" >&2 && exit 1 +fi + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +YAML_HEADER_FILE="${REPO_ROOT}/hack/headers/header.yaml.txt" +YQ="${YQ:-${REPO_ROOT}/bin/yq}" +if [[ ! -x "${YQ}" ]]; then + echo "yq was not found at ${YQ}. Run 'make yq' first, or set the YQ env var." >&2 && exit 1 +fi +HELM="${HELM:-helm}" + +sha512() { + if command -v sha512sum >/dev/null 2>&1; then + sha512sum "$@" + else + shasum -a 512 "$@" + fi +} + +sha256_of() { + if command -v sha256sum >/dev/null 2>&1; then + sha256sum "$1" | awk '{print $1}' + else + shasum -a 256 "$1" | awk '{print $1}' + fi +} + +TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/solr-operator-helm-index-XXXXXXXX") +trap 'rm -rf "${TMP_DIR}"' EXIT +mkdir -p "${TMP_DIR}/charts" + +if [[ -n "${RELEASE_URL:-}" ]]; then + RELEASE_URL="${RELEASE_URL%/}" + VERSION="${VERSION:-$(basename "${RELEASE_URL}")}" + CHART_VERSION="${VERSION#v}" + echo "Downloading and verifying the ${VERSION} Helm charts from ${RELEASE_URL}/helm-charts" + ( + cd "${TMP_DIR}/charts" + for name in "${CHART_NAMES[@]}"; do + for suffix in "" .sha512 .asc; do + curl --fail --show-error --silent --location --retry 3 --retry-delay 5 \ + -O "${RELEASE_URL}/helm-charts/${name}-${CHART_VERSION}.tgz${suffix}" + done + sha512 -c "${name}-${CHART_VERSION}.tgz.sha512" + if ! gpg --verify "${name}-${CHART_VERSION}.tgz.asc" "${name}-${CHART_VERSION}.tgz"; then + echo "GPG verification failed for ${name}-${CHART_VERSION}.tgz. If the key is missing, import the Solr KEYS first:" >&2 + echo " curl -sL https://dist.apache.org/repos/dist/release/solr/KEYS | gpg --import" >&2 + exit 1 + fi + rm "${name}-${CHART_VERSION}.tgz.sha512" "${name}-${CHART_VERSION}.tgz.asc" + done + ) +else + shopt -s nullglob + tarballs=("${CHARTS_DIR}"/*.tgz) + shopt -u nullglob + if [[ ${#tarballs[@]} -eq 0 ]]; then + echo "No chart tarballs found in ${CHARTS_DIR}" >&2 && exit 1 + fi + cp "${tarballs[@]}" "${TMP_DIR}/charts/" +fi + +# 'helm repo index' produces the exact metadata Helm expects for each chart version (the +# Chart.yaml fields, digest and created timestamp). Only its urls are wrong for us, since it +# can only produce HTTP urls. Helm resolves an oci:// url with a tag through its OCI getter. +NEW_INDEX="${TMP_DIR}/charts/index.yaml" +"${HELM}" repo index "${TMP_DIR}/charts" +OCI_BASE="${OCI_BASE}" "${YQ}" -i \ + '.entries[][] |= (.urls = [strenv(OCI_BASE) + "/" + .name + ":" + .version])' "${NEW_INDEX}" + +# Guard against indexing a chart whose digest does not match the tarball that was verified. +while IFS=$'\t' read -r name version digest; do + actual="$(sha256_of "${TMP_DIR}/charts/${name}-${version}.tgz")" + if [[ "${actual}" != "${digest}" ]]; then + echo "Digest mismatch for ${name}-${version}.tgz: index has ${digest}, file is ${actual}" >&2 && exit 1 + fi +done < <("${YQ}" '.entries[][] | [.name, .version, .digest] | @tsv' "${NEW_INDEX}") + +# Start from the existing index, dropping its comments (the license header is re-added below). +WORK_INDEX="${TMP_DIR}/index.yaml" +if [[ -f "${INDEX_FILE}" ]]; then + "${YQ}" '... comments=""' "${INDEX_FILE}" > "${WORK_INDEX}" +else + echo "Creating a new index at ${INDEX_FILE}" + printf 'apiVersion: v1\nentries: {}\n' > "${WORK_INDEX}" +fi + +while IFS=$'\t' read -r name version; do + export N="${name}" V="${version}" NEW="${NEW_INDEX}" + existing="$("${YQ}" '[.entries[strenv(N)][]? | select(.version == strenv(V))] | length' "${WORK_INDEX}")" + if [[ "${existing}" -gt 0 ]]; then + old_digest="$("${YQ}" '.entries[strenv(N)][] | select(.version == strenv(V)) | .digest' "${WORK_INDEX}")" + new_digest="$("${YQ}" '.entries[strenv(N)][] | select(.version == strenv(V)) | .digest' "${NEW_INDEX}")" + if [[ "${old_digest}" != "${new_digest}" ]]; then + echo "Refusing to replace ${name} ${version}: the indexed digest ${old_digest} differs from the chart's ${new_digest}." >&2 + echo "The OCI copy must be byte-identical to the released chart." >&2 + exit 1 + fi + echo "Replacing ${name} ${version}, keeping its original created timestamp" + "${YQ}" -i ' + (.entries[strenv(N)][] | select(.version == strenv(V))) |= + (load(strenv(NEW)).entries[strenv(N)][] | select(.version == strenv(V))) * {"created": .created} + ' "${WORK_INDEX}" + else + echo "Adding ${name} ${version}" + # New releases are prepended, so the index stays newest-first. Helm sorts on load anyway. + "${YQ}" -i ' + .entries[strenv(N)] = ( + [load(strenv(NEW)).entries[strenv(N)][] | select(.version == strenv(V))] + (.entries[strenv(N)] // []) + ) + ' "${WORK_INDEX}" + fi + unset N V NEW +done < <("${YQ}" '.entries[][] | [.name, .version] | @tsv' "${NEW_INDEX}") + +GENERATED="$(date -u +%Y-%m-%dT%H:%M:%S.000000000Z)" "${YQ}" -i '.generated = strenv(GENERATED)' "${WORK_INDEX}" + +mkdir -p "$(dirname "${INDEX_FILE}")" +{ + cat "${YAML_HEADER_FILE}" + printf "\n\n" + cat "${WORK_INDEX}" +} > "${INDEX_FILE}" +echo "Wrote ${INDEX_FILE}" + +if [[ "${NO_SIGN:-}" != "true" ]]; then + GPG_USER=() + if [[ -n "${GPG_KEY:-}" ]]; then + GPG_USER=(-u "${GPG_KEY}") + fi + ( + cd "$(dirname "${INDEX_FILE}")" + index_name="$(basename "${INDEX_FILE}")" + rm -f "${index_name}.asc" + gpg ${GPG_USER[@]+"${GPG_USER[@]}"} --pinentry-mode loopback -ab "${index_name}" + sha512 -b "${index_name}" > "${index_name}.sha512" + ) + echo "Signed ${INDEX_FILE}, and wrote its checksum" +fi diff --git a/hack/release/wizard/releaseWizard.yaml b/hack/release/wizard/releaseWizard.yaml index 6622c3984..5c912e27d 100644 --- a/hack/release/wizard/releaseWizard.yaml +++ b/hack/release/wizard/releaseWizard.yaml @@ -1101,29 +1101,10 @@ groups: cmd: svn move -m "Move Solr Operator {{ release_version }} RC{{ rc_number }} to release repo" {{ dist_stage_url }} {{ dist_release_url }} logfile: svn_mv_solr_operator.log tee: true - - !Todo - id: publish_helm_charts - title: Publish the staged Helm charts - depends: svn_release_mv - vars: - dist_release_url: https://dist.apache.org/repos/dist/release/solr/solr-operator/{{ release_version }} - official_helm_charts_url: https://nightlies.apache.org/solr/release/helm-charts - commands: !Commands - root_folder: '{{ git_checkout_folder }}' - confirm_each_command: false - commands_text: | - This will upload the staged Helm chart to the release location in nightlies.apache.org. - You will be prompted for your Apache password in the beggining, to use when uploading. - Next you will be prompted for your GPG Key passphrase, to sign the helm index.yaml. - commands: - - !Command - cmd: ./hack/release/upload/upload_helm.sh -g "{{ gpg_key | default("", True) }}" -a "{{ gpg.apache_id | default("", True) }}" -c "{{ official_helm_charts_url }}" -r "{{ dist_release_url }}" - logfile: upload_helm.log - tee: true - !Todo id: publish_helm_charts_oci title: Publish Helm charts to the OCI registry (GHCR) - depends: publish_helm_charts + depends: svn_release_mv vars: dist_release_url: https://dist.apache.org/repos/dist/release/solr/solr-operator/{{ release_version }} solr_operator_chart_url: '{{ dist_release_url }}/helm-charts/solr-operator-{{ release_version[1:] }}.tgz' @@ -1250,16 +1231,19 @@ groups: title: Check state of ArtifactHub entries depends: - publish_docker_image - - publish_helm_charts - publish_helm_charts_oci + - publish_website description: | Check to make sure that ArtifactHub has successfully loaded the {{ release_version }} version of the Solr Operator and Solr Helm Charts. Mark this as complete when you have confirmed all aspects of the chart in artifactHub. The ChangeLog is very finicky, so make sure that it renders correctly. - Note that ArtifactHub still indexes the HTTPS chart repository, not the OCI registry, - so the OCI copies published in the previous step will not show up here. + ArtifactHub tracks the Helm repository at https://solr.apache.org/charts, so the new version + only shows up once the website, with the updated index.yaml, has been published. The index + entries point at the OCI copies on ghcr.io, which ArtifactHub downloads to read the charts. + If the new version does not appear after the next ArtifactHub scan (up to ~30 minutes), check + the repository's tracking errors on ArtifactHub (control panel > repositories) before anything else. links: - https://artifacthub.io/packages/helm/apache-solr/solr-operator - https://artifacthub.io/packages/helm/apache-solr/solr @@ -1381,6 +1365,46 @@ groups: cmd: git add content/doap/solr-operator.rdf && git commit -m "DOAP changes for Solr Operator release {{ release_version }}" logfile: commit.log stdout: true + - !Todo + id: website_update_helm_index + title: Add the release to the Helm repository index + depends: + - website_git_clone + - publish_helm_charts_oci + vars: + dist_release_url: https://dist.apache.org/repos/dist/release/solr/solr-operator/{{ release_version }} + helm_index_file: '{{ [git_website_folder, "content", "charts", "index.yaml"] | path_join }}' + description: | + The Helm repository at https://solr.apache.org/charts is the index.yaml checked into the + website, under content/charts/. Its entries point at the OCI copies of the charts on ghcr.io, + so the charts must have been published to the OCI registry first. + + The script downloads the released charts from dist.apache.org, verifies their checksums and + signatures, and adds entries for them to the index, pointing at: + - oci://ghcr.io/apache/solr-operator/helm/solr-operator:{{ release_version[1:] }} + - oci://ghcr.io/apache/solr-operator/helm/solr:{{ release_version[1:] }} + It then signs the index, and writes its checksum. + commands: !Commands + root_folder: '{{ git_checkout_folder }}' + confirm_each_command: false + commands_text: | + This will add the new release to the website's Helm repository index. + You will be prompted for your GPG Key passphrase, to sign the index.yaml. + commands: + - !Command + cmd: git checkout {{ release_version }} && make yq + comment: The index script and yq come from the release tag + tee: true + - !Command + cmd: ./hack/release/upload/update_helm_index.sh -g "{{ gpg_key | default("", True) }}" -r "{{ dist_release_url }}" -i "{{ helm_index_file }}" + logfile: update_helm_index.log + tee: true + - !Command + cmd: git -C "{{ git_website_folder }}" add content/charts && git -C "{{ git_website_folder }}" commit -m "Add Solr Operator {{ release_version }} to the Helm repository index" + logfile: commit.log + stdout: true + post_description: | + You will push and verify all changes in a later step - !Todo id: update_other title: Update rest of webpage @@ -1415,6 +1439,7 @@ groups: - prepare_announce - website_update_doap - website_update_versions + - website_update_helm_index description: | Push the website changes to 'main' branch, and check the staging site. You will get a chance to preview the diff of all changes before you push. @@ -1473,6 +1498,15 @@ groups: Wait a few minutes for the build to happen. You can follow the site build at https://ci2.apache.org/#/builders/3 Verify on https://solr.apache.org/operator that the site is OK. + + Then verify that the Helm repository serves the new release, with a throwaway repo name, + and no registry credentials: + + helm registry logout ghcr.io + helm repo add apache-solr-check https://solr.apache.org/charts + helm show chart apache-solr-check/solr-operator --version {{ release_version[1:] }} + helm show chart apache-solr-check/solr --version {{ release_version[1:] }} + helm repo remove apache-solr-check links: - https://ci2.apache.org/#/builders/3 - https://solr.apache.org diff --git a/helm/solr-operator/Chart.yaml b/helm/solr-operator/Chart.yaml index ad6a8b682..775da65ba 100644 --- a/helm/solr-operator/Chart.yaml +++ b/helm/solr-operator/Chart.yaml @@ -181,6 +181,11 @@ annotations: url: https://github.com/apache/solr-operator/issues/556 - name: Github PR url: https://github.com/apache/solr-operator/pull/892 + - kind: changed + description: The Helm charts are now distributed as OCI artifacts, from oci://ghcr.io/apache/solr-operator/helm. The Helm repository at https://solr.apache.org/charts lists the same charts, so existing `helm repo add` setups keep working, but it now requires Helm 3.8 or later + links: + - name: Github PR + url: https://github.com/apache/solr-operator/pull/814 artifacthub.io/images: | - name: solr-operator image: apache/solr-operator:v0.10.0-prerelease diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md index 79acc1a40..9fb5f0696 100644 --- a/helm/solr-operator/README.md +++ b/helm/solr-operator/README.md @@ -38,6 +38,9 @@ You should only need to add the solr operator helm chart repository once, by run helm repo add apache-solr https://solr.apache.org/charts ``` +The charts are published as OCI artifacts to `oci://ghcr.io/apache/solr-operator/helm`, and the repository above lists them from there, which requires Helm 3.8 or later. +Instead of adding the repository, you can also install straight from the OCI registry, by replacing `apache-solr/solr-operator` in the commands below with `oci://ghcr.io/apache/solr-operator/helm/solr-operator`. + ### Installing the Chart To install the Solr Operator for the first time in your cluster, you can use the latest version or a specific version, run with the following commands: diff --git a/helm/solr/Chart.yaml b/helm/solr/Chart.yaml index acd1d8f54..94983317c 100644 --- a/helm/solr/Chart.yaml +++ b/helm/solr/Chart.yaml @@ -75,6 +75,11 @@ annotations: links: - name: Solr Security News url: https://solr.apache.org/security-news.html + - kind: changed + description: The Helm charts are now distributed as OCI artifacts, from oci://ghcr.io/apache/solr-operator/helm. The Helm repository at https://solr.apache.org/charts lists the same charts, so existing `helm repo add` setups keep working, but it now requires Helm 3.8 or later + links: + - name: Github PR + url: https://github.com/apache/solr-operator/pull/814 artifacthub.io/containsSecurityUpdates: "true" artifacthub.io/recommendations: | - url: https://artifacthub.io/packages/helm/apache-solr/solr-operator From 006c4c6ae9aa1c5b9c8371913c969446db7d370a Mon Sep 17 00:00:00 2001 From: Houston Putman Date: Tue, 17 Nov 2026 15:48:07 -0800 Subject: [PATCH 11/12] Remove the Helm OCI index GitHub workflow The test script is meant to be run locally when the index tooling changes. --- .github/workflows/helm-oci-index.yaml | 72 --------------------------- dev-docs/helm-repository.md | 2 +- 2 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 .github/workflows/helm-oci-index.yaml diff --git a/.github/workflows/helm-oci-index.yaml b/.github/workflows/helm-oci-index.yaml deleted file mode 100644 index eb71a2ff6..000000000 --- a/.github/workflows/helm-oci-index.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: Helm OCI Index - -# The Helm repository at https://solr.apache.org/charts is an index.yaml whose entries point at -# the OCI copies of the charts on ghcr.io. This tests that every Helm version we document can -# consume such an index, using hack/release/smoke_test/test_oci_index.sh. -# -# This is a separate workflow, rather than a job in smoke-tests.yaml, because that workflow -# ignores hack/release/upload/**, where the index generator lives. - -on: - pull_request: - branches: - - 'main' - - 'release-*' - paths: - - '.github/workflows/helm-oci-index.yaml' - - 'hack/release/smoke_test/test_oci_index.sh' - - 'hack/release/upload/update_helm_index.sh' - - 'helm/**' - workflow_dispatch: - -permissions: - contents: read - -jobs: - test: - name: Helm ${{ matrix.helm }} - runs-on: ubuntu-latest - timeout-minutes: 20 - - strategy: - fail-fast: false - matrix: - # 3.8 is the first release with OCI out of experimental; 4.3.1 is what - # publish-helm-oci.yaml pins. Keep in sync with DEFAULT_HELM_VERSIONS in the script. - helm: [ '3.8.2', '3.19.0', '4.3.1' ] - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Setup go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: '1.27' - - # The host Helm only packages and signs the charts. The Helm version under test runs in a - # container, which the script downloads from get.helm.sh. This SHA must stay on the ASF - # allowlist, see the note in publish-helm-oci.yaml. - - name: Install Helm - uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 - with: - version: 'v4.3.1' - - - run: make yq - - name: Test the OCI index with Helm ${{ matrix.helm }} - run: ./hack/release/smoke_test/test_oci_index.sh -H "${{ matrix.helm }}" diff --git a/dev-docs/helm-repository.md b/dev-docs/helm-repository.md index 3566b7e16..87290961e 100644 --- a/dev-docs/helm-repository.md +++ b/dev-docs/helm-repository.md @@ -30,7 +30,7 @@ An index with `oci://` chart urls needs Helm 3.8 or later. [`test_oci_index.sh`](../hack/release/smoke_test/test_oci_index.sh) checks every way of consuming the index (repo add/update, search, show, pull with and without `--verify`, install-style chart resolution, and `helm dependency update` with a repository url or an `@alias`). It runs against -Helm 3.8.2, 3.19.0 and 4.3.1, in the `Helm OCI Index` GitHub workflow, and locally with: +Helm 3.8.2, 3.19.0 and 4.3.1 by default. Run it locally when changing the index tooling: ```bash make yq From d8b1498b834fbbed0b4188c2935adf14644cf227 Mon Sep 17 00:00:00 2001 From: Houston Putman Date: Thu, 19 Nov 2026 12:42:17 -0800 Subject: [PATCH 12/12] Document verifying the Helm charts The charts are signed, but the docs never said how to verify them. Add a "Verifying the Helm charts" section to the upgrade notes, with both chart sources as tabs, and link it from the install docs and the chart READMEs. --verify is not added to every install command, since it needs the Solr KEYS exported to a legacy-format keyring first: Helm reads ~/.gnupg/pubring.gpg by default, which GnuPG 2.1 and later no longer write. --- .../pages/running-the-operator.adoc | 1 + .../upgrade-notes/pages/upgrade-notes.adoc | 48 ++++++++++++++++++- helm/solr-operator/README.md | 1 + helm/solr/README.md | 1 + 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/docs/modules/getting-started/pages/running-the-operator.adoc b/docs/modules/getting-started/pages/running-the-operator.adoc index 2fdc42a47..dc29b6a8c 100644 --- a/docs/modules/getting-started/pages/running-the-operator.adoc +++ b/docs/modules/getting-started/pages/running-the-operator.adoc @@ -38,6 +38,7 @@ $ kubectl create -f https://solr.apache.org/operator/downloads/crds/v{operator-v Then install the Solr Operator chart. The chart is published to the GitHub Container Registry as an OCI artifact, and the Helm repository at `https://solr.apache.org/charts` lists the same chart. Both are supported, see xref:upgrade-notes:upgrade-notes.adoc#where-the-helm-charts-are-published[Where the Helm charts are published]. +The charts are signed, and can be verified when installing, see xref:upgrade-notes:upgrade-notes.adoc#verifying-the-helm-charts[Verifying the Helm charts]. [tabs#install-solr-operator] ====== diff --git a/docs/modules/upgrade-notes/pages/upgrade-notes.adoc b/docs/modules/upgrade-notes/pages/upgrade-notes.adoc index 887c1a879..efe2c8e9c 100644 --- a/docs/modules/upgrade-notes/pages/upgrade-notes.adoc +++ b/docs/modules/upgrade-notes/pages/upgrade-notes.adoc @@ -135,7 +135,53 @@ helm install example apache-solr/solr --version {operator-version} ====== The signed chart tarballs on the Apache download mirrors remain the official release artifacts. -The OCI copies are byte-identical to them, so `helm install --verify` works with either source. +The OCI copies are byte-identical to them, and carry the same signatures, so the charts can be verified with either source. +See <>. + +[#verifying-the-helm-charts] +=== Verifying the Helm charts + +The charts are signed with the Solr release signing keys, and Helm can check that signature when installing or upgrading, with `--verify`. + +Helm reads keys from a keyring in the legacy GnuPG format, `~/.gnupg/pubring.gpg` by default. +GnuPG 2.1 and later no longer write that file, so import the Solr keys and export them to a keyring for Helm first: + +[source,bash] +---- +curl -sL https://dist.apache.org/repos/dist/release/solr/KEYS | gpg --import +gpg --export > ~/solr-keyring.gpg +---- + +Then pass `--verify` and the keyring to `helm install` or `helm upgrade`: + +[tabs#verify-helm-charts] +====== +OCI Charts:: ++ +==== +[source,bash,subs="verbatim,attributes"] +---- +helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version {operator-version} \ + --verify --keyring ~/solr-keyring.gpg +helm install example oci://ghcr.io/apache/solr-operator/helm/solr --version {operator-version} \ + --verify --keyring ~/solr-keyring.gpg +---- +==== + +Charts Repo:: ++ +==== +[source,bash,subs="verbatim,attributes"] +---- +helm install solr-operator apache-solr/solr-operator --version {operator-version} \ + --verify --keyring ~/solr-keyring.gpg +helm install example apache-solr/solr --version {operator-version} \ + --verify --keyring ~/solr-keyring.gpg +---- +==== +====== + +Helm refuses to install a chart whose signature does not verify against the keyring. == Installing the Solr Operator vs Solr CRDs diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md index b83383ef9..8934e2217 100644 --- a/helm/solr-operator/README.md +++ b/helm/solr-operator/README.md @@ -35,6 +35,7 @@ If you do not wish to use the Zookeeper Operator, set: The Solr Operator Helm chart is published as an OCI artifact to the GitHub Container Registry, and the Helm repository at `https://solr.apache.org/charts` lists the same chart. Both are supported, see [Where the Helm charts are published](https://solr.apache.org/guide/operator/latest/upgrade-notes/upgrade-notes.html#where-the-helm-charts-are-published). +The charts are signed, and can be verified when installing, see [Verifying the Helm charts](https://solr.apache.org/guide/operator/latest/upgrade-notes/upgrade-notes.html#verifying-the-helm-charts). Install the CRDs first. Helm does not install the `ZookeeperCluster` CRD, so this step is required whichever chart source you use: diff --git a/helm/solr/README.md b/helm/solr/README.md index a033867ea..9149510f7 100644 --- a/helm/solr/README.md +++ b/helm/solr/README.md @@ -35,6 +35,7 @@ There may be breaking changes between the version you are using and the version The Solr Helm chart is published as an OCI artifact to the GitHub Container Registry, and the Helm repository at `https://solr.apache.org/charts` lists the same chart. Both are supported, see [Where the Helm charts are published](https://solr.apache.org/guide/operator/latest/upgrade-notes/upgrade-notes.html#where-the-helm-charts-are-published). +The charts are signed, and can be verified when installing, see [Verifying the Helm charts](https://solr.apache.org/guide/operator/latest/upgrade-notes/upgrade-notes.html#verifying-the-helm-charts). To install a SolrCloud for the first time in your cluster, you can use the latest version or a specific version: