liveBook · Manning

Clusterip service type

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A ClusterIP is a Kubernetes service type that exposes a service through an internal cluster IP address.

A ClusterIP Service provides internal cluster communication through a Service IP and DNS name. It commonly connects one Pod, such as a frontend, to backend Pods elsewhere in the cluster. section 6.4.1 section 1.4.3

Configure and verify a ClusterIP Service by checking these operational details:

  • Select backend Pods with matching labels, such as app=internal-svc or app=nginx. section 6.4.1 section 5.1.4
  • Expose a Service port and map it to the container targetPort; one Service can define multiple port mappings. section 6.4.1
  • Use the Service name and DNS instead of addressing individual Pod IPs; distinct Services can expose the same port because they have distinct identities. section 6.4.1 section 1.4.3
  • Distinguish ClusterIP from NodePort and LoadBalancer when reviewing how an application is exposed. section 9.3.5

Create a declarative Service manifest

Generate a starting YAML file with `kubectl create svc clusterip internal-svc --tcp 8080:80 --dry-run=client -o yaml > svc.yaml`. The resulting specification uses `port: 8080`, `targetPort: 80`, `protocol: TCP`, a selector such as `app: internal-svc`, and `type: ClusterIP`. Apply it with `kubectl create -f svc.yaml`, then verify it with `kubectl get svc`. section 6.4.1

spec:
  ports:
  - name: 8080-80
    port: 8080
    protocol: TCP
    targetPort: 80
  - name: search
    port: 9200
    protocol: TCP
    targetPort: 9200
  selector:
    app: internal-svc
  type: ClusterIP
status:
  loadBalancer: {}

Inspect the manifest to see how ports, target ports, selectors, and the ClusterIP type combine in one Service definition. section 6.4.1

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains ports, target ports, selectors, commands, and verification, while deferring broader Service-type detail to related coverage.
Examples
Uses frontend-to-backend communication, nginx exposure, multi-port YAML, kubectl generation, and kubectl Service output.
What it assumes
Assumes familiarity with Pods, Deployments, labels, selectors, and basic kubectl while reinforcing Service selectors from practical examples.
What you can do after
Operate/configure ClusterIP Services with kubectl, generate YAML, bind selectors to Pods, map ports, and verify cluster state.
How it connects
Connects Services to Pods, Deployments, label selectors, CoreDNS, ingress, NodePort, and LoadBalancer.

Also explained in

Compare how 6 books explain clusterip service type →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.