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.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
1. Verifying the Cluster Status
Before proceeding, ensure your cluster is healthy by checking the status of your pods. Run the following command:2. Reviewing the Kibana Deployment Manifest
Thekibana-deployment.yaml file defines how Kubernetes should deploy the Kibana pod. Open the file to review its contents:
- Resource Kind: A Deployment used to manage the lifecycle of the Kibana pod.
- Namespace: The
efknamespace. - 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
Thekibana-service.yaml file exposes Kibana using a NodePort. Open and inspect the service manifest:
- 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: kibanain theefknamespace.
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:Step 2: Apply the Service Manifest
Next, expose the Kibana pod by applying the service manifest:Step 3: Verify the Pod Status
Clear your terminal and run the following command to check the status of the pods: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:- Identify the NodePort: In our example, the NodePort is 30601.
-
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
Testing Elasticsearch Connectivity
Use the Dev Tools console in Kibana to execute the following commands:-
Run a Search Query:
-
Check Cluster Health:
Clear the previous output and run:
Conclusion
In this guide, you learned how to deploy and expose Kibana on your Kubernetes cluster within theefk 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!