single node cluster crashes when node reboot (container IP changing makes kubeconf out of date) #3071
Labels
area/provider/podman
Issues or PRs related to podman
kind/feature
Categorizes issue or PR as related to a new feature.
triage/duplicate
Indicates an issue is a duplicate of other open issue.
Impact
For a single node cluster, when host OS reboot, the cluster failed to work , e.g. : the kube-controller-manager will complain with logs
NOTE: remember the above IP
10.89.0.1
..Root Cause
(1) When host OS reboot, the IP address of
eth0
inside kind container tends to be different than last time:podman restart
, the podman network will assign a "+1" IP to container. For example, first time IP is10.89.0.1
, the next time will be10.89.0.2
, and so on.(2) When there's only one node for kind cluster, the below 2 kube-config will use nodeIP instead of localhost.
In above conf files, content looks like:
Workaround
I will have to use "sed" to replace the IP from
container IP
to127.0.0.1
, right after kind cluster gets ready.so every time container restarts or os reboot, k8s cluster can survive .
I haven't tested for multiple node situation, in theory , the result will be worse and solution may be more complicated.
Fixes (?)
I propose when kind itself detects only one node for this cluster, below code
AdvertiseAddress
can uselocalhost
instead.c.AdvertiseAddress = strings.Split(c.NodeAddress, ",")[0]
But again, multiple node situation might be harder.
My two cents, just to set the ball rolling...
The text was updated successfully, but these errors were encountered: