29/45

Autoscale a Deployment on CPU

easy 10 XP ~6 minHands-on lab

Traffic to dispatcher in namespace orders doubles every weekday afternoon, and someone has been scaling it by hand. Let Kubernetes do it.

Task

  • Create a HorizontalPodAutoscaler named dispatcher in namespace orders that scales Deployment dispatcher.
  • It keeps between 3 and 10 replicas and targets an average CPU utilization of 60%.
  • The app container of dispatcher requests 250m CPU, so that utilization can be computed.
  • The autoscaler invoice-pdf that already exists in the namespace is not changed.

A practice cluster is running on this machine: start with kubectl get deploy,hpa -n orders.

About this machine

Ubuntu 24.04 with a private practice cluster: a real Kubernetes API server, scheduler and controllers, and three nodes (controlplane, node01, node02). Containers are simulated, so images never download and kubectl logs/exec are not available. k is an alias for kubectl, with completion. The grader checks the cluster's final state, not the commands you typed.

TerminalNot started

Your machine is ready to start

Create a free account to open a machine and get graded.