• Home
  • Docker
  • Kubernetes
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • CI
  • Install
  • Samples
  • Archived
Kubernetes | Collect Kubernetes metrics (Minikube's addon: 'metrics-server')
  1. Verify that 'metrics-server' addon is enabled
  2. Use Kubernetes Dashboard to visualize metrics
  3. Metrics API
  4. Use 'kubectl get' command to query the Metrics API
  5. Use 'kubectl top' command to display resources usage
  6. Use 'kubectl describe' command to display the resources allocated to a node

  1. Verify that 'metrics-server' addon is enabled
    Verify that 'metrics-server' addon is enabled:

    Enable metrics-server addon (if disabled):

    Verify that 'metrics-server' pod is running:
  2. Use Kubernetes Dashboard to visualize metrics
    Please see this page for details on how to configure Minikube dashboard: MiniKube dashboard

    • Visualize Nodes metrics

      MiniKube dashboard - Nodes metrics

    • Visualize Pods metrics

      MiniKube dashboard - Pods metrics

  3. Metrics API
    • Check Metrics API version:

    • Check available resources of the Metrics API:
  4. Use 'kubectl get' command to query the Metrics API
    • Node metrics:

      To print node metrics, use the following command:
      kubectl get --raw /apis/metrics.k8s.io/v1beta1/nodes/<NODE_NAME>

      List existing nodes:

      Print Node metrics:

    • Pod metrics:

      To print pod metrics, use the following command:
      kubectl get --raw /apis/metrics.k8s.io/v1beta1/namespaces/<NAMESPACE>/pods/<Pod_NAME>

      List existing Pods:

      Print Pod metrics:
  5. Use 'kubectl top' command to display resources usage
    • Print 'kubectl top' command help:

    • Print Node resources usage:

      You can use the following command to display resources of all nodes:
      kubectl top node

    • Print Pod resources usage:

      You can use the following command to display resources of all pods:
      kubectl top --namespace kube-system

      You can use the option --containers to display resources of all containers of a pod:
      kubectl top pod metrics-server-7bc6d75975-qwgxt --containers --namespace kube-system
  6. Use 'kubectl describe' command to display the resources allocated to a node
    • Print Node information:
© 2025  mtitek