OpenMCF logoOpenMCF

Loading...

Kubernetes Solr

Deploys an Apache Solr cluster on Kubernetes using the Solr Operator's SolrCloud custom resource, with a co-located ZooKeeper ensemble for cluster coordination, persistent storage for both Solr and ZooKeeper data, and optional external access through Istio Gateway API ingress with automatic TLS via cert-manager.

What Gets Created

When you deploy a KubernetesSolr resource, OpenMCF provisions:

  • Namespace — created only when createNamespace is true
  • SolrCloud Custom Resource — a Solr Operator SolrCloud object that manages a StatefulSet of Solr pods with configurable replicas, container image, JVM tuning, resource limits, and persistent data volumes
  • ZooKeeper Ensemble — a co-located ZooKeeper cluster (via the Solr Operator's provided ZooKeeper reference) with configurable replicas, resource limits, and persistent storage
  • Solr Modules — jaegertracer-configurator and ltr (Learning to Rank) modules enabled by default
  • TLS Certificate — a cert-manager Certificate for the ingress hostnames, created only when ingress is enabled
  • Istio Gateway — an external Gateway resource with HTTPS (port 443) and HTTP (port 80) listeners, created only when ingress is enabled
  • HTTP-to-HTTPS Redirect Route — an HTTPRoute that redirects HTTP traffic to HTTPS with a 301 status code, created only when ingress is enabled
  • HTTPS Route — an HTTPRoute that forwards HTTPS traffic to the Solr common service, created only when ingress is enabled

Prerequisites

  • Kubernetes credentials configured via environment variables or OpenMCF provider config
  • A Kubernetes namespace that already exists, or set createNamespace to true
  • Solr Operator installed on the target cluster (manages the SolrCloud custom resource lifecycle)
  • A StorageClass available in the cluster for Solr and ZooKeeper persistent volumes (most managed Kubernetes clusters provide a default)
  • Istio with Gateway API support installed if enabling ingress
  • cert-manager with a ClusterIssuer matching the ingress domain if enabling ingress with TLS

Quick Start

Create a file solr.yaml:

apiVersion: kubernetes.openmcf.org/v1
kind: KubernetesSolr
metadata:
  name: my-solr
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.KubernetesSolr.my-solr
spec:
  namespace: search
  createNamespace: true

Deploy:

openmcf apply -f solr.yaml

This creates a single-replica Solr 9.10.0 instance backed by a single-replica ZooKeeper ensemble, each with 1Gi persistent volumes and default resource limits (1000m CPU, 1Gi memory).

Configuration Reference

Required Fields

FieldTypeDescriptionValidation
namespacestringKubernetes namespace for the Solr deployment. Can reference a KubernetesNamespace resource via valueFrom.Required

Optional Fields

FieldTypeDefaultDescription
targetCluster.clusterKindenum—Kubernetes cluster kind. Valid values: AwsEksCluster, GcpGkeCluster, AzureAksCluster, DigitalOceanKubernetesCluster, CivoKubernetesCluster.
targetCluster.clusterNamestring—Name of the target Kubernetes cluster in the same environment.
createNamespaceboolfalseWhen true, creates the namespace before deploying resources.
solrContainer.replicasint321Number of Solr pods in the SolrCloud cluster.
solrContainer.resources.limits.cpustring1000mMaximum CPU allocation for each Solr pod.
solrContainer.resources.limits.memorystring1GiMaximum memory allocation for each Solr pod.
solrContainer.resources.requests.cpustring50mMinimum guaranteed CPU for each Solr pod.
solrContainer.resources.requests.memorystring100MiMinimum guaranteed memory for each Solr pod.
solrContainer.diskSizestring1GiSize of the PersistentVolumeClaim attached to each Solr pod. Must be a valid Kubernetes quantity (e.g., 1Gi, 10Gi).
solrContainer.image.repostringsolrContainer image repository for Solr.
solrContainer.image.tagstring9.10.0Container image tag for Solr.
config.javaMemstring—JVM memory settings for Solr (e.g., -Xms512m -Xmx512m).
config.optsstring—Custom Solr options (e.g., -Dsolr.autoSoftCommit.maxTime=10000).
config.garbageCollectionTuningstring—Solr GC tuning parameters (e.g., -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8).
zookeeperContainer.replicasint321Number of ZooKeeper pods in the ensemble.
zookeeperContainer.resources.limits.cpustring1000mMaximum CPU allocation for each ZooKeeper pod.
zookeeperContainer.resources.limits.memorystring1GiMaximum memory allocation for each ZooKeeper pod.
zookeeperContainer.resources.requests.cpustring50mMinimum guaranteed CPU for each ZooKeeper pod.
zookeeperContainer.resources.requests.memorystring100MiMinimum guaranteed memory for each ZooKeeper pod.
zookeeperContainer.diskSizestring1GiSize of the PersistentVolumeClaim attached to each ZooKeeper pod. Must be a valid Kubernetes quantity (e.g., 1Gi, 10Gi).
ingress.enabledboolfalseEnables external access through Istio Gateway API with TLS termination and HTTP-to-HTTPS redirect.
ingress.hostnamestring—Full hostname for external access (e.g., solr.example.com). Required when ingress.enabled is true.

Examples

Development Solr with Minimal Resources

A lightweight single-node Solr instance for development and testing:

apiVersion: kubernetes.openmcf.org/v1
kind: KubernetesSolr
metadata:
  name: dev-solr
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.KubernetesSolr.dev-solr
spec:
  namespace: dev
  createNamespace: true
  solrContainer:
    replicas: 1
    resources:
      limits:
        cpu: "500m"
        memory: "512Mi"
      requests:
        cpu: "100m"
        memory: "256Mi"
    diskSize: "1Gi"
    image:
      repo: solr
      tag: "9.10.0"
  zookeeperContainer:
    replicas: 1
    resources:
      limits:
        cpu: "250m"
        memory: "256Mi"
      requests:
        cpu: "50m"
        memory: "128Mi"
    diskSize: "1Gi"

Production Solr Cluster with JVM Tuning

A multi-replica Solr cluster with increased resources, larger storage, and JVM tuning for production workloads:

apiVersion: kubernetes.openmcf.org/v1
kind: KubernetesSolr
metadata:
  name: prod-solr
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.KubernetesSolr.prod-solr
spec:
  namespace: search
  solrContainer:
    replicas: 3
    resources:
      limits:
        cpu: "4000m"
        memory: "8Gi"
      requests:
        cpu: "1000m"
        memory: "4Gi"
    diskSize: "50Gi"
    image:
      repo: solr
      tag: "9.10.0"
  config:
    javaMem: "-Xms4g -Xmx4g"
    opts: "-Dsolr.autoSoftCommit.maxTime=10000"
    garbageCollectionTuning: "-XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8"
  zookeeperContainer:
    replicas: 3
    resources:
      limits:
        cpu: "1000m"
        memory: "2Gi"
      requests:
        cpu: "250m"
        memory: "512Mi"
    diskSize: "10Gi"

Solr with External Ingress

Solr exposed outside the cluster via Istio Gateway with TLS termination and automatic certificate management:

apiVersion: kubernetes.openmcf.org/v1
kind: KubernetesSolr
metadata:
  name: shared-solr
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.KubernetesSolr.shared-solr
spec:
  namespace: search
  solrContainer:
    replicas: 3
    resources:
      limits:
        cpu: "4000m"
        memory: "8Gi"
      requests:
        cpu: "1000m"
        memory: "4Gi"
    diskSize: "100Gi"
    image:
      repo: solr
      tag: "9.10.0"
  config:
    javaMem: "-Xms4g -Xmx4g"
  zookeeperContainer:
    replicas: 3
    resources:
      limits:
        cpu: "1000m"
        memory: "2Gi"
      requests:
        cpu: "250m"
        memory: "512Mi"
    diskSize: "10Gi"
  ingress:
    enabled: true
    hostname: solr.example.com

Using Foreign Key References

Reference an OpenMCF-managed namespace instead of hardcoding the name:

apiVersion: kubernetes.openmcf.org/v1
kind: KubernetesSolr
metadata:
  name: search
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.KubernetesSolr.search
spec:
  namespace:
    valueFrom:
      kind: KubernetesNamespace
      name: search-namespace
      field: spec.name
  solrContainer:
    replicas: 3
    diskSize: "50Gi"
  zookeeperContainer:
    replicas: 3
    diskSize: "10Gi"

Stack Outputs

After deployment, the following outputs are available in status.outputs:

OutputTypeDescription
namespacestringKubernetes namespace where Solr is deployed
servicestringKubernetes Service name for the SolrCloud common service (format: {name}-solrcloud-common)
port_forward_commandstringkubectl port-forward command for local access to the Solr UI on port 8080
kube_endpointstringCluster-internal FQDN (e.g., my-solr-solrcloud-common.search.svc.cluster.local)
external_hostnamestringPublic hostname for external access, only set when ingress is enabled
internal_hostnamestringInternal hostname for private access (format: internal-{ingress.hostname}), only set when ingress is enabled

Related Components

  • KubernetesNamespace — provides the target namespace via valueFrom reference
  • KubernetesDeployment — application deployments that consume Solr as a search backend
  • KubernetesRedis — complementary caching layer often paired with Solr for search applications

Next article

Kubernetes Solr Operator

Kubernetes Solr Operator Deploys the Apache Solr Operator on a Kubernetes cluster using its official Helm chart and CRD manifests. The operator manages the lifecycle of SolrCloud clusters, SolrBackup resources, and SolrPrometheusExporter instances through Kubernetes custom resources, enabling declarative management of Solr infrastructure. What Gets Created When you deploy a KubernetesSolrOperator resource, OpenMCF provisions: Namespace — created only when createNamespace is true Solr CRDs — the...
Read next article
Presets
1 ready-to-deploy configurationView presets →