Sign inSign up free

104. Deploy and Expose an App

easy 10 XP ~6 minHands-on lab100% acceptance

The quote-engine service is moving to Kubernetes. Its container is already configured to listen on port 9000; other workloads in the cluster will reach it on port 5000 through a stable Service name.

Task

  • Create a Deployment quote-engine in namespace inventory with 3 replicas of the image caddy:2.8.
  • Its Pods carry the labels app=quote-engine and tier=backend, and the container declares port 9000.
  • Create a Service quote-engine-svc of type ClusterIP in the same namespace that accepts traffic on port 5000 and forwards it to port 9000 of the Pods.
  • The Service routes to every ready replica of quote-engine, and to nothing else.

A practice cluster is running on this machine: start with kubectl get all -n inventory.

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 run in a lightweight runtime: their commands, kubectl logs, exec and run -it work, and Pods reach Services by name with wget or curl. Images never download, and port-forward isn't available. k is an alias for kubectl, with completion. The grader checks the cluster's final state, not the commands you typed.

Part of Kubernetes Core Concepts. Next step: Service Types

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh machine with its own Kubernetes cluster starts in about half a minute, with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.