Kubernetes scheduler policy config causes seemingly irrelevant error

4/22/2020

Kubernetes version 1.17.4

Trying to toy around with custom scheduler priorities, I'm passing --policy-config-file pointing to file with following contents:

  kind: Policy
  apiVersion: v1
  predicates:
    - name: CheckNodeUnschedulable
    - name: GeneralPredicates
    - name: PodFitsResources
    - name: PodToleratesNodeTaints
    - name: CheckVolumeBinding
    - name: MaxEBSVolumeCount
    - name: MatchInterPodAffinity
    - name: NoDiskConflict
    - name: NoVolumeZoneConflict
    - name: MatchNodeSelector
    - name: HostName
  priorities:
    - {name: BalancedResourceAllocation, weight: 1}
    - {name: LeastRequestedPriority, weight: 1}
    - {name: ServiceSpreadingPriority, weight: 1}
    - {name: NodePreferAvoidPodsPriority, weight: 1}
    - {name: NodeAffinityPriority, weight: 1}
    - {name: TaintTolerationPriority, weight: 1}
    - {name: ImageLocalityPriority, weight: 1}
    - {name: SelectorSpreadPriority, weight: 1}
    - {name: InterPodAffinityPriority, weight: 1}

which, i believe, is the default set of predicates and policies, however kubernetes scheduler fails to start with following error:

F0417 12:35:52.291434       1 factory.go:265] error initializing the scheduling framework: plugin "NodeName" already registered as "FilterPlugin"

The NodeName is not mentioned anywhere in my config file. What am i doing wrong?

-- keymone
kubernetes

1 Answer

5/11/2020

In this link you can see the parameter --policy-config-file is deprecated and the use is not recommended.

Here you can see that GeneralPredicates and HostName use the same nodename plugin:

NodeName Predicate:

registry.RegisterPredicate(predicates.GeneralPred,
...
  plugins.Filter = appendToPluginSet(plugins.Filter, nodename.Name, nil)
...

Hostname predicate:

registry.RegisterPredicate(predicates.HostNamePred,
...
  plugins.Filter = appendToPluginSet(plugins.Filter, nodename.Name, nil)
...

So you could try to disable one of them and see if the error persist.

This should solve the issue for nodename plugin but if an other collision was detected you could try to solve in the same way.

-- KoopaKiller
Source: StackOverflow