Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ 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**, from either [chart source](https://solr.apache.org/guide/operator/latest/upgrade-notes/upgrade-notes.html#where-the-helm-charts-are-published):
- **OCI Charts**
- **Solr Operator**: `helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version <VERSION>`
- **Solr Cloud**: `helm install solr oci://ghcr.io/apache/solr-operator/helm/solr --version <VERSION>`
- **Charts Repo** (Helm 3.8+), after `helm repo add apache-solr https://solr.apache.org/charts`
- **Solr Operator**: `helm install solr-operator apache-solr/solr-operator --version <VERSION>`
- **Solr Cloud**: `helm install solr apache-solr/solr --version <VERSION>`
- 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)
Expand Down
78 changes: 78 additions & 0 deletions dev-docs/helm-repository.md
Original file line number Diff line number Diff line change
@@ -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: <sha256 of the released chart tarball>
...
```

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 by default. Run it locally when changing the index tooling:

```bash
make yq
./hack/release/smoke_test/test_oci_index.sh # or -H "<helm versions>" 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.
91 changes: 81 additions & 10 deletions docs/modules/getting-started/pages/local-tutorial.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
= Solr on Kubernetes on local Mac
:tabs-sync-option:
// 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
Expand Down Expand Up @@ -79,24 +80,43 @@ 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)
First install the Solr & Zookeeper CRDs:

[source,bash]
[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
----

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].
Then install the Solr Operator chart.
This will install the https://github.com/pravega/zookeeper-operator[Zookeeper Operator] by default.
The charts are published to the GitHub Container Registry as OCI artifacts, and are also listed in the Helm repository at `https://solr.apache.org/charts`.
Pick either, the rest of the tutorial follows your choice.
See xref:upgrade-notes:upgrade-notes.adoc#where-the-helm-charts-are-published[Where the Helm charts are published] for more.

[tabs#install-solr-operator]
======
OCI Charts::
+
====
[source,bash,subs="verbatim,attributes"]
----
$ helm install solr-operator oci://ghcr.io/apache/solr-operator/helm/solr-operator --version {operator-version}
----
====

Charts Repo::
+
====
Add the Helm repository once, which requires Helm `v3.8` or later:

[source,bash,subs="verbatim,attributes"]
----
# 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 repo add apache-solr https://solr.apache.org/charts
$ helm repo update
$ helm install solr-operator apache-solr/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._

Expand Down Expand Up @@ -125,17 +145,43 @@ After inspecting the status of you Kube cluster, you should see a deployment for

To start a Solr Cloud cluster, we will create a yaml that will tell the Solr Operator what version of Solr Cloud to run, and how many nodes, with how much memory etc.

Create a 3-node cluster v9.10.0 with 300m Heap each:

[tabs#install-solr]
======
OCI Charts::
+
====
[source,bash,subs="verbatim,attributes"]
----
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 \
--set addressability.external.domainName="ing.local.domain" \
--set addressability.external.useExternalAddress="true" \
--set ingressOptions.ingressClassName="nginx"
----
====

Charts Repo::
+
====
[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} \
--set image.tag=9.10.0 \
--set solrOptions.javaMemory="-Xms300m -Xmx300m" \
--set addressability.external.method=Ingress \
--set addressability.external.domainName="ing.local.domain" \
--set addressability.external.useExternalAddress="true" \
--set ingressOptions.ingressClassName="nginx"
----
====
======

[source,bash,subs="verbatim,attributes"]
----
# The solr-operator has created a new resource type 'solrclouds' which we can query
# Check the status live as the deploy happens
kubectl get solrclouds -w
Expand Down Expand Up @@ -222,12 +268,37 @@ So we wish to upgrade to a newer Solr version:
----
# Take note of the current 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:

# Update the solrCloud configuration with the new version, keeping all previous settings and the number of nodes set by the autoscaler.
[tabs#upgrade-solr]
======
OCI Charts::
+
====
[source,bash,subs="verbatim,attributes"]
----
helm upgrade example-solr oci://ghcr.io/apache/solr-operator/helm/solr --version {operator-version} \
--reuse-values \
--set image.tag=9.11.0
----
====

Charts Repo::
+
====
[source,bash,subs="verbatim,attributes"]
----
helm upgrade example-solr apache-solr/solr --version {operator-version} \
--reuse-values \
--set image.tag=9.11.0
----
====
======

[source,bash,subs="verbatim,attributes"]
----
# Click the 'Show all details" button in Admin UI and start hitting the "Refresh" button
# See how the operator upgrades one pod at a time. Solr version is in the 'node' column
# You can also watch the status with the 'kubectl get solrclouds' command
Expand Down
46 changes: 35 additions & 11 deletions docs/modules/getting-started/pages/running-the-operator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,54 @@

== 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].

The first step is to add the Solr Operator helm repository.
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]
[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
----

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.
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]
======
OCI Charts::
+
====
Nothing needs to be added or configured first, and no credentials are required.

[source,bash,subs="verbatim,attributes"]
----
$ 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}
----
====

Charts Repo::
+
====
This requires Helm `v3.8` or later.

[source,bash,subs="verbatim,attributes"]
----
$ helm repo add apache-solr https://solr.apache.org/charts
$ helm repo update
$ helm install solr-operator apache-solr/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._

Expand Down Expand Up @@ -73,9 +97,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.
Expand Down
Loading