Skip to content
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

Node get taint 'node.alpha.kubernetes.io/notReady' when node become 'Unknown' form 'notReady'' #43444

Closed
mdshuai opened this issue Mar 21, 2017 · 18 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling.

Comments

@mdshuai
Copy link

mdshuai commented Mar 21, 2017

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Bug

Kubernetes version (use kubectl version):
v1.7.0-alpha.0.1397+e3f6f14bf0d1af-dirty

What happened:
On node stop docker, then node ready conditions will become notready; then stop kubelet on node, node ready conditions will become 'Unknown', But node only have a taint 'node.alpha.kubernetes.io/notReady'

What you expected to happen:
Node should both taint 'node.alpha.kubernetes.io/notReady:NoExecute' & 'node.alpha.kubernetes.io/unreachable:NoExecute'

How to reproduce it (as minimally and precisely as possible):

  1. Enable 'TaintBasedEvictions' in controller manager
  2. Stop container on node
  3. Check node taint
  4. Stop kubelet on node
  5. Check node taint
    node detail: http://pastebin.test.redhat.com/466570

Anything else we need to know:
If node ready conditions change from 'Ready' to 'Unknown', node have correct taint 'node.alpha.kubernetes.io/unreachable:NoExecute'

@mdshuai
Copy link
Author

mdshuai commented Mar 21, 2017

@derekwaynecarr @aveshagarwal help check thanks

@aveshagarwal
Copy link
Member

looking into this.

@aveshagarwal
Copy link
Member

@kubernetes/sig-scheduling-bugs

@aveshagarwal
Copy link
Member

I am able to reproduce this.

@aveshagarwal
Copy link
Member

I am seeing different behavior with kubectl describe and kubectl get:

Conditions:
  Type			Status		LastHeartbeatTime			LastTransitionTime			Reason			Message
  ----			------		-----------------			------------------			------			-------
  OutOfDisk 		Unknown 	Tue, 21 Mar 2017 09:06:14 -0400 	Tue, 21 Mar 2017 09:06:57 -0400 	NodeStatusUnknown 	Kubelet stopped posting node status.
  MemoryPressure 	Unknown 	Tue, 21 Mar 2017 09:06:14 -0400 	Tue, 21 Mar 2017 09:06:57 -0400 	NodeStatusUnknown 	Kubelet stopped posting node status.
  DiskPressure 		Unknown 	Tue, 21 Mar 2017 09:06:14 -0400 	Tue, 21 Mar 2017 09:06:57 -0400 	NodeStatusUnknown 	Kubelet stopped posting node status.
  Ready 		Unknown 	Tue, 21 Mar 2017 09:06:14 -0400 	Tue, 21 Mar 2017 09:06:57 -0400 	NodeStatusUnknown 	Kubelet stopped posting node status.
_output/bin/kubectl get nodes
NAME              STATUS     AGE       VERSION
192.168.124.120   NotReady   4d        v1.7.0-alpha.0.1399+1e5fa8fed5459a

So kubectl describe shows unkown whereas kubectl get shows NotReady.

@mdshuai
Copy link
Author

mdshuai commented Mar 21, 2017

@aveshagarwal There also are two other issue need confirm with you if it's by design or not.

  1. If there is only one node(all-in-one env), when node become notReady/Unknow, node controller can't add taint to node. multi-nodes no this issue
  2. After node controller add taint to node, then manual remove the taint, node controller can't add the notready/unreachable again.

Thanks

@aveshagarwal
Copy link
Member

@mdshuai first one is by design to avoid mass eviction when all nodes are not ready/unknown. 2nd I am not sure will have to look into that though it seems node controller is honoring user intent so looks good.

Also in my understanding, the original issue here should not affect the end result in a cluster regarding eviction as there is no difference w.r.t action taken irrespective of notready or unreachable taint.

@aveshagarwal
Copy link
Member

