Difficulty: Beginner
Estimated Time: 15 minutes

Basic Kubernetes Observability

This scenario explores the basic techniques for observing the state of Kubernetes using metrics.

In the following steps you will learn how to:

  • access metrics information produced by each cAdvisor in each Kubelet,
  • inspect resources using the Resource Metrics API,
  • viewing metrics reported by Metrics Server.

The scenario introduced some fundamental techniques to inspecting a cluster. Not covered here was logging, tracing or monitoring with Prometheus. Those topics are covered in other scenarios.

Lessons Learned

With these steps you have learned how to:

  • access metrics information produced by each cAdvisor in each Kubelet,
  • inspect resources using the Resource Metrics API,
  • viewing metrics reported by Metrics Server.

For a deeper understanding of these topics and more join me, Jonathan Johnson, for a transcendent experience on the No Fluff Just Stuff Software Symposium Tour.

Basic Kubernetes Observability

Step 1 of 5

Your Kubernetes Cluster

For this scenario, Katacoda has just started a fresh Kubernetes cluster for you. Verify it's ready for your use.

kubectl version --short && \ kubectl get componentstatus && \ kubectl get nodes && \ kubectl cluster-info

The Helm package manager used for installing applications on Kubernetes is also available.

helm version --short

Kubernetes Dashboard

You can control the cluster with the kubectl CLI tool or through the Kubernetes Dashboard. Because the dashboard can be accessed publicly, it is protected and requires the secret access token to sign in. Copy the token from this secret.

export TOKEN=$(kubectl describe secret $(kubectl get secret | awk '/^dashboard-token-/{print $1}') | awk '$1=="token:"{print $2}') && echo -e "\n--- Copy and paste this token for dashboard access --\n$TOKEN\n---"

To access the dashboard, click on the Kubernetes Dashboard tab above the command line or from this link: https://[[HOST_SUBDOMAIN]]-30000-[[KATACODA_HOST]].environments.katacoda.com/. At the sign in prompt select Token and paste in the token, you copied a moment ago.

For Kubernetes clusters exposed to the public, always lock administration access including access to the dashboard.