Skip to main content

Opensearch

The Opni operator integrates the Opensearch Operator. If an OpenSearchCluster resource is created then Opni will create the Opensearch cluster e.g.

apiVersion: opensearch.opster.io/v1
kind: OpenSearchCluster
metadata:
name: opni
namespace: opni-system
spec:
# Add fields here
general:
httpPort: 9200
vendor: opensearch
version: 1.2.3
serviceName: os-svc
setVMMaxMapCount: true
confMgmt:
autoScaler: false
monitoring: false
dashboards:
enable: true
version: 1.2.0
replicas: 1
nodePools:
- component: master
replicas: 3
diskSize: 32
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
memory: 1Gi
roles:
- master
persistence:
emptyDir: {}
- component: nodes
replicas: 2
diskSize: 32
resources:
requests:
cpu: 500m
memory: 2Gi
limits:
memory: 2Gi
jvm: "-Xmx1G -Xms1G"
roles:
- data
persistence:
emptyDir: {}

The Opensearch cluster can then be referenced by Opni. The Opni controller will also create indices and configuration in the Opensearch cluster.

example.yaml

apiVersion: opni.io/v1beta2
kind: OpniCluster
metadata:
name: example
namespace: opni
spec:
opensearch:
externalOpensearch:
name: opni
namespace: opni-system
note

The following Opensearch configuration is deprecated and will be removed in a future version.

Alternatively the deployment of the Opensearch cluster can be defined as a subsection of the OpniCluster resource. It deploys an Opensearch cluster and Dashboards for visualization.

example.yaml

apiVersion: opni.io/v1beta2
kind: OpniCluster
metadata:
name: example
namespace: opni
spec:
opensearch:
version: 1.13.2
workloads:
master:
resources:
requests:
memory: 1Gi
limits:
memory: 1Gi
data:
replicas: 2
resources:
requests:
memory: 2Gi
limits:
memory: 2Gi

Custom Resource Specs

OpensearchSpec

FieldRequiredTypeDescription
externalOpensearchNoOpensearchClusterRefA reference to an OpenSearchCluster resource. If this is not present Opni will create an Opensearch cluster based on the rest of the spec
versionNostringVersion of the Opendistro image to use. Defaults to latest
workloadsNoOpensearchWorkloadSpecConfigure the Opensearchsearch cluster components
defaultRepoNostringImage repo to use for Opensearchsearch images. Defaults to docker.io/amazon
imageNoImageSpecExplicit configuration for the Opensearchsearch image
kibanaImageNoImageSpecExplicit configuration for the Kibana image
persistenceNoPersistenceSpecConfigure the persistence for Opensearchsearch data
configSecretNoLocalObjectReferenceReference to a secret containing logging.yml with the Opensearchsearch logging config
adminPasswordFromNoSecretKeySelectorSecret key selector pointing to the admin password to use. If not set a password will be autogenerated and stored in the password key in a secret called opni-es-password

OpensearchWorkloadSpec

FieldRequiredTypeDescription
masterOpensearchWorkloadOptionsConfiguration for the Opensearchsearch master node StatefulSet
dataOpensearchWorkloadOptionsConfiguration for the Opensearchsearch data node StatefulSet
clientOpensearchWorkloadOptionsConfiguration for the Opensearchsearch client node Deployment
kibanaOpensearchWorkloadOptionsConfiguration for the Kibana Deployment

OpensearchWorkloadOptions

FieldRequiredTypeDescription
replicasNointNumber of replicas to deploy. Defaults to 1
resourcesNoResourceRequirementsResources for the workload. The resources are used to calculate the Java memory options. If a memory limit exists this is used, if there is a memory request but no limit that is used, otherwise the Java optioms default to a heap size of 512MB
affinityNoAffinityAffinity settings for the workload pods
nodeSelectorNomapNodeSelector for the workload pods. If this exists it will override the globalNodeSelector
tolerationsNoToleration arrayTolerations for the workload. These will be combined with the globalTolerations (if any)

ImageSpec

FieldRequiredTypeDescription
imageNostringExplicit CRI image to use
imagePullPolicyNostringImage pull policy. One of Always, Never, IfNotPresent. Defaults to IfNotPresent
imagePullSecretsNoLocalObjectReference arrayList of secrets in the same namespace to use for pulling the image

PersistenceSpec

FieldRequiredTypeDescription
enabledNoboolWhether persistent storage is enabled. Defaults to false
storageClassNameNostringIf persistent storage is enabled, the name of the StorageClass to use. If not set will use the default StorageClass
accessModesNostring arrayAn array of the access modes the volume supports
requestNostringThe size of the volume to request. Defaults to 10Gi

OpensearchClusterRef

FieldRequiredTypeDescription
nameYesstringThe name of the OpenSearchCluster object
namespaceYesstringThe namespace of the OpenSearchCluster object