Skip to content

Commit

Permalink
Don't add spec.podCIDR when updating node status
Browse files Browse the repository at this point in the history
The controller-manager checks what parts of the cluster CIDR has been
allocated to nodes when it starts up, and if a node.spec.podCIDR is not
in the cluster CIDR range, it will exit, resulting in a crash loop.
  • Loading branch information
ldx committed Apr 14, 2020
1 parent f177204 commit c24988d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/server/nodestatus/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@ func (n *NodeStatusController) UpdateNode(node *corev1.Node) {
n.cidrs = n.cloudClient.GetVPCCIDRs()
klog.V(5).Infof("setting pod CIDRs to %v", n.cidrs)
}
if len(n.cidrs) >= 1 {
node.Spec.PodCIDR = n.cidrs[0]
node.Spec.PodCIDRs = n.cidrs
}
node.Status = n.GetNodeStatus()
// Save node metadata and spec.
n.node = node.DeepCopy()
Expand Down

0 comments on commit c24988d

Please sign in to comment.