liveBook · Manning

ServiceCIDR

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

A ServiceCIDR is a Kubernetes resource that represents one or more IP address ranges allocated to Services.

A ServiceCIDR is a non-namespaced Kubernetes resource that defines one or more IP ranges for virtual IP addresses assigned to ClusterIP Services. The API server manages the configured Service CIDR, while kube-proxy forwards traffic from Service IPs to backend Pods. Service IPs remain inside the cluster and support service discovery and routing. section 6.2.1 section 6.1

Use these operational distinctions when working with ServiceCIDR:

  • Separate the Service CIDR from the Nodes CIDR and Pod CIDR; all cluster IP ranges must be unique. section 6.1
  • Allow multiple ranges for IPv4, IPv6, or later address-space expansion; the API chooses a free address from the listed ranges. section 6.2.1
  • Delete Services before deleting a ServiceCIDR, because its finalizer blocks deletion while a Service uses an address in that range. section 6.2.1

Reconfigure and verify a Service CIDR

On a fresh Kubernetes v1.34-or-later kind cluster, edit /etc/kubernetes/manifests/kube-apiserver.yaml and change --service-cluster-ip-range from 10.96.0.0/16 to 100.96.0.0/16. After recreating the built-in Services and ServiceCIDR resource, verify the result with kubectl get servicecidr and kubectl get svc -A; expected addresses include 100.96.0.1 for kubernetes and 100.96.0.10 for kube-dns. Update kubelet DNS configuration, then confirm a test Pod uses nameserver 100.96.0.10 and resolves a hostname with nslookup. section 6.1

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

How deep it goes
Explains ranges, finalizers, allocation, kube-proxy routing, and a complete reconfiguration workflow, but not allocator internals.
Examples
Demonstrates changing 10.96.0.0/16 to 100.96.0.0/16 and validating built-in Services, kubelet DNS, and nslookup.
What you can do after
Operate/configure a Service CIDR and verify Service IP allocation and in-cluster DNS after reconfiguration.
How it connects
Connects ServiceCIDR with ClusterIP Services, Pod CIDR, Nodes CIDR, kube-proxy, the API server, and DNS.

Also explained in

Compare how 2 books explain ServiceCIDR →

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.