solr

by Preferred.AI

Helm chartv3.2.0App 8.7.0Verified publisher

A helm chart to install Apache Solr: http://lucene.apache.org/solr/

About this chart

Solr

This helm chart installs a Solr cluster and its required Zookeeper cluster into a running Kubernetes cluster.

The chart installs the Solr docker image.

Please read Upgrading section before upgrading MAJOR versions.

Dependencies

  • The Bitnami common helm chart
  • The Bitnami zookeeper helm chart
  • Tested on Kubernetes 1.15+

Installing the Chart

To install the chart with the release name my-release:

helm install my-release preferred-ai/solr

The command deploys Solr on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Parameters

The following table lists the configurable parameters of the Solr chart and their default values.

Global Configuration

The following table shows the configuration options for the Solr helm chart:

ParameterDescriptionDefault Value
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
image.registrySolr image registrydocker.io
image.repositoryThe repository to pull the docker image fromsolr
image.tagThe tag on the repository to pull8.7.0
image.pullPolicySolr pod pullPolicyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
service.typeThe type of service for the Solr clientClusterIP
service.portSolr service port8983
service.nodePortPort to bind to for NodePort and LoadBalancer service types""
service.clusterIPSolr service cluster IPnil
service.loadBalancerIPloadBalancerIP for Solr Servicenil
service.loadBalancerSourceRangesAddress(es) that are allowed when service is LoadBalancer[]
service.externalTrafficPolicyEnable client source IP preservationCluster
service.annotationsAnnotations to apply to the solr client service{}
ingress.enabledEnable ingress controller resourcefalse
ingress.certManagerAdd annotations for cert-managerfalse
ingress.hostnameDefault host for the ingress resourcesolr.local
ingress.pathDefault path for the ingress resource/
ingress.tlsCreate TLS Secretfalse
ingress.annotationsIngress annotations[] (evaluated as a template)
ingress.extraHosts[0].nameAdditional hostnames to be coverednil
ingress.extraHosts[0].pathAdditional hostnames to be coverednil
ingress.extraPathsAdditional arbitrary path/backend objectsnil
ingress.extraTls[0].hosts[0]TLS configuration for additional hostnames to be coverednil
ingress.extraTls[0].secretNameTLS configuration for additional hostnames to be coverednil
ingress.secrets[0].nameTLS Secret Namenil
ingress.secrets[0].certificateTLS Secret Certificatenil
ingress.secrets[0].keyTLS Secret Keynil
livenessProbe.enabledEnable/disable the liveness probetrue
livenessProbe.useSocketUse socket instead of http for the liveness probefalse
livenessProbe.initialDelaySecondsInitial Delay for Solr pod liveness probe20
livenessProbe.periodSecondsPoll rate for liveness probe10
livenessProbe.timeoutSecondsWhen the probe times out5
livenessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1
livenessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.6
readinessProbe.enabledEnable/disable the readiness probetrue
readinessProbe.useSocketUse socket instead of http for the readiness probefalse
readinessProbe.initialDelaySecondsInitial Delay for Solr pod readiness probe15
readinessProbe.periodSecondsPoll rate for readiness probe5
readinessProbe.timeoutSecondsWhen the probe times out5
readinessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.6
readinessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1

Solr Configuration

