-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle mismatched nodenames in etcd mode IPAM cleanup #467
Handle mismatched nodenames in etcd mode IPAM cleanup #467
Conversation
@@ -63,14 +63,14 @@ func (c *NodeController) OnUpdates(updates []bapi.Update) { | |||
case bapi.UpdateTypeKVUpdated: | |||
n := upd.KVPair.Value.(*apiv3.Node) | |||
|
|||
if c.config.SyncLabels { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change just makes sure we're always populating the nodemapper map (we're already always running the syncer.)
0145628
to
cb9e2a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comment.
b38afae
to
b15c86a
Compare
b15c86a
to
7a910e0
Compare
7a910e0
to
1e2e6b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor nits and possible very minor bugettes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UT needs fixing. Possible minor bug related to tracking node tidy up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - as soon as tests pass :-)
) * Handle mismatched nodenames in etcd mode IPAM cleanup * Add IPAM GC test for etcd mismatched nodenames * Don't do anything for nodes which don't have a k8s equivalent * Handle case where no Calico node exists for IPAM entry * Add some more IPAM GC FV tests * Review comments * Update go modules * More feedback
) * Handle mismatched nodenames in etcd mode IPAM cleanup * Add IPAM GC test for etcd mismatched nodenames * Don't do anything for nodes which don't have a k8s equivalent * Handle case where no Calico node exists for IPAM entry * Add some more IPAM GC FV tests * Review comments * Update go modules * More feedback
Description
Looks like our IPAM GC controller has a bug in etcd mode when the name
of the Node in Calico's etcd doesn't match the name of the node in the
Kubernetes API.
It causes the controller to wrongfully release IP addresses that should
not yet be released. This change updates the controller to map nodenames
from Calico node names to Kubernetes node names before doing the
existence check.
Todos
Release Note