Skip to main content
Hello and welcome back! In this article, we will guide you through deploying a Kibana pod on your Kubernetes cluster. You will learn how to verify your cluster’s status, review the necessary deployment and service manifests, and confirm that Kibana connects effectively with Elasticsearch.

1. Verifying the Cluster Status

Before proceeding, ensure your cluster is healthy by checking the status of your pods. Run the following command:
You should see output similar to this:
Next, verify that the required manifest files are available in your current working directory. List the files by executing:
A sample output might be:

2. Reviewing the Kibana Deployment Manifest

The kibana-deployment.yaml file defines how Kubernetes should deploy the Kibana pod. Open the file to review its contents:
The manifest content is as follows:
This manifest specifies:
  • Resource Kind: A Deployment used to manage the lifecycle of the Kibana pod.
  • Namespace: The efk namespace.
  • Replica Count: A single instance (replica) of Kibana.
  • Container Configuration: Utilizes the official Kibana Docker image from Elastic and exposes port 5601.
Ensure that the versions of Elasticsearch and Kibana are compatible. Always review the corresponding release notes from Elastic before selecting your Docker image.

3. Reviewing the Kibana Service Manifest

The kibana-service.yaml file exposes Kibana using a NodePort. Open and inspect the service manifest:
The manifest content should appear as:
This service configuration:
  • Uses the NodePort type to make Kibana accessible externally.
  • Routes traffic from the cluster’s internal port 5601 to the node’s port 30601.
  • Targets pods labeled with app: kibana in the efk namespace.
By default, the Kibana Docker image searches for Elasticsearch within the same namespace. Ensure that Elasticsearch is deployed in the efk namespace to allow automatic connection.

4. Deploying Kibana

Step 1: Apply the Deployment Manifest

Deploy the Kibana pod by applying the deployment manifest:
A successful operation will confirm with a message similar to:

Step 2: Apply the Service Manifest

Next, expose the Kibana pod by applying the service manifest:
You should see an output like:

Step 3: Verify the Pod Status

Clear your terminal and run the following command to check the status of the pods:
The output may resemble:
Wait a minute or two for the Kibana pod to transition to the Running state. To monitor the progress in real-time, use:
Once the pod shows as running, proceed to verify your services:
A sample output might be:
Depending on your specific requirements, you might consider using a load balancer instead of NodePort for production environments.

5. Connecting to the Kibana UI

Follow these steps to access the Kibana user interface:
  1. Identify the NodePort: In our example, the NodePort is 30601.
  2. Access through Browser: Open your web browser and enter the following URL, replacing \<NODE_IP> with the IP address of your node: http://<NODE_IP>:30601
Once the Kibana UI loads, click on “Explore on my own” (or a similar option) and proceed to the “Dev Tools” section. This interactive console allows you to run queries against the connected Elasticsearch cluster.

Testing Elasticsearch Connectivity

Use the Dev Tools console in Kibana to execute the following commands:
  1. Run a Search Query:
  2. Check Cluster Health: Clear the previous output and run:
A successful response will be similar to:
A status of green means your Elasticsearch cluster is healthy and that Kibana is properly connected.

Conclusion

In this guide, you learned how to deploy and expose Kibana on your Kubernetes cluster within the efk namespace. By carefully following the verification, deployment, and connectivity tests, you can replicate this setup in your environment—whether on-premises or in the cloud. Happy deploying, and see you in the next article!

Additional Resources

If you have any questions, feel free to consult the linked resources or reach out for further assistance.

Watch Video

Practice Lab