Deploy Kibana using Code Engine and connect to your Databases for Elasticsearch instance
With this tutorial, deploy Kibana using Code Engine and connect to your Databases for Elasticsearch instance. Kibana is a web interface that allows you to visualise the data in Elasticsearch instances. Code Engine is a a fully managed, serverless platform that allows you to run workloads without worrying about deploying infrastructure. Elasticsearch is a NoSQL database with powerful search capabilities.
Databases for Elasticsearch does not include a managed Kibana service, but with this tutorial you can provision a Kibana instance and connect to your Databases for Elasticsearch instance within a few minutes and still using the managed service model of IBM Cloud.
NOTE: Code Engine is a paid-for service, so following this tutorial will incur charges.
Before you start
Before you begin, ensure you have the following:
- An IBM Cloud Account.
- Terraform - to deploy infrastructure
- A Databases for Elasticsearch instance
Obtain an API key to deploy infrastructure to your account
Follow these steps to create an IBM Cloud API key that enables Terraform to provision infrastructure into your account. You can create up to 20 API keys.
For security reasons, the API key is only available to be copied or downloaded at the time of creation. If the API key is lost, you must create a new API key.
Clone the project
git clone https://github.com/IBM/elasticsearch-kibana-codeengine.git
Upload and Analyze your Data
-
Navigate into the terraform folder of the cloned project.
cd elasticsearch-kibana-codeengine/terraform
-
On your machine, create a document that is named
terraform.tfvars
, with the following fields:ibmcloud_api_key = "<your_api_key_from_step_1>" region = "<the IBM region where you will deploy the Code Engine application>" es_host = "<the hostname of your elasticsearch deployment>" es_port = "<the port number of your elasticsearch deployment>" es_username = "<the username of your elasticsearch deployment>" es_password = "<the password of your elasticsearch user>"
The
terraform.tfvars
document contains variables that you might want to keep secret.Kibana runs with
ELASTICSEARCH_SSL_VERIFICATIONMODE
set tonone
, so although the traffic between Kibana and Elasticsearch is encrypted, the Elasticsearch service is not verified against the CA certificate provided by IBM Databases for Elasticsearch credentials. -
Install the infrastructure with the following command:
terraform init terraform apply --auto-approve
Visit your Kibana deployment
The previous step produces a URL, which is the public URL of your Kibana deployment. It looks something like: https://kibana-app.1834dcfgrtygbg.eu-gb.codeengine.appdomain.cloud
.
Visit that URL in your web browser. You should see the Kibana login screen where you can log in with your credentials and have access to your Elasticsearch deployment!
Your Databases for Elasticsearch incurs charges. After you finish this tutorial, you can remove all the infrastructure by going to the terraform
directory of the project and using the command:
terraform destroy