Key Point: ClusterIP is the default service type. It exposes the service on an internal IP within the cluster.
External clients cannot access it directly. Perfect for internal microservices communication.
NodePort - External Access via Node
External Access:192.168.1.10:30080
NodePort:30080 (30000-32767 range)
Service ClusterIP:10.96.0.10:80
Target Port (Pod):8080
apiVersion:v1kind:Servicemetadata:name:my-nodeport-servicespec:type:NodePortselector:app:nginxports:
- port:80targetPort:8080nodePort:30080# Optional, auto-assigned if not specified
Key Point: NodePort builds on ClusterIP by exposing the service on a static port on every node.
External clients can access the service using any node's IP and the NodePort. Good for testing, but not ideal for production.
Key Point: LoadBalancer builds on NodePort by provisioning an external load balancer from the cloud provider.
This is the standard way to expose services to the internet in production on AWS, GCP, or Azure. Each service gets its own load balancer.
ExternalName - DNS CNAME Mapping
Service Name:my-external-service
External CNAME:database.example.com
DNS Resolution:my-external-service → database.example.com
Proxying:None (pure DNS redirect)
apiVersion:v1kind:Servicemetadata:name:my-external-servicenamespace:defaultspec:type:ExternalNameexternalName:database.example.com# No selector, ports, or clusterIP needed
Key Point: ExternalName creates a DNS CNAME record pointing to an external service.
When pods query the service name, they get redirected to the external DNS name. No proxying or load balancing occurs.
Perfect for integrating with external databases, legacy systems, or third-party APIs.