solr-operator
The Solr Operator enables easy management of Solr resources within Kubernetes.
About this chart
Solr Operator
NOTE: This chart is a temporary direct copy of the helm chart in the https://github.com/apache/solr-operator repo until they have a working helm release to use instead at which point this chart will be deleted.
The Solr Operator is designed to allow easy deployment Solr Clouds and other Solr Resources to Kubernetes.
Documentation around using the Solr Operator can be found in it's source repo.
Using the Helm Chart
Installing the Zookeeper Operator
Before installing the Solr Operator, we need to install the Zookeeper Operator. This is because the Solr Operator, in most instances, relies on the Zookeeper Operator to create the Zookeeper clusters that Solr coordinates through.
If you are setting useZkOperator=false, then please disregard this section.
Eventually the Zookeeper Operator will be a dependency on the Solr Operator helm chart, but for now there are two easy ways to deploy it.
- A helm chart is available in the Zookeeper Operator repository.
- Use the following kubectl command:
kubectl apply -f https://apache.github.io/lucene-solr-operator/example/dependencies/zk_operator.yaml
Helm
Eventually this will be a dependency on the helm chart, but for now we can run an easy kubectl apply.
kubectl apply -f https://apache.github.io/lucene-solr-operator/example/dependencies/zk_operator.yaml
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:
$ helm repo add apache-solr https://apache.github.io/lucene-solr-operator/charts
Installing the Chart
To install the Solr Operator with the latest version or with a specific version, run either of the following commands:
$ helm install solr-operator apache-solr/solr-operator
$ helm install solr-operator apache-solr/solr-operator --version 0.2.5
The command deploys the solr-operator on the Kubernetes cluster with the default configuration. The configuration section lists the parameters that can be configured during installation.
Namespaces
If you want to specify the namespace for the installation, use the --namespace flag.
All resources will be deployed to the given namespace.
$ helm install solr-operator apache-solr/solr-operator --namespace solr
If you want to only watch that namespace, or others, then you will have to provide the watchNamespaces option.
// 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
// 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"
Note: Passing false or "" to the watchNamespaces variable will both result in the operator watchting all namespaces in the Kube cluster.
Managing CRDs
Helm 3
Helm 3 automatically runs CRDs in the /crds directory, no further action is needed.
If 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.
$ helm install solr-operator apache-solr/solr-operator --skip-crds --namespace solr
Helm 2
If you are using Helm 2, CRDs are installed using the crd-install hook. Prior to installing, you'll need to uncomment the last two lines in kustomization.yaml, and run make manifests
You will also need to update the install command to use the name flag, as shown below.
$ helm install --name solr-operator apache-solr/solr-operator
Uninstalling the Chart
To uninstall/delete the solr-operator deployment:
Helm 3
$ helm uninstall solr-operator
Helm 2
$ helm delete solr-operator
The command removes all the Kubernetes components associated with the chart and deletes the release.
Chart Values
Configuring the Solr Operator
| Key | Type | Default | Description |
|---|---|---|---|
| watchNamespaces | string | "" | A comma-separated list of namespaces that the solr operator should watch. If empty, the solr operator will watch all namespaces in the cluster. If set to true, this will be populated with the namespace that the operator is deployed to. |
| useZkOperator | string | "true" | This option enables the use of provided Zookeeper instances for SolrClouds |
Running the Solr Operator
| Key | Type | Default | Description |
|---|---|---|---|
| image.repository | string | "apache/solr-operator" | The repository of the Solr Operator image |
| image.tag | string | "v0.2.8" | The tag/version of the Solr Operator to run |
| image.pullPolicy | string | "Always" | |
| fullnameOverride | string | "" | A custom name for the Solr Operator Deployment |
| nameOverride | string | "" | |
| replicaCount | int | 1 | The number of Solr Operator pods to run |
| resources.limits.cpu | string | "400m" | |
| resources.limits.memory | string | "500Mi" | |
| resources.requests.cpu | string | "100m" | |
| resources.requests.memory | string | "100Mi" | |
| rbac.create | boolean | true | Create the necessary RBAC rules, whether cluster-wide or namespaced, for the Solr Operator. |
| serviceAccount.create | boolean | true | Create a serviceAccount to be used for this operator. This serviceAccount will be given the permissions specified in the operator's RBAC rules. |
| serviceAccount.name | string | "" | If serviceAccount.create is set to false, the name of an existing serviceAccount in the target namespace must be provided to run the Solr Operator with. This serviceAccount with be given the operator's RBAC rules. |
Deploy solr-operator with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has solr-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartsolr-operator is pinned at v0.2.8+1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply