Create Elastic Datastore
In this section we will show how you can create your Elastic Datastore component as part of your Kubernetes cluster, regardless of what cloud provider you have chosen.
Elastic Datastore in AKS
AzureKubernetesService.builder()
.withId("aks-1")
.withDescription("AKS Cluster")
.withDisplayName("AKS #1")
.region(EUROPE_WEST)
.withNodePool(AzureNodePool.builder()
.withName("nodepool")
.withMachineType(STANDARD_B2S)
.build())
.withDocumentDB(CaaSElasticDataStore.builder()
.withId("elastic-data")
.withVersion("2.5.0")
.withDescription("Elastic Data Store")
.withDisplayName("Elastic Data Store")
.withNamespace("elastic-data")
.withLink(getComponentLink())
.withKibana(true)
.withElasticVersion("8.5")
.withInstances(1)
.withStorage("10Gi")
.withStorageClassName("standard")
.withMemory(1)
.withCpu(1)
.build())
.build();
For more details you can check the code on GitHub in our samples repository for Elastic Datastore in Azure.
Elastic Datastore in GKE
GoogleKubernetesEngine.builder()
.withId("gke-1")
.withDescription("GKE Cluster")
.withDisplayName("GKE #1")
.region(EU_WEST1)
.withNodePool(GcpNodePool.builder()
.withName("nodepool")
.withMachineType(E2_STANDARD2)
.build())
.withDocumentDB(CaaSElasticDataStore.builder()
.withId("elastic-data")
.withVersion("2.5.0")
.withDescription("Elastic Data Store")
.withDisplayName("Elastic Data Store")
.withNamespace("elastic-data")
.withLink(getComponentLink())
.withKibana(true)
.withElasticVersion("8.5")
.withInstances(1)
.withStorage("10Gi")
.withStorageClassName("standard")
.withMemory(1)
.withCpu(1)
.build())
.build();
For more details you can check the code on GitHub in our samples repository for Elastic Datastore in GCP.
Elastic Datastore Prerequisites
The ECK operator requires the following images:
- docker.elastic.co/eck/eck-operator:2.5.0
- docker.elastic.co/elasticsearch/elasticsearch:8.5.0
- docker.elastic.co/kibana/kibana:8.5.0
- docker.elastic.co/apm/apm-server:8.5.0
A script similar to the following might be of help:
containerRegistry="<your container registry prefix>"
docker pull docker.elastic.co/eck/eck-operator:2.5.0
docker tag docker.elastic.co/eck/eck-operator:2.5.0 ${containerRegistry}/eck/eck-operator:2.5.0
docker push ${containerRegistry}/eck/eck-operator:2.5.0
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.5.0
docker tag docker.elastic.co/elasticsearch/elasticsearch:8.5.0 ${containerRegistry}/elasticsearch/elasticsearch:8.5.0
docker push ${containerRegistry}/elasticsearch/elasticsearch:8.5.0
docker pull docker.elastic.co/kibana/kibana:8.5.0
docker tag docker.elastic.co/kibana/kibana:8.5.0 ${containerRegistry}/kibana/kibana:8.5.0
docker push ${containerRegistry}/kibana/kibana:8.5.0
docker pull docker.elastic.co/apm/apm-server:8.5.0
docker tag docker.elastic.co/apm/apm-server:8.5.0 ${containerRegistry}/apm/apm-server:8.5.0
docker push ${containerRegistry}/apm/apm-server:8.5.0