Skip to main content

Pod and Service Subnet Configuration

How to Configure Service and Pod Subnets#

You can set the CIDR for the Pods subnet and Services subnet under spec.clusterNetwork:

yaml
		clusterNetwork:
  services:
    cidrBlocks: ["100.96.0.0/16"]
  pods:
    cidrBlocks: ["100.64.0.0/11"]
	

The cidrBlocks parameters expect an array of strings in IPv4 CIDR notation. The subnets cannot have conflicting addresses and must use private, non-publicly-routed ranges. The platform default is the RFC 6598 carrier-grade NAT space (100.64.0.0/10), shown above: pods use 100.64.0.0/11 and services use 100.96.0.0/16. RFC 6598 is preferred over the more common RFC 1918 ranges because almost no home, office, or cloud network routes it, so the cluster's internal addresses are unlikely to collide with a network you connect to.

Note

The CIDR blocks cannot be changed in running clusters, only at creation time.

You can also configure the domain for your services in the spec.clusterNetwork section:

yaml
		clusterNetwork:
  serviceDomain: "cluster.local"