Static website, mission 3 of 7
Give it an address
beginner, about 8 minutes, in the Kubernetes Simulator
Opens once you pass Pods that heal.
The briefing
Pods come and go, and each new one gets a new IP address. Nothing should depend on a pod's IP. A Service gives a set of pods one stable address and spreads traffic across whichever of them are ready.
A Service finds its pods by label, not by name: its selector — here app=web — matches the labels the deployment puts on every pod. The pods it picks are its endpoints.
You can make one with kubectl expose, or write it as YAML and kubectl apply -f it. Type vi svc.yaml to open the editor.
What you'll do
- Create a Service called web that selects the app=web pods
- Listen on port 80 and send traffic to the pods' port 80
- All 3 pods sit behind it as endpoints
- Bonus star: Write the Service as YAML and kubectl apply -f it
The mission checks the cluster, not your keystrokes: any fix that works, passes.
More Static website missions
- 1. Your first pod
- 2. Pods that heal
- 3. Give it an address
- 4. Look inside
- 5. Launch day
- 6. Ship v2
- 7. The 3am page