Services
5 min read Quiz at the end
Services expose pods via ClusterIP (internal), NodePort (node IP), or LoadBalancer (cloud).
Kubernetes Services
# ClusterIP — internal only (default)
apiVersion: v1
kind: Service
metadata:
name: myapp-svc
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 3000
# NodePort — exposes on each node IP
spec:
type: NodePort
ports:
- port: 80
targetPort: 3000
nodePort: 30080
# LoadBalancer — cloud load balancer
spec:
type: LoadBalancer
kubectl get services
kubectl describe svc myapp-svc
Topic Quiz · 2 questions
Test your understanding before moving on
1. Which Service type creates a cloud load balancer?
💡 LoadBalancer provisions a cloud provider load balancer (e.g. AWS ELB, GCP LB) automatically.
2. A ClusterIP service is accessible from:
💡 ClusterIP is the default Service type — only reachable from within the Kubernetes cluster.