codegurukool.com · Free coding tutorials & online compiler

Home › Kubernetes Tutorial › Service types: ClusterIP, NodePort, LoadBalancer

Service types: ClusterIP, NodePort, LoadBalancer

Choose who can reach your app.

ClusterIP (default) is reachable only inside the cluster. NodePort opens a port (30000-32767) on every node. LoadBalancer asks your cloud provider for a public load balancer. With minikube, run minikube service web to open a NodePort service in the browser.

Example code

kubectl expose deployment web --type=NodePort --port=80
kubectl get svc

Run this code in the online editor

← ServicesLabels and selectors →