CompCode Academy

Lesson 2 of 4 · Free to read

Exercises

Exercises — Kubernetes Observability on Kind

Watch & learn

Course video

Open on YouTube
OpenTelemetry Collector on Kubernetes — Collector agent/gateway pattern on a cluster — receivers to exporters.

Course video

Open on YouTube
Docker Tutorial for Beginners (freeCodeCamp) — Images, containers, and local parity.

Keep a lab notebook: hypothesis → command → result. Speed without evidence is not a skill.

How to use this file

  • Work Lab A → B → C on the same orders-lab repo
  • Prefer Docker Desktop; use Kind when the lab says so
  • Definition of Done at the bottom is the phase gate

Lab A — Kind + kube-prometheus-stack

Time: 60–90 min
Goal: Prometheus/Grafana up in-cluster.

Setup

Kind cluster; Helm 3.

Steps

  1. Create Kind cluster with enough RAM.
  2. Helm install kube-prometheus-stack.
  3. Port-forward Grafana/Prometheus and login.

Success criteria

  • Grafana shows cluster dashboards

If stuck

If pods Pending, check Kind node resources and PVC storage.


Lab B — ServiceMonitor your api

Time: 45–60 min
Goal: api metrics appear via ServiceMonitor.

Setup

api Deployment with /metrics.

Steps

  1. Add labels matching a ServiceMonitor selector.
  2. Apply ServiceMonitor YAML.
  3. Confirm targets UP in Prometheus.

Success criteria

  • Target UP
  • RED queries work in-cluster

If stuck

Namespace label selectors must match exactly.


Lab C — OTel Operator + burn-rate rule

Time: 60–90 min
Goal: Annotation injects SDK; PrometheusRule encodes burn-rate.

Setup

Operator installed; Instrumentation CR.

Steps

  1. Install OpenTelemetry Operator.
  2. Create Instrumentation resource; annotate api Pod template.
  3. Apply a PrometheusRule for multi-window burn-rate on error ratio.
  4. Verify async propagation still needs the phase-03 fix.

Success criteria

  • Injected pods show OTel env/volume
  • Rule loads in Prometheus

If stuck

Injection only applies to new pods — rollout restart.


Stretch goals

  • Helm-install LGTM pieces in-cluster with PVCs

Definition of Done

  • ServiceMonitor scrapes api
  • Operator injection demonstrated
  • Burn-rate PrometheusRule applied

Exercises — Kubernetes Observability on Kind.

New free lessons and course updates. Unsubscribe from any email.