mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #65469 from k82cn/k8s_64857
Set .spec.schedulerName to ds-controller.
This commit is contained in:
commit
3caa7ada69
@ -1027,10 +1027,8 @@ func (dsc *DaemonSetsController) syncNodes(ds *apps.DaemonSet, podsToDelete, nod
|
|||||||
defer createWait.Done()
|
defer createWait.Done()
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
podTemplate := &template
|
podTemplate := template.DeepCopy()
|
||||||
|
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.ScheduleDaemonSetPods) {
|
if utilfeature.DefaultFeatureGate.Enabled(features.ScheduleDaemonSetPods) {
|
||||||
podTemplate = template.DeepCopy()
|
|
||||||
// The pod's NodeAffinity will be updated to make sure the Pod is bound
|
// The pod's NodeAffinity will be updated to make sure the Pod is bound
|
||||||
// to the target node by default scheduler. It is safe to do so because there
|
// to the target node by default scheduler. It is safe to do so because there
|
||||||
// should be no conflicting node affinity with the target node.
|
// should be no conflicting node affinity with the target node.
|
||||||
@ -1040,6 +1038,9 @@ func (dsc *DaemonSetsController) syncNodes(ds *apps.DaemonSet, podsToDelete, nod
|
|||||||
err = dsc.podControl.CreatePodsWithControllerRef(ds.Namespace, podTemplate,
|
err = dsc.podControl.CreatePodsWithControllerRef(ds.Namespace, podTemplate,
|
||||||
ds, metav1.NewControllerRef(ds, controllerKind))
|
ds, metav1.NewControllerRef(ds, controllerKind))
|
||||||
} else {
|
} else {
|
||||||
|
// If pod is scheduled by DaemonSetController, set its '.spec.scheduleName'.
|
||||||
|
podTemplate.Spec.SchedulerName = "kubernetes.io/daemonset-controller"
|
||||||
|
|
||||||
err = dsc.podControl.CreatePodsOnNode(nodesNeedingDaemonPods[ix], ds.Namespace, podTemplate,
|
err = dsc.podControl.CreatePodsOnNode(nodesNeedingDaemonPods[ix], ds.Namespace, podTemplate,
|
||||||
ds, metav1.NewControllerRef(ds, controllerKind))
|
ds, metav1.NewControllerRef(ds, controllerKind))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user