Up-to-date Ubuntu 20.04.3, Juju 2.9.19, standard charmed-kubernetes-733 budle - k8s 1.21.7 - (just added hacluster for kubeapi-lb) deployed to manual cloud. After rebooting of worker node there is always wrong update of value in "--node-ip=" in args file (/var/snap/kubelet/current/args) like following:
root@mnode02:/var/snap/kubelet/current# cat args
--kubeconfig="/root/cdk/kubeconfig" --network-plugin="cni" --v="0" --logtostderr="true" --node-ip="192.168.25.97" --container-runtime="remote" --container-runtime-endpoint="unix:///var/run/containerd/containerd.sock" --config="/root/cdk/kubelet/config.yaml" --dynamic-config-dir="/root/cdk/kubelet/dynamic-config" --pod-infra-container-image="rocks.canonical.com:443/cdk/pause:3.4.1"
to:
root@node02:/var/snap/kubelet/current# cat args
--kubeconfig="/root/cdk/kubeconfig" --network-plugin="cni" --v="0" --logtostderr="true" --node-ip="10.1.29.0" --container-runtime="remote" --container-runtime-endpoint="unix:///var/run/containerd/containerd.sock" --config="/root/cdk/kubelet/config.yaml" --dynamic-config-dir="/root/cdk/kubelet/dynamic-config" --pod-infra-container-image="rocks.canonical.com:443/cdk/pause:3.4.1"
So the node-ip is always changed from "192.168.25.97" to "10.1.29.0". IP pool "10.1.29.1/24" is in this example flannel subnet assigned for this worker node.
After manual fix (replacing 10.1.29.0 back to 192.168.25.97) and kubelet service restart the node is back in cluster.
Complete yaml deploy file:
https://paste.ubuntu.com/p/JRwWb7vf8M/