Services
Part of the Kubernetes course
You have a Deployment keeping three Pods alive, which solves the problem of Pods dying and not coming back. It does not solve a second problem that shows up the moment you try to actually talk to those Pods: every Pod has its own IP address, and that address is not something you can rely on. A Pod that crashes and gets replaced comes back with a brand new IP.
What you actually want is one address that never changes, no matter how many Pods are behind it or how often they get replaced. That is what a Service is: a stable name and a stable virtual IP that quietly spreads traffic across whatever Pods currently match a label selector, the same kind of selector you already used in the last lesson to let a Deployment find its own Pods. ...
Want to learn Kubernetes Services in a real environment?
Click below, get a fresh Linux box with Kubernetes ready to go, and work through Services hands-on with an AI tutor that knows your code.
Start this lessonServicesWhat you'll learn
- ClusterIP
- NodePort
- LoadBalancer
- Selector matching labels
- Kubectl expose
- Port-forward
Read this lesson in your language
All lessons in this course
14 lessons- 1What is Kubernetes25 min
- 2Your First Pod30 min
- 3Deployments and ReplicaSets35 min
- 4Services35 min
- 5Probes and Self-Healing35 min
- 6ConfigMaps and Secrets35 min
- 7Volumes and Persistent Storage35 min
- 8Namespaces and Labels25 min
- 9Ingress35 min
- 10Helm Basics35 min
- 11Scaling and HPA30 min
- 12RBAC35 min
- 13Observability30 min
- 14Capstone: Deploy a Stack60 min
