Services
Give pods stable networking with ClusterIP, NodePort and LoadBalancer.
What you will be able to do
- Use ClusterIP for internal traffic.
- Use a LoadBalancer or Ingress for public traffic.
- Services select pods by labels.
- Use port names for clarity.
In plain English
Pods have changing IPs, so a Service provides a stable virtual IP and DNS name. ClusterIP is internal, NodePort exposes a port on every node and LoadBalancer asks the cloud for an external load balancer.
apiVersion: v1
kind: Service
metadata:
name: web
spec:
type: ClusterIP
selector:
app: web
ports:
- name: http
port: 80
targetPort: 80Your turn
EasyExpose port 80
Write a Service port mapping from port 80 to targetPort 8080.
YAML · starter
ports: []Check your understanding before moving on.
Knowledge checkQuestion 1
Which Service type is internal to the cluster?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.