K9s1
is a terminal-based user interface designed to help users interact with Kubernetes clusters more efficiently. It provides a streamlined, visual representation of resources such as pods, nodes, and services, allowing administrators to monitor and manage Kubernetes environments directly from the command line. K9s
offers real-time monitoring, simplified navigation, and easy access to logs and resource details. Its key advantage lies in reducing the need for manual kubectl
2 commands by offering a more intuitive way to manage cluster resources, making Kubernetes management faster and more accessible for developers and sysadmins alike.
K9s
offers pulse
that is a real-time dashboard feature and provides an overview of the cluster's health and resource usage. It displays key metrics such as CPU and memory usage across the cluster or individual namespaces, offering a quick snapshot of resource consumption. Pulse helps users monitor the status and performance of Kubernetes components at a glance, making it easier to detect any issues or inefficiencies within the cluster.
No metrics detected on cluster
When encountering the "No metrics detected on cluster" issue in Kubernetes, it typically points to a problem with the metrics-server3, which is crucial for collecting resource usage data. Without this server, monitoring tools like k9s
can't display key performance metrics, making cluster management challenging.
Fixing missing metrics server in MicroK8s
Without this server, monitoring tools i.e. k9s
can't display key performance metrics. Troubleshooting this issue involves checking if the metrics-server is running, and verifying the configuration.
K9s pulse
We ran the command to see that the metrics-server was not present in the cluster.
k9s -c pu
Debugging k9s
To investigate further, we enabled k9s detailed logging.
k9s -l debug --logFile log.txt
Enabling metrics server
After logging into the Kubernetes node via SSH, we executed the following command to activate the metrics-server on the cluster.
sudo microk8s enable metrics-server
Verify metrics-server is up and running
We checked the status of metrics-server pod.
kubectl get pods -A | grep metrics-server
Verify K9s pulse
We ran again the command to verify that metrics are captured.
k9s -c pu
Summary
After following these steps, we successfully enabled the metrics-server on the Kubernetes cluster. This not only restored the ability to monitor real-time resource usage but also ensured that tools like k9s could provide the necessary performance insights. You can watch full demo here4.