<p>I try to use priorityClass.</p>
<p>I create two pods, the first has system-node-critical priority and the second cluster-node-critical priority.</p>
<p>Both pods need to run in a node labeled with nodeName: k8s-minion1 but such a node has only 2 cpus while both pods request 1.5 cpu.
I then expect that the second pod runs and the first is in pending status. Instead, the first pod always runs no matter the classpriority I affect to the second pod.</p>
<p>I even tried to label the node afted I apply my manifest but does not change anything.</p>
<p>Here is my manifest :</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: firstpod
spec:
  containers:
  - name: container
    image: nginx
    resources:
      requests:
        cpu: 1.5
  nodeSelector:
    nodeName: k8s-minion1
  priorityClassName: cluster-node-critical
---
apiVersion: v1
kind: Pod
metadata:
  name: secondpod
spec:
  containers:
  - name: container
    image: nginx
    resources:
      requests:
        cpu: 1.5
  priorityClassName: system-node-critical
  nodeSelector:
    nodeName: k8s-minion1
</code></pre>
<p>It is worth noting that I get an error <code>&quot;unknown object : priorityclass&quot;</code> when I do <code>kubectl get priorityclass</code> and when I export my running pod in yml with <code>kubectl get pod secondpod -o yaml</code>, I cant find any <code>classpriority:</code> field.</p>
<p>Here Are my version infos:</p>
<pre><code>$ kubectl version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;10&quot;, GitVersion:&quot;v1.10.0&quot;, GitCommit:&quot;fc32d2f3698e36b93322a3465f63a14e9f0eaead&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2018-03-26T16:55:54Z&quot;, GoVersion:&quot;go1.9.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;} 
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;10&quot;, GitVersion:&quot;v1.10.0+coreos.0&quot;, GitCommit:&quot;6bb2e725fc2876cd94b3900fc57a1c98ca87a08b&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2018-04-02T16:49:31Z&quot;, GoVersion:&quot;go1.9.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>Any ideas why this is not working?</p>
<p>Thanks in advance,</p>
<p>Abdelghani</p>

Abdelghani
<p>PriorityClasses first appeared in <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.8.md#scheduling-1" rel="nofollow noreferrer">k8s 1.8 as alpha feature</a>.
It <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.11.md#graduated-to-beta" rel="nofollow noreferrer">graduated to beta in 1.11</a></p>
<p>You are using 1.10 and this means that this feature is in alpha.</p>
<p>Alpha features are not enabled by default so you would need to enable it.</p>
<p>Unfortunately k8s version 1.10 is no longer supported, so I'd suggest to upgrade at least to 1.14 where <a href="https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/" rel="nofollow noreferrer">priorityClass feature</a> became stable.</p>
