0
0
Kubernetesdevops~30 mins

Grafana for visualization in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Grafana for visualization
📖 Scenario: You are working in a team that manages a Kubernetes cluster. You want to visualize the cluster's CPU usage using Grafana. To do this, you will deploy Grafana in the cluster and configure it to display CPU metrics.
🎯 Goal: Deploy Grafana on Kubernetes and configure it to visualize CPU usage metrics.
📋 What You'll Learn
Create a Kubernetes deployment for Grafana with the exact name grafana-deployment.
Create a Kubernetes service named grafana-service to expose Grafana on port 3000.
Add a ConfigMap named grafana-config with a basic Grafana configuration.
Print the command to get the Grafana service URL.
💡 Why This Matters
🌍 Real World
Grafana is widely used to visualize metrics from Kubernetes clusters and other systems. This project shows how to deploy and expose Grafana in a Kubernetes environment.
💼 Career
Understanding how to deploy monitoring tools like Grafana on Kubernetes is a key skill for DevOps engineers and site reliability engineers.
Progress0 / 4 steps
1
Create Grafana Deployment
Create a Kubernetes deployment named grafana-deployment with one replica. Use the image grafana/grafana:latest. Set the container port to 3000.
Kubernetes
Need a hint?

Use kind: Deployment and specify replicas: 1. Set the container image and port exactly as instructed.

2
Create Grafana Service
Create a Kubernetes service named grafana-service of type NodePort that exposes port 3000 and targets the deployment with label app: grafana.
Kubernetes
Need a hint?

Use kind: Service with type: NodePort. Match the selector label to the deployment's label.

3
Add Grafana ConfigMap
Create a ConfigMap named grafana-config with a key grafana.ini containing the text [server]\nhttp_port = 3000.
Kubernetes
Need a hint?

Use kind: ConfigMap and add the key grafana.ini with the exact content.

4
Display Grafana Service URL
Write the command to get the NodePort of the grafana-service and print the full URL assuming the cluster node IP is 192.168.99.100. The output should be exactly: http://192.168.99.100:PORT where PORT is the NodePort number.
Kubernetes
Need a hint?

Use kubectl get service grafana-service -o jsonpath={.spec.ports[0].nodePort} to get the NodePort. Then print the URL with the given IP.