Change:
API server defaults the service CIDR. We should instead just fail if it is not specified. Defaulting is a wild guess and very likely to be wrong. /sig network /kind bug
For existing clusters that don't currently set it, is setting it to anything other than the current default a breaking change?
Yes. You can not really change it (well, you can expand it, but not totally move it), unless you delete ALL services, including kubernetes.default. I filed this aspirationally. It's not on fire, it's just a dumb thing to have provided a default for.
/triage unresolved Comment when the issue is assessed and confirmed. I am a bot run by vllry. ‍
/triage unresolved Comment when the issue is assessed and confirmed. I am a bot run by vllry. ‍
/remove-triage unresolved
Those labels are not set on the issue: <detailsIn response to : /remove-triage unresolved Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details

Discussion:
}, ServiceNodePortRange: kubeoptions.DefaultServiceNodePortRange, } <del> s.ServiceClusterIPRanges = kubeoptions.DefaultServiceIPCIDR.String() </del> // Overwrite the default for storage data format. s.Etcd.DefaultStorageMediaType = "application/vnd.kubernetes.protobuf"

"--proxy-client-key-file=/var/run/kubernetes/proxy.key", "--request-timeout=2m", "--storage-backend=etcd3", <ins> "--service-cluster-ip-range=192.168.128.0/17", </ins> } fs.Parse(args) // This is a snapshot of expected options parsed by args. expected := &ServerRunOptions{ ServiceNodePortRange:   kubeoptions.DefaultServiceNodePortRange, <del> ServiceClusterIPRanges: kubeoptions.DefaultServiceIPCIDR.String(), </del> <ins> ServiceClusterIPRanges: (&net.IPNet{IP: net.ParseIP("192.168.128.0"), Mask: net.CIDRMask(17, 32)}).String(), </ins> MasterCount:            5, EndpointReconcilerType: string(reconcilers.LeaseEndpointReconcilerType), AllowPrivileged:        false,

PerConnectionBandwidthLimitBytesPerSec: s.MaxConnectionBytesPerSec, }) <del> serviceIPRange, apiServerServiceIP, lastErr := master.DefaultServiceIPRange(s.PrimaryServiceClusterIPRange) </del> <ins> serviceIPRange, apiServerServiceIP, lastErr := master.ServiceIPRange(s.PrimaryServiceClusterIPRange) </ins> if lastErr != nil { return }

var secondaryServiceIPRange net.IPNet // process secondary range only if provided by user if s.SecondaryServiceClusterIPRange.IP != nil { <del> secondaryServiceIPRange, _, lastErr = master.DefaultServiceIPRange(s.SecondaryServiceClusterIPRange) </del> <ins> secondaryServiceIPRange, _, lastErr = master.ServiceIPRange(s.SecondaryServiceClusterIPRange) </ins> if lastErr != nil { return }

// nothing provided by user, use default range (only applies to the Primary) if len(serviceClusterIPRangeList) == 0 { var primaryServiceClusterCIDR net.IPNet <del> serviceIPRange, apiServerServiceIP, err = master.DefaultServiceIPRange(primaryServiceClusterCIDR) </del> <ins> serviceIPRange, apiServerServiceIP, err = master.ServiceIPRange(primaryServiceClusterCIDR) </ins> if err != nil { return options, fmt.Errorf("error determining service IP ranges: %v", err) }

return options, fmt.Errorf("service-cluster-ip-range[0] is not a valid cidr") } <del> serviceIPRange, apiServerServiceIP, err = master.DefaultServiceIPRange(*(primaryServiceClusterCIDR)) </del> <ins> serviceIPRange, apiServerServiceIP, err = master.ServiceIPRange(*(primaryServiceClusterCIDR)) </ins> if err != nil { return options, fmt.Errorf("error determining service IP ranges for primary service cidr: %v", err) }

&cfg.ExtraConfig, } <del> serviceIPRange, apiServerServiceIP, err := DefaultServiceIPRange(c.ExtraConfig.ServiceIPRange) </del> <ins> serviceIPRange, apiServerServiceIP, err := ServiceIPRange(c.ExtraConfig.ServiceIPRange) </ins> if err != nil { klog.Fatalf("Error determining service IP ranges: %v", err) }

"k8s.io/kubernetes/pkg/registry/core/service/ipallocator" ) <del> // DefaultServiceIPRange takes a the serviceIPRange flag and returns the defaulted service ip range (if  needed), // api server service IP, and an error func DefaultServiceIPRange(passedServiceClusterIPRange net.IPNet) (net.IPNet, net.IP, error) { </del> <ins> // ServiceIPRange checks if the serviceClusterIPRange flag is nil, raising a warning if so and // setting service ip range to the default value in kubeoptions.DefaultServiceIPCIDR // for now until the default is removed per the deprecation timeline guidelines. // Returns service ip range, api server service IP, and an error func ServiceIPRange(passedServiceClusterIPRange net.IPNet) (net.IPNet, net.IP, error) { </ins> serviceClusterIPRange := passedServiceClusterIPRange if passedServiceClusterIPRange.IP == nil { <del> klog.Infof("Network range for service cluster IPs is unspecified. Defaulting to %v.", kubeoptions.DefaultServiceIPCIDR) </del> <ins> klog.Warningf("No CIDR for service cluster IPs specified. Default value which was %s is deprecated and will be removed in future releases. Please specify it using --service-cluster-ip-range on kube-apiserver.", kubeoptions.DefaultServiceIPCIDR.String()) </ins> serviceClusterIPRange = kubeoptions.DefaultServiceIPCIDR } if size := ipallocator.RangeSize(&serviceClusterIPRange); size < 8 {