Skip to main content

Lab 2.1 - Inspecting the Control Plane

Objectives

By the end of this lab, you will be able to:

  • Inspect Control Plane components
  • Verify the API Server status
  • Examine system components
  • Understand the resource structure

Prerequisites

  • Working Kubernetes cluster (minikube or kind)
  • kubectl installed and configured
  • Cluster access

Exercise 1: Verify Cluster Status

Step 1: Cluster Information

# View cluster information
kubectl cluster-info

# View detailed information
kubectl cluster-info dump

Question: What are the API Server endpoints?

Step 2: Kubernetes Version

# Client and server version
kubectl version

# Server version only
kubectl version --short

Exercise 2: Inspect System Components

Step 1: Component Status

# View component status (deprecated but useful)
kubectl get componentstatuses

# Modern alternative: view system Pods
kubectl get pods -n kube-system

Step 2: Component Details

# View API Server details
kubectl get pods -n kube-system -l component=kube-apiserver

# View API Server logs
kubectl logs -n kube-system -l component=kube-apiserver --tail=50

Exercise 3: Explore the API Server

Step 1: API Endpoints

# View all available endpoints
kubectl get --raw /

# View API resources
kubectl api-resources

# View API versions
kubectl api-versions

Step 2: Local Proxy

# Start a local proxy (in a separate terminal)
kubectl proxy

# In another terminal, test the API
curl http://localhost:8001/api/v1/namespaces

# View Pods via the API
curl http://localhost:8001/api/v1/pods

Exercise 4: Examine System Resources

Step 1: System Namespaces

# List all namespaces
kubectl get namespaces

# View resources in kube-system
kubectl get all -n kube-system

Step 2: System Secrets and ConfigMaps

# View system secrets
kubectl get secrets -n kube-system

# View system ConfigMaps
kubectl get configmaps -n kube-system

Exercise 5: Component Monitoring

Step 1: System Pod Metrics

# View resource usage
kubectl top pods -n kube-system

# Component details
kubectl describe pod <pod-name> -n kube-system

Step 2: Events

# View cluster events
kubectl get events --sort-by='.lastTimestamp' -A

# Events for a specific namespace
kubectl get events -n kube-system

Reflection Questions

  1. How many Control Plane components can you identify?
  2. What is the role of each component you see?
  3. How does the API Server communicate with etcd?
  4. What are the most important system resources?

Cleanup

No cleanup needed - you only read information.


Next Steps

Now that you have inspected the Control Plane:

Lab 2.2: Analyzing Worker Nodes
Chapter 2.6: kubelet - Worker Node Agent


Lab created: December 2024