-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
flannel stripping node taints #667
Comments
So IIUC the situation is that flannel is effectively a 1.5 client, running against a 1.6 master, that reads the Node object, makes some changes in memory, and then writes it back (does the I think what you described is definitely possible. I'm actually not sure how to fix it (other than upgrading the client, of course). cc/ @lavalamp or @xuchao to verify and hopefully provide some suggestion. |
That is my hypothesis for what I have otherwise not yet been able to explain, so I thought I would ask here in flannel if it makes sense and if it has been observed. There's also a general API issue which is how do we deal with this... protobuf has "unknown fields" but I don't think we have something similar for JSON? And I think Update == PUT:
|
Probable confirmation (I believe):
This was actually with canal, not flannel (the original report was observed with flannel though); if there is still doubt let me know and I can repeat experiments or try to do something more scientific. |
Here's an example of using Patch() instead of Put(): But it looks like the diff is done on the client (I was hoping it was done on the server), so I don't think it would solve this problem. |
And I wonder if 1.6 master with 1.5 kubelet has the same problem when Kubelet updates the Node object to update status (even though taints are in spec, not status, the granularity is the whole object). |
I think that using PATCH would solve the problem. That should also answer the question that 1.5 kubelet + 1.6 master should work (because kubelet is using PATCH). So I guess the medium term solution is to migrate flannel (and canal whatever that is) to use PATCH. Though I don't have any good solution for what to do now (other than upgrading it to 1.6 too). |
Great - thanks @wojtek-t ! |
This is a longstanding problem in our client, that we delete fields the we don't understand. (Although even if we fix it by default there, users will still be able to get it wrong. But we're currently broken by default.) Using PATCH is a pretty thorough fix. |
So if I'm understanding this correctly, we should fairly urgently switch flannel to use the v1.6 client, and before 1.7 comes out, switch it to using patch? |
The flannel kube subnet manager uses the (Also this could be a chance to resolve/improve #674) |
Urghh - it also imports "k8s.io/kubernetes/pkg/controller/framework" which was removed in v1.4 AFAICT |
I believe the idea is that you can stick to the 1.5 client if you switch it to use patch, OR you can switch to the 1.6 client. But yeah, you should definitely switch to using patch before 1.7 either way. |
@tomdee I believe it ended up in See https://github.com/kubernetes/client-go/tree/release-3.0/tools/cache Moving to client-go rather than using kubernetes/pkg directly should be the easiest update path IMO. |
I believe this is fixed by #681. There's also #677 to move to client-go. (Big ups to @mikedanese for putting both of those together) |
Yep - the 0.7.1 release should have the PATCH fix in and the lates flannel-git (https://quay.io/repository/coreos/flannel-git?tab=tags) releases should have the client-go fixes in. |
Seeing some odd behaviour: kubelet should be registering a node with 1.6 taints (in a field) - I believe - but then the taints are not there when I look. I think this only happens with flannel.
I hypothesize that the following is happening:
Is this possible? If not, how do we protect against this scenario (cc @davidopp for that one I think)
The text was updated successfully, but these errors were encountered: