> For the complete documentation index, see [llms.txt](https://platform9.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform9.com/kb/pmk/how-to/how-to-disable-the-imagelocality-scheduling-plugin-in-pmk.md).

# How to Disable the ImageLocality Scheduling Plugin in PMK

Learn how to disable the imageLocality scheduling plugin in Platform9 Managed Kubernetes. Follow our step-by-step guide to update the kube-scheduler configuration and ensure optimal scheduling behavio

## Problem

* How to disable the imageLocality Scheduling plugin in PMK.

## Environment

* Platform9 Managed Kubernetes - All Versions
* Platform9 Self Managed Cloud Platform - All Versions
* Component: Kube-Scheduler

## Procedure

{% hint style="warning" %}
**Warning**

The steps below won't persist cluster upgrades. It needs to be reapplied after every cluster upgrade.
{% endhint %}

**Option A**: Disable `imageLocality` plugin for default scheduling behaviour.

* Update `/etc/pf9/kube.d/configs/kube-scheduler.yaml`on each master node as below.

{% tabs %}
{% tab title="kube-scheduler.yaml" %}

```bash
apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
clientConnection:
  kubeconfig: /srv/kubernetes/kubeconfigs/kube-scheduler.yaml
profiles:
  - schedulerName: default-scheduler
    plugins:
      score:
        disabled:
          - name: ImageLocality
```

{% endtab %}
{% endtabs %}

* Perform a full-stack restart. (One Master Node at a time)

{% tabs %}
{% tab title="Command" %}

```bash
$ /opt/pf9/nodelet/nodeletd phases restart
```

{% endtab %}
{% endtabs %}

**Option B**: Disable `imageLocality` plugin using a new Scheduling profile.

* Update `/etc/pf9/kube.d/configs/kube-scheduler.yaml`on each master node as below.

{% tabs %}
{% tab title="kube-scheduler.yaml" %}

```bash
apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
clientConnection:
  kubeconfig: /srv/kubernetes/kubeconfigs/kube-scheduler.yaml
profiles:
  - schedulerName: default-scheduler
  - schedulerName: no-imagelocality-scheduler
    plugins:
      score:
        disabled:
          - name: ImageLocality
```

{% endtab %}
{% endtabs %}

* Perform a full-stack restart. (One Master Node at a time)

{% tabs %}
{% tab title="Command" %}

```bash
/opt/pf9/nodelet/nodeletd phases restart
```

{% endtab %}
{% endtabs %}

* Now, Pods that want to be scheduled according to a specific profile (in this case `no-imagelocality-scheduler` ) can include the corresponding scheduler name in their `.spec.schedulerName`

## Additional Information

* For more information on kube-scheduler configuration, refer this [document](https://kubernetes.io/docs/reference/scheduling/config/#scheduling-plugins).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://platform9.com/kb/pmk/how-to/how-to-disable-the-imagelocality-scheduling-plugin-in-pmk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
