CNE Azure Ready: Using Elasticsearch
Cloud Native Experience (CNE) Azure Ready environments use Elasticsearch for search. The platform deploys Elasticsearch in the cluster with Elastic Cloud on Kubernetes (ECK).
Elasticsearch Architecture
CNE Azure Ready deploys
-
The ECK operator (the
eck-operatorchart, version 3.2.0) in theelastic-systemnamespace -
One Elasticsearch cluster per environment, in the
liferay-<projectId>-<environmentId>-elasticsearchnamespace -
Kubernetes resources managed through ECK custom resources
The ECK operator manages
-
Elasticsearch lifecycle operations
-
Certificates and TLS configuration
-
StatefulSets and persistent storage
-
Cluster upgrades and health management
Configuring the ECK Operator
The bootstrap installs the ECK operator, so configure it in the bootstrap’s config.json file under platformComponents.values.operatorApplications.eckOperator.values. For example, to raise the operator’s resource limits:
{
"platformComponents": {
"values": {
"operatorApplications": {
"eckOperator": {
"values": {
"resources": {
"limits": {
"cpu": "1",
"memory": "1Gi"
}
}
}
}
}
}
}
}
Run the bootstrap again to apply the change.
By default, the operator requests 100m CPU and 128Mi memory, with limits of 1 CPU and 512Mi memory. For supported configuration options, see Elastic Cloud on Kubernetes.
Configuring Elasticsearch
Configure an environment’s Elasticsearch cluster in its infrastructure.yaml file, at liferay/projects/<projectId>/environments/<environmentId>/infrastructure.yaml in your GitOps repository. Set the values under search.elasticsearch:
search:
elasticsearch:
env:
ES_JAVA_OPTS: -Xms8g -Xmx8g
nodeCount: 3
resources:
limits:
cpu: 2000m
memory: 16Gi
requests:
cpu: 1000m
memory: 8Gi
volumeSize: 50Gi
search.elasticsearch accepts env, nodeCount, resources, version, and volumeSize. Each variable under env is set on the Elasticsearch container.
For all infrastructure.yaml keys, see CNE Azure Ready: Helm Values Reference.
Commit and push the change to your GitOps repository. Argo CD synchronizes it to the environment. To confirm the change, check the Elasticsearch cluster’s health and phase:
kubectl get elasticsearch --namespace liferay-<projectId>-<environmentId>-elasticsearch
Default Configuration
By default, CNE Azure Ready provisions a single-node Elasticsearch cluster with these settings:
| Setting | Default |
|---|---|
nodeCount | 1 |
resources.requests.cpu | 500m |
resources.requests.memory | 4Gi |
resources.limits.cpu | 1000m |
resources.limits.memory | 8Gi |
env.ES_JAVA_OPTS | -Xms4g -Xmx4g |
volumeSize | 10Gi |
| Storage class | managed-csi-premium-v2, set by the bootstrap |
version | 8.19.11 |
| Self-signed TLS | Disabled |
| Pre-installed plugins | analysis-icu, analysis-kuromoji, analysis-smartcn, analysis-stempel |
Elasticsearch Version Compatibility
Set version to an Elasticsearch version that your Liferay DXP version supports. For supported versions, see the Liferay Compatibility Matrix.
The default version can change between CNE releases. Nothing updates version to match your Liferay DXP version, so check it whenever you upgrade Liferay DXP or change version.
Liferay Integration
The liferay-azure Helm chart includes the Elasticsearch connection configuration by default. It mounts the Elasticsearch 7 and Elasticsearch 8 connector configurations from the chart’s ConfigMap into DXP’s OSGi configuration folder. The configurations read SEARCH_URL, SEARCH_USERNAME, and SEARCH_PASSWORD, which the chart sets on the container from the search-connection-details secret. The chart’s wait-for-elasticsearch init container holds DXP until the cluster health is green or yellow.
You do not need additional liferay.yaml overrides to connect Liferay DXP to the in-cluster Elasticsearch deployment.
Limitations
Azure environments do not provision a managed OpenSearch or Elasticsearch service. Elasticsearch deployed through ECK is the supported search platform for CNE Azure Ready environments.
Setting search.engine: opensearch in infrastructure.yaml fails with this error:
Search engine opensearch is not available on this cloud, which supports: elasticsearch