You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gcp-controller: don't make assumptions on PodCIDRs
The gcp-controller, to avoid issues with preemtible VMs, detect
when a VM has changed and delete all Pods associated to avoid
Kubernetes controllers think this was a restart, when it actually
was a completely replacement of the VM.
The heuristic for detecting a Node change are based on:
- the instance ID, that is unique for each instance
- the pod.Spec.PodCIDRs value
The logic for the PodCIDR value is not easy to generalize and current
implementation is based on a specific implementation and configuration.
In addition, the pod.Spec.PodCIDRs field is inmutable once set, so
it can only change if the VM is new, ie. the instanceID has changed, so
no need to duplicate the logic.
Change-Id: Ic39996f473682973c9ac6c81bfa10a14dd473b77
Signed-off-by: Antonio Ojea <[email protected]>
klog.Warningf("Instance %q has alias range(s) %v and none of them match node's podCIDR %s, will trigger node deletion.", inst.Name, unmatchedRanges, node.Spec.PodCIDR)
983
-
returntrue, nil
984
-
}
985
-
// Instance with no alias range is route based, for which node object deletion is unnecessary.
986
-
klog.V(2).Infof("Instance %q has no alias range.", inst.Name)
0 commit comments