Project:Elasticsearch-K8s: Difference between revisions

From MaRDI portal
Created page with "= Elasticsearch configuration = The Elasticsearch service is deployed in Kubernetes using a statefulset resource. This provides persistent storage for the index data. After the service is first deployed it is necessary to recreate the index. This can be done from within the wikibase pod. <syntaxhighlight lang=bash> php var/www/html/w/extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php --startOver php var/www/html/w/extensions/CirrusSearch/maintenance/Forc..."
 
No edit summary
 
Line 1: Line 1:
= Elasticsearch configuration =
= Elasticsearch Configuration =


The Elasticsearch service is deployed in Kubernetes using a statefulset resource. This provides persistent storage for the index data.
== Overview ==
The Elasticsearch service is deployed in Kubernetes using a StatefulSet resource, which provides:
* Persistent storage for index data via PersistentVolumeClaims
* Stable network identities for pods
* Ordered deployment and scaling


After the service is first deployed it is necessary to recreate the index. This can be done from within the wikibase pod.
== Architecture ==
* '''Deployment Type''': StatefulSet with headless service
* '''Storage''': Persistent volumes using <code>csi-rbd-sc</code> storage class
* '''Configuration''': Single-node discovery mode
* '''Security''': Runs as user 1000 with fsGroup 1000


<syntaxhighlight lang=bash>
== Service Endpoints ==
php var/www/html/w/extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php --startOver
* '''HTTP API''': Port 9200 (configurable via <code>Values.port</code>)
* '''Transport''': Port 9300 (cluster communication)
* '''Service Type''': Headless (ClusterIP: None)


php var/www/html/w/extensions/CirrusSearch/maintenance/ForceSearchIndex.php
== Initial Setup ==
 
=== Index Configuration ===
After the service is first deployed, recreate the search index from within the Wikibase pod:
 
<syntaxhighlight lang="bash">
# Update search index configuration
php /var/www/html/w/extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php --startOver
 
# Force reindex all content
php /var/www/html/w/extensions/CirrusSearch/maintenance/ForceSearchIndex.php
</syntaxhighlight>
</syntaxhighlight>
== Configuration Values ==
Key Helm values that can be customized:
* <code>replicas</code>: Number of Elasticsearch replicas
* <code>image.repository</code> & <code>image.tag</code>: Elasticsearch Docker image
* <code>port</code>: HTTP API port (default: 9200)
* <code>javaOpts</code>: JVM options (e.g., heap size)
* <code>resources</code>: CPU and memory requests/limits
* <code>storage.size</code>: Persistent volume size

Latest revision as of 14:24, 24 June 2025

Elasticsearch Configuration

Overview

The Elasticsearch service is deployed in Kubernetes using a StatefulSet resource, which provides:

  • Persistent storage for index data via PersistentVolumeClaims
  • Stable network identities for pods
  • Ordered deployment and scaling

Architecture

  • Deployment Type: StatefulSet with headless service
  • Storage: Persistent volumes using csi-rbd-sc storage class
  • Configuration: Single-node discovery mode
  • Security: Runs as user 1000 with fsGroup 1000

Service Endpoints

  • HTTP API: Port 9200 (configurable via Values.port)
  • Transport: Port 9300 (cluster communication)
  • Service Type: Headless (ClusterIP: None)

Initial Setup

Index Configuration

After the service is first deployed, recreate the search index from within the Wikibase pod:

# Update search index configuration
php /var/www/html/w/extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php --startOver

# Force reindex all content
php /var/www/html/w/extensions/CirrusSearch/maintenance/ForceSearchIndex.php

Configuration Values

Key Helm values that can be customized:

  • replicas: Number of Elasticsearch replicas
  • image.repository & image.tag: Elasticsearch Docker image
  • port: HTTP API port (default: 9200)
  • javaOpts: JVM options (e.g., heap size)
  • resources: CPU and memory requests/limits
  • storage.size: Persistent volume size