Change:
Is this a BUG REPORT or FEATURE REQUEST?: /kind bug What happened: a cluster, And node1 with resource 1 DaemonSet, request resource 4 run , There is no pod created. resource to the node: run , There is still no pod created. What you expected to happen: In step 5, There is one pod created. How to reproduce it (as minimally and precisely as possible): see above description Anything else we need to know?: Environment: Kubernetes version (use ):1.10.5 Cloud provider or hardware configuration: OS (e.g. from /etc/os-release):CentOS7 Kernel (e.g. ): Install tools: Others: /sig app
xref
Thanks! is not work here! Because: DaemonSetsController didn't watch the changes.(we use to updateNode.) we restart kubelet, The DaemonSetsController watch the changes, but it seems that the node info is not updated, and still failed to create pod:
I found it is a bug here, ignore the changes. I made a fix , PTAL! Thanks!
Any workarounds for old cluster versions? Up: looks like in my case helped but after some delay.
, which version of k8s are you using? If it's sunset, you have to merge the pr yourself :). I think restart kubelet trigger delete/add to make sure it sync .
Sorry, I didn't say
I think we still support 1.12 for now :) let's cherry pick it if not and wait for next 1.12 release.

Discussion:
"//pkg/util/metrics:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", <ins> "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", </ins> "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",

apps "k8s.io/api/apps/v1" "k8s.io/api/core/v1" <ins> apiequality "k8s.io/apimachinery/pkg/api/equality" </ins> "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels"

return len(c1map) == 0 } <ins> func shouldIgnoreNodeUpdate(oldNode, curNode v1.Node) bool { if !nodeInSameCondition(oldNode.Status.Conditions, curNode.Status.Conditions) { return false } oldNode.ResourceVersion = curNode.ResourceVersion oldNode.Status.Conditions = curNode.Status.Conditions return apiequality.Semantic.DeepEqual(oldNode, curNode) } </ins> func (dsc *DaemonSetsController) updateNode(old, cur interface{}) { oldNode := old.(*v1.Node) curNode := cur.(*v1.Node) <del> if reflect.DeepEqual(oldNode.Labels, curNode.Labels) && reflect.DeepEqual(oldNode.Spec.Taints, curNode.Spec.Taints) && nodeInSameCondition(oldNode.Status.Conditions, curNode.Status.Conditions) { // If node labels, taints and condition didn't change, we can ignore this update. </del> <ins> if shouldIgnoreNodeUpdate(*oldNode, *curNode) { </ins> return }

var enqueued bool cases := []struct { <del> test          string newNode       *v1.Node oldNode       *v1.Node ds            *apps.DaemonSet shouldEnqueue bool </del> <ins> test               string newNode            *v1.Node oldNode            *v1.Node ds                 *apps.DaemonSet expectedEventsFunc func(strategyType apps.DaemonSetUpdateStrategyType) int shouldEnqueue      bool </ins> }{ { test:    "Nothing changed, should not enqueue",

ds:            newDaemonSet("ds"), shouldEnqueue: true, }, <ins> { test:    "Node Allocatable changed", oldNode: newNode("node1", nil), newNode: func() *v1.Node { node := newNode("node1", nil) node.Status.Allocatable = allocatableResources("200M", "200m") return node }(), ds: func() *apps.DaemonSet { ds := newDaemonSet("ds") ds.Spec.Template.Spec = resourcePodSpecWithoutNodeName("200M", "200m") return ds }(), expectedEventsFunc: func(strategyType apps.DaemonSetUpdateStrategyType) int { switch strategyType { case apps.OnDeleteDaemonSetStrategyType: return 2 case apps.RollingUpdateDaemonSetStrategyType: return 3 default: t.Fatalf("unexpected UpdateStrategy %+v", strategyType) } return 0 }, shouldEnqueue: true, }, </ins> } for _, c := range cases { for _, strategy := range updateStrategies() {

manager.nodeStore.Add(c.oldNode) c.ds.Spec.UpdateStrategy = *strategy manager.dsStore.Add(c.ds) <del> syncAndValidateDaemonSets(t, manager, c.ds, podControl, 0, 0, 0) </del> <ins> expectedEvents := 0 if c.expectedEventsFunc != nil { expectedEvents = c.expectedEventsFunc(strategy.Type) } syncAndValidateDaemonSets(t, manager, c.ds, podControl, 0, 0, expectedEvents) </ins> manager.enqueueDaemonSet = func(ds *apps.DaemonSet) { if ds.Name == "ds" {