1. Service type
NodePort opens a port on every node that forwards into the Service.
type: NodePortTyporithm · medium
Step 1 of 8 · intro card
Networking
ClusterIP is internal-only, NodePort opens a high port on every node, and LoadBalancer provisions a cloud LB in front — each type adds reach on top of the one before.
ClusterIP exposes a Service only inside the cluster — the right default for service-to-service traffic.
NodePort opens a high port (30000-32767) on every node and forwards it to the Service, useful for quick external access or behind your own load balancer.
LoadBalancer asks the cloud provider for an external load balancer with a public IP, the usual choice for production internet-facing services.
ClusterIP: internal-only, the default.
NodePort: a high port on every node's IP.
LoadBalancer: a cloud-provisioned external IP.
apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
type: NodePort
ports:
- port: 80
targetPort: 8080
nodePort: 30080Connect each part of the code to the concept before you type.
NodePort opens a port on every node that forwards into the Service.
type: NodePortport is the in-cluster Service port, same as ClusterIP.
port: 80targetPort is the pod port that receives the forwarded traffic.
targetPort: 8080nodePort is the external port (30000-32767) reachable on every node's IP.
nodePort: 30080Read the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.