ParameterDescriptionDefault Value
portThe port that Solr will listen on8983
replicaCountThe number of replicas in the Solr statefulset3
javaMemJVM memory settings to pass to Solr-Xms2g -Xmx3g
resourcesResource limits and requests to set on the solr pods{}
extraEnvVarsAdditional environment variables to set on the solr pods (in yaml syntax)[]
initScriptsfilename-content pair of values{}
extraVolumesAdditional volumes[]
extraVolumeMountsAdditional volume mounts[]
terminationGracePeriodSecondsThe termination grace period of the Solr pods180
podAnnotationsAnnotations to be applied to the solr pods{}
affinityAffinity policy to be applied to the Solr pods{}
tolerationsTolerations to be applied to the Solr pods[]
updateStrategyThe update strategy of the solr pods{}
logLevelThe log level of the solr podsINFO
podDisruptionBudgetThe pod disruption budget for the Solr statefulset{"maxUnavailable": 1}
schedulerNameThe name of the k8s scheduler (other than default)nil
nodeSelectorNode labels for Solr pods assignment{} (evaluated as a template)
volumeClaimTemplates.storageClassNameThe name of the storage class for the Solr PVC""
volumeClaimTemplates.storageSizeThe size of the PVC20Gi
volumeClaimTemplates.accessModesThe access mode of the PVC["ReadWriteOnce"]
existingVolumeClaimUse an existing PersistentVolumeClaim instead of the volumeClaimTemplates spec of the StatefulSet""
tls.enabledWhether to enable TLS, requires tls.certSecret.name to be set to a secret containing cert details, see README for detailsfalse
tls.wantClientAuthWhether Solr wants client authenticationfalse
tls.needClientAuthWhether Solr requires client authenticationfalse
tls.keystorePasswordPassword for the tls java keystorechangeit
tls.importKubernetesCAWhether to import the kubernetes CA into the Solr truststorefalse
tls.checkPeerNameWhether Solr checks the name in the TLS certsfalse
tls.caSecret.nameThe name of the Kubernetes secret containing the ca bunble to import into the truststore""
tls.caSecret.bundlePathThe key in the Kubernetes secret that contains the CA bundle""
tls.certSecret.nameThe name of the Kubernetes secret that contains the TLS certificate and private key""
tls.certSecret.keyPathThe key in the Kubernetes secret that contains the private keytls.key
tls.certSecret.certPathThe key in the Kubernetes secret that contains the TLS certificatetls.crt

Exporter Configuration

ParameterDescriptionDefault Value
exporter.enabledWhether to enable the Solr Prometheus exporterfalse
exporter.image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
exporter.configFileThe path in the docker image that the exporter loads the config from/opt/solr/contrib/prometheus-exporter/conf/solr-exporter-config.xml
exporter.updateStrategyUpdate strategy for the exporter deployment{}
exporter.podAnnotationsAnnotations to set on the exporter pods{}
exporter.resourcesResource limits to set on the exporter pods{}
exporter.portThe port that the exporter runs on9983
exporter.threadsThe number of query threads that the exporter runs7
exporter.livenessProbe.initialDelaySecondsInitial Delay for the exporter pod liveness20
exporter.livenessProbe.periodSecondsPoll rate for liveness probe10
exporter.readinessProbe.initialDelaySecondsInitial Delay for the exporter pod readiness15
exporter.readinessProbe.periodSecondsPoll rate for readiness probe5
exporter.service.typeThe type of the exporter serviceClusterIP
exporter.service.annotationsAnnotations to apply to the exporter service{}

Dependencies Configuration

Please see Dependencies

ParameterDescriptionDefault Value
zookeeper.replicaCountThe number of replicas in the Zookeeper statefulset3
zookeeper.fourlwCommandsWhitelistFour letter words command whitelistsrvr, mntr, ruok, conf

Installing with Arguments

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm install my-release \
--set replicaCount=4,livenessProbe.initialDelaySeconds=90 \
  preferred-ai/solr

The above command sets the number of replicas to 4, and the liveness probe delay to 90 seconds.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

helm install my-release -f values.yaml preferred-ai/solr

Authentication

Basic Authentication is one of the various authentication plugins for Solr. To initiate Solr with Basic Authentication, you will need to place the default security.json file into Zookeeper.

To do this, you will first need to either:

  • mount a ConfigMap with a key security.json and the file contents as the value, or
  • mount a volume with security.json file inside, or
  • add security.json directly to initScripts.

The following example will use a mounted ConfigMap.

  1. Create a security-json.yaml (please put the full security.json into space below).

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: security-json
    data:
      security.json: |
        {
        "authentication":{ 
          ...
        }}
    
  2. Apply the ConfigMap into the namespace

    kubectl apply -f security-json.yaml
    
  3. Use the following helm install arguments. See Installing with Arguments on how to use a YAML file for install arguments.

    initScripts:
      enable-basicauth.sh: |
    

Deploy solr with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has solr 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsolr is pinned at v3.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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