NodePort vs LoadBalancer vs Ingress
Common
- get external traffic into cluster
ClusterIP
- internal access
- default service
- kubectl proxy --port=8080 (enable external access)
http://localhost:8080/api/v1/proxy/namespaces/<NAMESPACE>/services/<SERVICE-NAME>:<PORT-NAME>/
http://localhost:8080/api/v1/proxy/namespaces/default/services/my-internal-service:http/
NodePort
- open a port (30000–32767) in every node
- only one service per port
- If your Node/VM IP address change, you need to deal with that
LoadBalancer
- standard way
- send any kind of traffic to it, like HTTP, TCP, UDP, Websockets, gRPC, or whatever.
- expensive
Ingress
- not a service
refs