I was able to change the POD cidrs at my cluster:
> $ microk8s kubectl get po -A -o wide
> NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
> kube-system calico-kube-controllers-79949b87d-w4pwj 1/1 Running 4 46m 192.1.182.101 hsc-ctsc-kub1 <none> <none>
> kube-system calico-node-w5jbx 1/1 Running 4 46m 10.234.70.212 hsc-ctsc-kub1 <none> <none>
> kube-system coredns-ccd8f67bc-zf2pj 1/1 Running 5 17h 192.1.182.103 hsc-ctsc-kub1 <none> <none>
> kube-system metrics-server-64fc948c75-d59rm 1/1 Running 4 46m 192.1.182.100 hsc-ctsc-kub1 <none> <none>
$ microk8s kubectl describe pod calico-node-w5jbx -n kube-system | egrep 'CALICO_IPV4POOL_CIDR:'
CALICO_IPV4POOL_CIDR: 192.1.0.0/16
$ cat /var/snap/microk8s/current/args/kube-proxy | egrep 'cluster-cidr='
--cluster-cidr=192.1.0.0/16
I also wanted the service-cluster-ip-range and for this I changed the file
/var/snap/microk8s/current/args/kube-apiserver
To have:
$ cat /var/snap/microk8s/current/args/kube-apiserver | egrep 'service-cluster-ip-range='
--service-cluster-ip-range=192.152.183.0/24
I re-started the cluster using “microk8s stop” and “microk8s start” and this setting is not being updated since:
$ microk8s kubectl get servicecidrs
NAME CIDRS AGE
kubernetes 10.152.183.0/24 17h
A consequence I have is on joining a node I get the warning:
$ microk8s join 10.234.70.212:25000/xxxxXXXXXXXXXXxxxxxxxx --worker
Contacting cluster at 10.234.70.212
WARNING: Joining a cluster that has a different CIDR. The kube-proxy CIDR configuration will be overwritten.
Cluster CIDR: 192.1.0.0/16 -- Node CIDR: 10.1.0.0/16(will be overwritten)
Why is that? Thanks in advance