ClusterIP Service

Step 1 : Delete already existing K8s Cluster

kind delete cluster -n local

1. What is extraPortMappings?

Kind runs Kubernetes inside Docker containers. By default, services exposed inside the Kind cluster (e.g., NodePort, LoadBalancer) are not reachable directly from your host machine, because they live inside Docker’s network namespace.

extraPortMappings is Kind’s way of saying:

“Map a port inside the container (the node) to a port on your host machine, so you can access services running in the Kind cluster from outside.”

2. What is containerPort?

This is the port inside the Kind node container (i.e., inside Docker).

3. What is hostPort?

This is the port on your actual host machine (laptop/VM) that you’ll use to reach the Kind cluster service.

Application Pods usually run on worker nodes, not on the control-plane (master) node.

So why does extraPortMappings expose the port on the control-plane container instead of worker nodes?


Here’s the reason: