Simplify OpenSearch and OpenSearch-Dashboards Provisioning on Amazon EKS using KubeDB

Simplify OpenSearch and OpenSearch-Dashboards Provisioning on Amazon EKS using KubeDB

Overview

KubeDB is the Kubernetes Native Database Management Solution which simplifies and automates routine database tasks such as Provisioning, Monitoring, Upgrading, Patching, Scaling, Volume Expansion, Backup, Recovery, Failure detection, and Repair for various popular databases on private and public clouds. The databases that KubeDB supports are Elasticsearch, Kafka, MySQL, MongoDB, MariaDB, Redis, PostgreSQL, ProxySQL, Percona XtraDB, Memcached and PgBouncer. You can find the guides to all the supported databases in KubeDB . KubeDB provides support not only for the official Elasticsearch by Elastic and OpenSearch by AWS, but also other open source distributions like SearchGuard and OpenDistro . KubeDB provides all of these distribution’s support under the Elasticsearch CR of KubeDB. In this tutorial we will Simplify OpenSearch and OpenSearch-Dashboards Provisioning on Amazon Elastic Kubernetes Service (Amazon EKS). We will cover the following steps:

  1. Install KubeDB

  2. Deploy OpenSearch Topology Cluster

  3. Deploy OpenSearch-Dashboard

  4. Read/Write Data through Dashboard

Get Cluster ID

We need the cluster ID to get the KubeDB License. To get cluster ID, we can run the following command:

Get License

Go to Appscode License Server to get the license.txt file. For this tutorial we will use KubeDB Enterprise Edition.

Install KubeDB

We will use helm to install KubeDB. Please install helm here if it is not already installed. Now, let’s install .

Let’s verify the installation:

We can list the CRD Groups that have been registered by the operator by running the following command:

Deploy OpenSearch Topology Cluster

We are going to use the KubeDB-provided Custom Resource object OpenSearch for deployment. The object will be deployed in demo namespace. So, let’s create the namespace first.

Here is the yaml of OpenSearch we are going to use:

Here,

  • - is the name of the ElasticsearchVersion CR. Here, we are using OpenSearch version of OpenSearch distribution.

  • - specifies whether the HTTP layer is secured with certificates or not.

  • - specifies the type of storage that will be used for OpenSearch database. It can be or . The default value of this field is . If is used then KubeDB will create the OpenSearch database using volume. In this case, you don’t have to specify field. This is useful for testing purposes.

  • - specifies the node-specific properties for the OpenSearch cluster.

  • field is Wipeout means that the database will be deleted without restrictions. It can also be “Halt”, “Delete” and “DoNotTerminate”. Learn More about these checkout Termination Policy .

Let’s deploy the above yaml by the following command:

However, KubeDB also provides dedicated node support for other node roles like , , , , , , and for Topology clustering .

Once these are handled correctly and the OpenSearch object is deployed, you will see that the following resources are created:

We have successfully deployed OpenSearch cluster in AWS.

Deploy ElasticsearchDashboard

Note: OpenSearch Database and OpenSearch dashboard should have to be deployed in the same namespace. In this tutorial, we use namespace for both cases.

  • specifies whether the HTTP layer is secured with certificates or not.

  • refers to the OpenSearch database name.

  • refers to the strategy to follow during dashboard deletion. means that the database will be deleted without restrictions. It can also be which will cause a restriction to delete the dashboard. Learn More about these Termination Policy .

Let’s deploy the above yaml by the following command:

KubeDB will create the necessary resources to deploy the OpenSearch dashboard according to the above specification. Let’s wait until the dashboard to be ready to use,

Here, OpenSearch Dashboard is in state.

Connect with OpenSearch Dashboard

We will use port forwarding to connect with our OpenSearch database. Then we will use to send requests to check cluster health to verify that our OpenSearch database is working well.

Port-forward the Service

KubeDB will create few Services to connect with the database. Let’s check the Services by following command,

Here, we are going to use Service to connect with the database. Now, let’s port-forward the Service to the port to local machine:

Now, our OpenSearch cluster dashboard is accessible at .

Export the Credentials

KubeDB also create some Secrets for the database. Let’s check which Secrets have been created by KubeDB for our .

Now, we can connect to the database with which contains the admin credentials to connect with the database.

Accessing Database Through Dashboard

To access the database through Dashboard, we have to get the credentials. We can do that by following command,

Now, let’s go to from our browser and login by using those credentials.

After login successfully, we will see OpenSearch Dashboard UI. Now, We are going to for running some queries into our OpenSearch database.

Here, in we will use section for running some queries. Let’s run query to check node informations.

Now, we are going to insert some sample data to our OpenSearch cluster index by using query.

Let’s check that sample data in the index by using query.

Now, we are going to update sample data in the index by using query.

Let’s verify the index again to see whether the data is updated or not.

PS: This article was initially published on AppsCode Blog

Support

To speak with us, please leave a message on our website .

To receive product announcements, follow us on Twitter/X.

To watch tutorials of various Production-Grade Kubernetes Tools Subscribe our YouTube channel.

More about Elasticsearch in Kubernetes

If you have found a bug with KubeDB or want to request for new features, please file an issue .

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics