Back to Charts

⚠️ Repo Archive Notice

incubator/solr/README.md

latest10.8 KB
Original Source

⚠️ Repo Archive Notice

As of Nov 13, 2020, charts in this repo will no longer be updated. For more information, see the Helm Charts Deprecation and Archive Notice, and Update.

Solr Helm Chart

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

The chart installs the Solr docker image from: https://hub.docker.com/_/solr/

DEPRECATION NOTICE

This chart is deprecated and no longer supported.

Dependencies

  • The zookeeper incubator helm chart
  • Tested on kubernetes 1.10+

Installation

To install the Solr helm chart run:

txt
helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
helm install --name solr incubator/solr

Configuration Options

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)
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)[]
initScriptThe file name of the custom script to be run before starting Solr""
terminationGracePeriodSecondsThe termination grace period of the Solr pods180
image.repositoryThe repository to pull the docker image fromsolr
image.tagThe tag on the repository to pull7.7.2
image.pullPolicySolr pod pullPolicyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
livenessProbe.initialDelaySecondsInitial Delay for Solr pod liveness probe20
livenessProbe.periodSecondsPoll rate for liveness probe10
readinessProbe.initialDelaySecondsInitial Delay for Solr pod readiness probe15
readinessProbe.periodSecondsPoll rate for readiness probe5
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
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" ]
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
service.typeThe type of service for the solr client serviceClusterIP
service.annotationsAnnotations to apply to the solr client service{}
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{}

Service Start with command sets

sh
helm install --name solr \
    --set image.tag=7.7.2,javaMem="-Xms1g -Xmx1g",logLevel=INFO,replicaCount=2,livenessProbe.initialDelaySeconds=420,exporter.readinessProbe.periodSeconds=30 incubator/solr

TLS Configuration

Solr can be configured to use TLS to encrypt the traffic between solr nodes. To set this up with a certificate signed by the Kubernetes CA:

Generate SSL certificate for the installation:

cfssl genkey ssl_config.json | cfssljson -bare server

base64 Encode the CSR and apply into kubernetes as a CertificateSigningRequest

sh
export MY_CSR_NAME="solr-certifiate"
cat <<EOF | ikubectl apply -f -
apiVersion: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
metadata:
  name: ${MY_CSR_NAME}
spec:
  groups:
  - system:authenticated
  request: $(cat server.csr | base64 | tr -d '\n')
EOF

Approve the CSR

kubectl certificate approve ${MY_CSR_NAME}

We can now retrieve the approved certificate and save it to server-cert.pem

kubectl get csr "${MY_CSR_NAME}" -o jsonpath='{.status.certificate}' | base64 --decode > server-cert.pem

We store the certificate and private key in a Kubernetes secret:

kubectl create secret tls solr-certificate --cert server-cert.pem --key server-key.pem

Now the secret can be used in the solr installation:

helm install . --set tls.enabled=true,tls.certSecret.name=solr-certificate,tls.importKubernetesCA=true

Minikube Notes

  • Chart out of the box start with 2G,2G...So..
  • minikube start --vm-driver=hyperkit --memory 4096
  • minikube start --vm-driver=virtualbox --memory 4096