Skip to content

Latest commit

 

History

History
161 lines (108 loc) · 5.09 KB

README.md

File metadata and controls

161 lines (108 loc) · 5.09 KB

OpenSearch Dasboards Operator

Charmhub Release Tests Docs

Description

OpenSearch Dashboards is a frontend application that for visualizing data stored in an OpenSearch database. Charmed OpenSearch Dashboard is the adaptation of the OpenSearch Dashboards user interface to the Juju environment.

The charm supports access via:

  • HTTPS (typically for direct access)
  • HTTP (load-balancing)

OpenSearch Dashboards

Usage

Pre-requisites

Juju

OpenSearch Dashboard is a Juju charm. This means that an existing Juju environment is necessary.

Install and initialize the LXD lightweight container hypervisor and Juju from the Snap Store:

sudo snap install juju --classic --channel=3.1/stable
sudo snap install lxd
lxd init --auto

Then, boostrap Juju over LXD:

juju bootstrap localhost

Charmed OpenSearch

OpenSearch Dashboards visualizes an underlying OpenSearch database. This means that a Charmed OpenSearch instance also has to be ready and available.

A straightforward installation guide is available in the charm's Github repository.

Install Charmed OpenSearch Dashboards

The Dashboards charm requires no specific environment adjustments. Therefore all we need to do to deploy the charm from Charmhub is

juju deploy opensearch-dashboards --channel=2/edge

and integrate it with the OpenSearch charm:

juju integrate opensearch opensearch-dashboards-operator

Enable TLS encryption

Switching to TLS support for the OpenSearch Dashboards charms goes identically to how it goes for OpenSearch.

Install the self-signed-certificates operator

juju deploy self-signed-certificates --channel=latest/stable

and integrate it with the Dashboards charm

juju integrate opensearch-dashboards self-signed-certificates

Test interactive access

Functionality of the service can be tested by making an attempt to access the portal either from the command-line or a web browser.

A few pieces of information are required to do this.

URL

Construct the URL first.

The Dashboard front-end is exposed on port 5601. Using juju status we can retrieve the IP of each unit:

opensearch-dashboards/0*     active    idle   1        10.4.151.209              

Using the example above, the Dashboard URL is http://10.4.151.209:5601.

Authentication

Set up a database user by deploying the data-integrator charm and integrating it with opensearch. The user is created automatically as a result of the integration.

$ juju deploy data-integrator
$ juju deploy data-integrator --config index-name=<index_name>

Retrieve user credentials running

juju run data-integrator/0 get-credentials

at the bottom of the output you should see something like:

  password: 8kubD7nbWYZFHPVEzIVmTyqV42I7wHb4
  <CA certificate here>
  username: opensearch-client_15

Access the Dashboard

Using information from above, the dashboard URI is construted as

https://<IP>:5601

Log in with the credentials of the new user.

OpenSearch Dashboards login

You must create an "index pattern" that enables the Dasboard to access the user's data. It should specify the index_name that was used to create the user with data-integrator.

Follow instructions from OpenSearch documentation on How to create an index pattern

When the index pattern is defined, data that belongs to the user will display in the Dasboards.

License

The Charmed OpenSearch Dashboards Operator is free software, distributed under the Apache Software License, version 2.0. See LICENSE for more information.