(re)setting ip range for k8 loadBalancerIP assignments

4/20/2019

When I created a given k8 cluster I didn't specify anything specific for service-cluster-ip-range. Now when I create new loadBalancer services k8 is assigning values that walk on existing ip addresses within the network.

Checking the allowed range via kubectl cluster-info dump | grep service-cluster-ip-range gives me:

"--service-cluster-ip-range=10.96.0.0/12"

which (oddly enough) isn't where the assigned values are coming from. New values seem to have started at 10.95.96.235 and incremented from there.

Attempts to preset a valid ip in a service descriptor via spec.loadBalancerIP gives me errors from kubelet:

Failed to allocate IP for "newservice": "10.95.96.233" is not allowed in config

My questions are:

  • is it possible to change service-cluster-ip-range without rebuilding the entire cluster?
  • if not, do I have any other options for (pre)setting loadBalancerIP ?
-- ethrbunny
kubernetes

0 Answers