Skip to content

Commit e79b942

Browse files
committed
Prepare for OCI publishing of helm charts to docker hub
1 parent ed5c5c7 commit e79b942

5 files changed

Lines changed: 178 additions & 13 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
name: Publish Helm Charts to OCI Registry
19+
20+
on:
21+
workflow_dispatch:
22+
inputs:
23+
solr-operator-chart-url:
24+
description: 'URL to solr-operator Helm chart tarball (e.g., https://dist.apache.org/repos/dist/release/solr/solr-operator/v0.10.0/helm-charts/solr-operator-0.10.0.tgz)'
25+
required: true
26+
type: string
27+
solr-chart-url:
28+
description: 'URL to solr Helm chart tarball (e.g., https://dist.apache.org/repos/dist/release/solr/solr-operator/v0.10.0/helm-charts/solr-0.10.0.tgz)'
29+
required: true
30+
type: string
31+
32+
jobs:
33+
publish-oci:
34+
name: Publish Helm Charts to OCI Registry
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Install Helm
38+
uses: azure/setup-helm@v4
39+
with:
40+
version: 'latest'
41+
42+
- name: Download Helm Charts
43+
run: |
44+
echo "Downloading solr-operator chart from: ${{ inputs.solr-operator-chart-url }}"
45+
wget -O solr-operator.tgz "${{ inputs.solr-operator-chart-url }}"
46+
47+
echo "Downloading solr chart from: ${{ inputs.solr-chart-url }}"
48+
wget -O solr.tgz "${{ inputs.solr-chart-url }}"
49+
50+
echo "Charts downloaded successfully"
51+
ls -lh *.tgz
52+
53+
- name: Login to Docker Hub
54+
run: |
55+
echo "Logging in to Docker Hub as ${{ secrets.DOCKERHUB_USER }}"
56+
echo "${{ secrets.DOCKERHUB_TOKEN }}" | helm registry login docker.io -u "${{ secrets.DOCKERHUB_USER }}" --password-stdin
57+
echo "Login successful"
58+
59+
- name: Push solr-operator chart to OCI registry
60+
run: |
61+
echo "Pushing solr-operator chart to oci://docker.io/apache/solr-operator-chart"
62+
helm push solr-operator.tgz oci://docker.io/apache/solr-operator-chart
63+
echo "solr-operator chart pushed successfully"
64+
65+
- name: Push solr chart to OCI registry
66+
run: |
67+
echo "Pushing solr chart to oci://docker.io/apache/solr-chart"
68+
helm push solr.tgz oci://docker.io/apache/solr-chart
69+
echo "solr chart pushed successfully"
70+
71+
- name: Logout from Docker Hub
72+
if: always()
73+
run: |
74+
helm registry logout docker.io
75+
echo "Logged out from Docker Hub"
76+
77+
- name: Summary
78+
if: success()
79+
run: |
80+
echo "✅ Successfully published Helm charts to OCI registries:"
81+
echo " - oci://docker.io/apache/solr-operator-chart"
82+
echo " - oci://docker.io/apache/solr-chart"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ Join us on the [#solr-operator](https://kubernetes.slack.com/messages/solr-opera
5454
Please visit the following pages for documentation on using and developing the Solr Operator:
5555

5656
- [Local Tutorial](https://solr.apache.org/guide/operator/latest/getting-started/local-tutorial.html)
57-
- [Helm Instructions via Artifact Hub](https://artifacthub.io/packages/helm/apache-solr/solr-operator)
57+
- **Helm Chart Installation**
58+
- The Helm charts are published as OCI artifacts (recommended):
59+
- **Solr Operator**: `helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version <VERSION>`
60+
- **Solr Cloud**: `helm install solr oci://ghcr.io/apache/solr-operator/helm/solr --version <VERSION>`
61+
- Or via the deprecated HTTPS repository: [Helm Instructions via Artifact Hub](https://artifacthub.io/packages/helm/apache-solr/solr-operator)
5862
- The released helm charts and their instructions should be used for all safe and stable deployments.
5963
The charts found in `helm/` are not guaranteed to be compatible with the last stable release, and should only be used for development purposes.
6064
- [Running the Solr Operator](https://solr.apache.org/guide/operator/latest/getting-started/running-the-operator.html)

hack/release/wizard/releaseWizard.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,45 @@ groups:
11201120
cmd: ./hack/release/upload/upload_helm.sh -g "{{ gpg_key | default("<gpg_key_id>", True) }}" -a "{{ gpg.apache_id | default("<apache_id>", True) }}" -c "{{ official_helm_charts_url }}" -r "{{ dist_release_url }}"
11211121
logfile: upload_helm.log
11221122
tee: true
1123+
- !Todo
1124+
id: publish_helm_charts_oci
1125+
title: Publish Helm charts to OCI registry (Docker Hub)
1126+
depends: publish_helm_charts
1127+
vars:
1128+
dist_release_url: https://dist.apache.org/repos/dist/release/solr/solr-operator/{{ release_version }}
1129+
solr_operator_chart_url: '{{ dist_release_url }}/helm-charts/solr-operator-{{ release_version[1:] }}.tgz'
1130+
solr_chart_url: '{{ dist_release_url }}/helm-charts/solr-{{ release_version[1:] }}.tgz'
1131+
workflow_url: https://github.com/apache/solr-operator/actions/workflows/publish-helm-oci.yaml
1132+
description: |
1133+
Publish the Helm charts to OCI registries on Docker Hub using the GitHub Actions workflow.
1134+
1135+
This task publishes the voted Helm charts to OCI registries, making them available via:
1136+
- oci://docker.io/apache/solr-operator-chart
1137+
- oci://docker.io/apache/solr-chart
1138+
1139+
Steps to publish:
1140+
1. Navigate to the GitHub Actions workflow:
1141+
{{ workflow_url }}
1142+
1143+
2. Click the "Run workflow" button on the right side
1144+
1145+
3. Fill in the workflow inputs:
1146+
- solr-operator-chart-url: {{ solr_operator_chart_url }}
1147+
- solr-chart-url: {{ solr_chart_url }}
1148+
1149+
4. Click "Run workflow" to start the publishing job
1150+
1151+
5. Monitor the workflow execution for any errors
1152+
1153+
6. Verify successful completion by checking that both charts are accessible:
1154+
helm pull oci://docker.io/apache/solr-operator-chart --version {{ release_version[1:] }}
1155+
helm pull oci://docker.io/apache/solr-chart --version {{ release_version[1:] }}
1156+
1157+
Note: The workflow uses repository secrets DOCKERHUB_USER and DOCKERHUB_TOKEN for authentication.
1158+
links:
1159+
- '{{ workflow_url }}'
1160+
- '{{ solr_operator_chart_url }}'
1161+
- '{{ solr_chart_url }}'
11231162
- !Todo
11241163
id: publish_crds
11251164
title: Publish the staged CRDs
@@ -1179,11 +1218,14 @@ groups:
11791218
depends:
11801219
- publish_docker_image
11811220
- publish_helm_charts
1221+
- publish_helm_charts_oci
11821222
description: |
11831223
Check to make sure that ArtifactHub has successfully loaded the {{ release_version }} version of the Solr Operator and Solr Helm Charts.
11841224
Mark this as complete when you have confirmed all aspects of the chart in artifactHub.
11851225
11861226
The ChangeLog is very finicky, so make sure that it renders correctly.
1227+
1228+
Also verify that the OCI registry information is correctly displayed on ArtifactHub.
11871229
links:
11881230
- https://artifacthub.io/packages/helm/apache-solr/solr-operator
11891231
- https://artifacthub.io/packages/helm/apache-solr/solr

helm/solr-operator/README.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,34 @@ If you do not wish to use the Zookeeper Operator, set:
3131
- `zookeeper-operator.use: false`
3232

3333

34-
### Adding the Solr Operator Helm Chart Repository
35-
You should only need to add the solr operator helm chart repository once, by running the following command:
34+
### Installing the Chart
35+
36+
The Solr Operator Helm chart can be installed using either the OCI registry (recommended) or the traditional HTTPS repository.
37+
38+
#### Installation via OCI Registry (Recommended)
39+
40+
The Helm chart is available directly from Docker Hub as an OCI artifact, which provides a more reliable distribution mechanism and doesn't require adding a repository.
3641

3742
```bash
38-
helm repo add apache-solr https://solr.apache.org/charts
43+
# Install CRDs first
44+
kubectl create -f https://solr.apache.org/operator/downloads/crds/v0.10.0-prerelease/all-with-dependencies.yaml
45+
46+
# Install the Solr Operator from OCI registry
47+
helm install solr-operator oci://docker.io/apache/solr-operator-chart --version 0.10.0-prerelease
3948
```
4049

41-
### Installing the Chart
50+
#### Installation via HTTPS Repository (Traditional)
4251

43-
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:
52+
If you prefer the traditional method, you can add the Helm repository and install from there.
4453

4554
```bash
55+
# Add the repository (only needed once)
56+
helm repo add apache-solr https://solr.apache.org/charts
57+
58+
# Install CRDs first
4659
kubectl create -f https://solr.apache.org/operator/downloads/crds/v0.10.0-prerelease/all-with-dependencies.yaml
60+
61+
# Install the Solr Operator from HTTPS repository
4762
helm install solr-operator apache-solr/solr-operator --version 0.10.0-prerelease
4863
```
4964

@@ -57,7 +72,13 @@ _Note that the Helm chart version does not contain a `v` prefix, which the downl
5772
If you are upgrading your Solr Operator deployment, you should always use a specific version of the chart and pre-install the Solr CRDS:
5873

5974
```bash
75+
# Upgrade CRDs first
6076
kubectl replace -f https://solr.apache.org/operator/downloads/crds/v0.10.0-prerelease/all-with-dependencies.yaml
77+
78+
# Upgrade via OCI registry (recommended)
79+
helm upgrade solr-operator oci://docker.io/apache/solr-operator-chart --version 0.10.0-prerelease
80+
81+
# Or upgrade via HTTPS repository (traditional)
6182
helm upgrade solr-operator apache-solr/solr-operator --version 0.10.0-prerelease
6283
```
6384

@@ -67,18 +88,20 @@ If you want to specify the namespace for the installation, use the `--namespace`
6788
All resources will be deployed to the given namespace.
6889

6990
```bash
70-
helm install solr-operator apache-solr/solr-operator --namespace solr
91+
helm install solr-operator oci://docker.io/apache/solr-operator-chart --version 0.10.0-prerelease --namespace solr
7192
```
7293

7394
If you want to only watch that namespace, or others, then you will have to provide the `watchNamespaces` option.
7495

7596
```bash
7697
# Watch the namespace where the operator is deployed to (just pass the boolean true)
77-
helm install solr-operator apache-solr/solr-operator --namespace solr --set watchNamespaces=true
98+
helm install solr-operator oci://docker.io/apache/solr-operator-chart --version 0.10.0-prerelease --namespace solr --set watchNamespaces=true
99+
78100
# Watch a single namespace different than the one being deployed to
79-
helm install solr-operator apache-solr/solr-operator --namespace solr --set watchNamespaces=other
80-
# Watch multiple namespaces (commmas must be escaped in the set string)
81-
helm install solr-operator apache-solr/solr-operator --namespace solr --set watchNamespaces="team1\,team2\,team3"
101+
helm install solr-operator oci://docker.io/apache/solr-operator-chart --version 0.10.0-prerelease --namespace solr --set watchNamespaces=other
102+
103+
# Watch multiple namespaces (commas must be escaped in the set string)
104+
helm install solr-operator oci://docker.io/apache/solr-operator-chart --version 0.10.0-prerelease --namespace solr --set watchNamespaces="team1\,team2\,team3"
82105
```
83106

84107
Note: Passing `false` or `""` to the `watchNamespaces` variable will both result in the operator watchting all namespaces in the Kube cluster.
@@ -91,7 +114,11 @@ If you have solr operator installations in multiple namespaces that are managed
91114
This can be done with the `--skip-crds` helm option.
92115

93116
```bash
94-
helm install solr-operator apache-solr/solr-operator --skip-crds --namespace solr
117+
# Via OCI registry
118+
helm install solr-operator oci://docker.io/apache/solr-operator-chart --version 0.10.0-prerelease --skip-crds --namespace solr
119+
120+
# Or via HTTPS repository
121+
helm install solr-operator apache-solr/solr-operator --version 0.10.0-prerelease --skip-crds --namespace solr
95122
```
96123

97124
**Helm will not upgrade CRDs once they have been installed.

helm/solr/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ There may be breaking changes between the version you are using and the version
3333

3434
### Installing the Chart
3535

36-
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:
36+
The Solr Helm chart can be installed using either the OCI registry (recommended) or the traditional HTTPS helm repository.
37+
38+
To install a SolrCloud for the first time in your cluster, you can use the latest version or a specific version:
3739

3840
```bash
41+
# Via OCI registry (recommended)
42+
helm install example oci://docker.io/apache/solr-chart --version 0.10.0-prerelease --set image.tag=9.10.0
43+
44+
# Or via HTTPS helm repository (traditional)
3945
helm install example apache-solr/solr --version 0.10.0-prerelease --set image.tag=9.10.0
4046
```
4147

@@ -50,6 +56,10 @@ _Note that the Helm chart version does not contain a `v` prefix, which the Solr
5056
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**:
5157

5258
```bash
59+
# Via OCI registry (recommended)
60+
helm upgrade example oci://docker.io/apache/solr-chart --version 0.10.0-prerelease --reuse-values --set image.tag=9.10.0
61+
62+
# Or via HTTPS repository (traditional)
5363
helm upgrade example apache-solr/solr --version 0.10.0-prerelease --reuse-values --set image.tag=9.10.0
5464
```
5565

0 commit comments

Comments
 (0)