@gmarek I am noticing that when a node goes from NotReady to Unreachable even though node status is unknown I dont see the flow reaching here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/node/nodecontroller.go#L530

@mdshuai
Copy link
Author

mdshuai commented Mar 21, 2017

@aveshagarwal thanks confirm

@aveshagarwal
Copy link
Member

@mdshuai how many node cluster are you testing on?

@mdshuai
Copy link
Author

mdshuai commented Mar 21, 2017

@aveshagarwal Three

@aveshagarwal
Copy link
Member

@mdshuai I think i know what is the issue working on a fix.

@aveshagarwal
Copy link
Member

@mdshuai fixed it in #43463

@ethernetdan ethernetdan added this to the v1.6 milestone Mar 21, 2017
@ethernetdan ethernetdan added the kind/bug Categorizes issue or PR as related to a bug. label Mar 21, 2017
@calebamiles calebamiles added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. labels Mar 21, 2017
@grodrigues3 grodrigues3 added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label Mar 21, 2017
@dchen1107
Copy link
Member

The feature is alpha, but what is reported here is indeed a bug for the feature.

@ethernetdan ethernetdan modified the milestones: v1.6.1, v1.6 Mar 22, 2017
@gmarek
Copy link
Contributor

gmarek commented Mar 27, 2017

No, it's not. It's the desired behavior, as we decided at some point that we want to have only one: 'notReady' or 'unreachable' taint on the Node. Current implementation just keeps the first added taint.

@davidopp @timothysc @kubernetes/sig-scheduling-misc

@davidopp
Copy link
Member

Oh, I thought we decided that the taint would always match the node condition. So there would only be one taint at a time, but the taint would always reflect whatever the node condition says. That would be more intuitive. How hard would it be to change the behavior to do that?

@gmarek
Copy link
Contributor

gmarek commented Mar 27, 2017

Easy, but not 1.6 level easy.

@gmarek
Copy link
Contributor

gmarek commented Mar 27, 2017

I'll explain the logic here.. When we first observe a condition other than 'Ready' we add a node to the queue. Node can spend in queue some time, so we check the condition at the time when Taint is applied, so it's consistent at that time. Indeed if the condition is changed after that we won't reflect that. If we want to change this logic we'd need to decide on how we want to do it - do we want this change to be rate limited together with other taint additions (i.e. reuse the same queue as everything else), or do we want it to modify the taint instantly?

I think that the latter makes more sense, so the proper fix would check the current taint in https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/node/nodecontroller.go#L686 (and corresponding part for unresponsive part), and if it's different try to update the taint directly. This has the advantage of not accounting as additional "eviction" for the purpose of monitoring.

The proper fix for the former, would be to just 'remove' the key from the queue if the different taint is present in the same line as above.

k8s-github-robot pushed a commit that referenced this issue Apr 6, 2017
Automatic merge from submit-queue (batch tested with PRs 42961, 44042)

Allow swapping NotReady and Unschedulable Taints

Fix #43444

cc @kubernetes/sig-scheduling-pr-reviews @davidopp @aveshagarwal @mdshuai

For cherrypick @ethernetdan
k8s-github-robot pushed a commit that referenced this issue Apr 10, 2017
…-upstream-release-1.6

Automatic merge from submit-queue

Automated cherry pick of #44042

Cherry pick of #44042 on release-1.6.

#44042: Allow swapping NotReady and Unschedulable Taints

```release-note
Fix [transition between NotReady and Unreachable taints](#43444).
```
mintzhao pushed a commit to mintzhao/kubernetes that referenced this issue Jun 1, 2017
…-of-#44042-upstream-release-1.6

Automatic merge from submit-queue

Automated cherry pick of kubernetes#44042

Cherry pick of kubernetes#44042 on release-1.6.

kubernetes#44042: Allow swapping NotReady and Unschedulable Taints

```release-note
Fix [transition between NotReady and Unreachable taints](kubernetes#43444).
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling.
Projects
None yet
Development

No branches or pull requests

8 participants