2

I have a running k8s cluster with default serviceSubnet range. What is the procedure to change it?

So far I tried with:

kubeadm config upload from-flags --service-cidr 172.26.0.0/16

I can see in kubeadm config view that is changed, but services still using the old range, even rebooting the node.

Any ideas?

gixnex
  • 133
  • 9

1 Answers1

2

Changing the default ip range in:

kubectl -n kube-system edit cm kubeadm-config

Also this file:

/etc/kubernetes/manifests/kube-apiserver.yaml

After doing this in all master nodes and rebooting I can see that the services are using 172.26.0.0/16 range.

Probably it will give an error for 172.26.0.1 as this ip is not recognized by the PKI.

In k8s 1.12 it can be fixed using:

kubeadm alpha phase certs all --apiserver-advertise-address 0.0.0.0
--apiserver-cert-extra-sans=<leaderip>,<newserviceip>
gixnex
  • 133
  • 9