<p>EKS 1.23</p>
<p>Trying to set default podTopologySpead on cluster level. Using the suggested config from k8s documentation: <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#cluster-level-default-constraints" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#cluster-level-default-constraints</a> :</p>
<pre><code>apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration

profiles:
  - schedulerName: default-scheduler
    pluginConfig:
      - name: PodTopologySpread
        args:
          defaultConstraints:
            - maxSkew: 1
              topologyKey: topology.kubernetes.io/zone
              whenUnsatisfiable: ScheduleAnyway
          defaultingType: List
</code></pre>
<p>when applying I get the following error:</p>
<pre><code>➜ kubectl apply -f ./topology-test
error: unable to recognize &quot;./topology-test&quot;: no matches for kind &quot;KubeSchedulerConfiguration&quot; in version &quot;kubescheduler.config.k8s.io/v1beta3&quot;
</code></pre>
<p>Also tried to change api version to <code>v1beta1</code>, <code>v1beta2</code>,<code>v1alpha1</code>,<code>v1</code>.</p>
<p>another question regarding it: isn't this configuration requires namespace mention?</p>

jrz
<blockquote>
<p>You can customize the behavior of the kube-scheduler by writing a
configuration file and passing its path as a command line argument.</p>
</blockquote>
<p>You need to pass configuration as an argument to the kube-scheduler like <code>kube-scheduler --config &lt;filename&gt;</code>.</p>
<p>Additionally you can run <code>kubectl api-versions</code> to print the supported API versions on the server.</p>
<p>Please refer the <a href="https://kubernetes.io/docs/reference/scheduling/config/" rel="nofollow noreferrer">docs</a> for details</p>
<p><strong>UPDATE</strong></p>
<p>As it seems, you cannot update the <code>default-scheduler</code> in EKS, you will need to create a <code>custom scheduler</code> in EKS and then pass in your <code>KubeSchedulerConfiguration</code> within the new scheduler, a sample YAML for it can be found <a href="https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/#define-a-kubernetes-deployment-for-the-scheduler" rel="nofollow noreferrer">here</a>.</p>
<p>Also check this <a href="https://stackoverflow.com/questions/66442233/how-to-change-the-behaviour-of-kube-scheduler-in-eks">related SO question</a> about <code>kube-scheduler in EKS</code></p>
