-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
taint fields: timeAdded not set #42394
Comments
doc for that field says it is only written for NoExecute taints, and that field is omitempty |
ah, looks like omitempty will only work if timeAdded is a pointer |
opened speculative PR in #43016 to change it to a pointer (like other optional time fields like deletionTimestamp) |
/cc @kubernetes/sig-scheduling-bugs |
@davidopp what component is supposed to set timeAdded for NoExecute taints (and is validation supposed to prevent it for taints with effects other than NoExecute)? The only place I see it getting set is by the node controller |
As @liggitt alluded to, strictly speaking timeAdded is only needed for taints of effect NoExecute. The field is needed in order to make tolerationSeconds work in the face of component failure -- whichever component enforces the taint will evict the pod if timeAdded + pod.tolerationSeconds <= time.Now. (Yes, clock skew will break this if they are different components.) So only the components that add NoExecute taints (which is only NodeController) set timeAdded, and only for NoExecute taints. #40586 was filed with the suggestion to add it for all taints. It's not strictly necessary, but since the field is user-visible (despite being purely an "internal" concept), it would probably be less confusing if we were consistent and set timeAdded for all taint types. For 1.6 I think the current behavior is fine. These comments are unrelated to #43016, they are just about whether/when we should be setting timeAdded. Let me know if this is unclear. |
Other components where taints can be added are: kubelet (-register-with-taints) and kubectl taints. Right now, taint controller enforces pod eviction for NoExecute taints. |
Another component is node controller that adds taints for node problems (unreachable, notready) but clock skew is not an issue here, but only for kubelet, kubectl taint I think. |
If the switch to a pointer won't change the values servers will accept, then current behavior seems ok for 1.6 (for JSON, we'll need to handle |
@davidopp @aveshagarwal @liggitt should this be blocking for 1.6? |
@smarterclayton says proto always tolerates missing objects, so I think #43016 is ok to move to 1.7 |
The PR was moved to 1.8, should we also move this issue to 1.8? |
/priority important-soon |
friendly v1.8 release ping, does this issue need to be in the v1.8 milestone? is this issue actively being worked? it looks like #43016 which partially fixes this issue has been moved to v1.9 |
no, moving to 1.9 |
Automatic merge from submit-queue (batch tested with PRs 43016, 50503, 51281, 51518, 51582). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Omit timeAdded from taint when empty Fixes omitempty portion of #42394
Automatic merge from submit-queue (batch tested with PRs 43016, 50503, 51281, 51518, 51582). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Omit timeAdded from taint when empty Fixes omitempty portion of kubernetes/kubernetes#42394 Kubernetes-commit: 1c0f22ea0194ba068abd34f7ca5df22af646e90e
/status approved-for-milestone We'd like to get this fixed in 1.9. |
You must be a member of the @kubernetes/kubernetes-milestone-maintainers github team to add status labels. |
[MILESTONENOTIFIER] Milestone Issue Current Issue Labels
|
Automatic merge from submit-queue (batch tested with PRs 43016, 50503, 51281, 51518, 51582). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Omit timeAdded from taint when empty Fixes omitempty portion of kubernetes/kubernetes#42394 Kubernetes-commit: 1c0f22ea0194ba068abd34f7ca5df22af646e90e
Automatic merge from submit-queue (batch tested with PRs 43016, 50503, 51281, 51518, 51582). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Omit timeAdded from taint when empty Fixes omitempty portion of kubernetes/kubernetes#42394 Kubernetes-commit: 1c0f22ea0194ba068abd34f7ca5df22af646e90e
Automatic merge from submit-queue (batch tested with PRs 43016, 50503, 51281, 51518, 51582). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Omit timeAdded from taint when empty Fixes omitempty portion of kubernetes/kubernetes#42394 Kubernetes-commit: 1c0f22ea0194ba068abd34f7ca5df22af646e90e
Fixed by #43016. |
I set taints on a node using the kubelet, but the timeAdded field was not set:
In addition, I think we prefer to omit null fields.
The text was updated successfully, but these errors were encountered: