Interview Q&A / Docker & Kubernetes

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What are the different Service types in Kubernetes?

SHORT ANSWER

ClusterIP exposes a Service only inside the cluster, NodePort opens a port on every node, LoadBalancer provisions a cloud load balancer, and ExternalName maps the Service to an external DNS name.

Explain it simply

Think of an office building. ClusterIP is the internal extension number: staff can dial it, outsiders cannot. NodePort is a side door on every floor at the same door number. LoadBalancer is the main reception desk on the public road. ExternalName is a forwarding note saying 'for this, call another company'.

ClusterIP (default) gives a stable virtual IP and DNS name reachable only within the cluster. NodePort opens a port, 30000 to 32767 by default, on every node, and forwards to the Service. LoadBalancer asks the cloud provider (AWS, GCP, Azure) for an external load balancer pointing at the node ports, giving a public address. ExternalName returns a CNAME to an outside host, such as a managed database, with no proxying.

Each type builds on the previous: LoadBalancer includes NodePort, which includes ClusterIP.

Example

yaml
apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  type: ClusterIP        # NodePort | LoadBalancer | ExternalName
  selector:
    app: web
  ports:
    - port: 80
      targetPort: 8080

What to say in the interview

"ClusterIP is internal only, NodePort exposes a port on each node, LoadBalancer provisions an external cloud load balancer, and ExternalName is a DNS alias to an outside host. Each of the first three builds on the one before."

Common mistakes

  • Using NodePort in production when a LoadBalancer or Ingress is more suitable.

#kubernetes#service#networking

Related questions

Practise more Docker & Kubernetes questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Docker & Kubernetes quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.