<p>I would like to know how it's possible to set a priorityClass by default for all pods in a specific namespace without using a
<code>globalvalue:  true</code></p>
<p>may be with admission controller but i don't know.</p>
<p>Do you have an concret example for that ?</p>

<p><strong>PriorityClass</strong> : <strong>A PriorityClass is a non-namespaced object</strong></p>
<p>PriorityClass also has two optional fields: globalDefault and description.</p>
<p>The globalDefault field indicates that the value of this PriorityClass should be used for Pods without a priorityClassName.</p>
<p><strong>Only one PriorityClass with globalDefault set to true can exist in the system</strong>. If there is no PriorityClass with globalDefault set, the priority of Pods with no priorityClassName is zero.</p>
<p><strong>Create Priority Class as using below yaml (no globalDefault flag is set)</strong></p>
<pre><code>apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
  name: high-priority
value: 1000000
description: &quot;This priority class should be used for pods.&quot;


$ kubectl get priorityclasses.scheduling.k8s.io
NAME                      VALUE        GLOBAL-DEFAULT   AGE
high-priority             1000000      false            10s
</code></pre>
<p><strong>Now add priority class to pod manifest and schedule them in your namespace</strong></p>
<pre><code>$ kubectl create namespace priority-test
namespace/priority-test created

$ kubectl get namespaces 
NAME              STATUS   AGE
default           Active   43m
kube-node-lease   Active   43m
kube-public       Active   43m
kube-system       Active   43m
priority-test     Active   5s
</code></pre>
<p><strong>Example : pod.yaml</strong></p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx
  priorityClassName: high-priority



$ kubectl apply -f pod.yaml -n priority-test
pod/nginx created


ubuntu@k8s-master-1:~$ kubectl get all -n priority-test
NAME        READY   STATUS    RESTARTS   AGE
pod/nginx   1/1     Running   0          25s


$ kubectl describe pod -n priority-test nginx  | grep -i priority
Namespace:            priority-test
Priority:             1000000
Priority Class Name:  high-priority
  Normal  Scheduled  &lt;unknown&gt;  default-scheduler      Successfully assigned priority-test/nginx to worker-1
</code></pre>
