Set priorityClassName and priority on static pods (#13578)

With priority only (#13490), the API server rejects the mirror pods
and the kubelet does not give the pods the node-critical OOM score.
Set both fields, like kubeadm does for its static pods.

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
This commit is contained in:
Ali Afsharzadeh
2026-09-26 08:46:28 +00:00
committed by GitHub
parent 49c7a478e1
commit 90f7c2505f
3 changed files with 9 additions and 9 deletions
@@ -13,10 +13,10 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
nodeSelector:
kubernetes.io/os: linux
{# Static pods do not support priorityClassName, so set the numeric priority of
system-node-critical directly, otherwise kubelet may evict this pod early:
https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#pod-selection-for-kubelet-eviction #}
{# Set both, like kubeadm. The kubelet does not resolve priorityClassName for static pods,
and the API server rejects the mirror pod when priority does not match the class. #}
priority: 2000001000
priorityClassName: system-node-critical
containers:
- name: haproxy
image: {{ haproxy_image_repo }}:{{ haproxy_image_tag }}
@@ -144,10 +144,10 @@ spec:
- kubernetes
ip: 127.0.0.1
hostNetwork: true
{# Static pods do not support priorityClassName, so set the numeric priority of
system-node-critical directly, otherwise kubelet may evict this pod early:
https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#pod-selection-for-kubelet-eviction #}
{# Set both, like kubeadm. The kubelet does not resolve priorityClassName for static pods,
and the API server rejects the mirror pod when priority does not match the class. #}
priority: 2000001000
priorityClassName: system-node-critical
volumes:
- hostPath:
path: /etc/kubernetes/{{kube_vip_admin_conf}}
@@ -13,10 +13,10 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
nodeSelector:
kubernetes.io/os: linux
{# Static pods do not support priorityClassName, so set the numeric priority of
system-node-critical directly, otherwise kubelet may evict this pod early:
https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#pod-selection-for-kubelet-eviction #}
{# Set both, like kubeadm. The kubelet does not resolve priorityClassName for static pods,
and the API server rejects the mirror pod when priority does not match the class. #}
priority: 2000001000
priorityClassName: system-node-critical
containers:
- name: nginx-proxy
image: {{ nginx_image_repo }}:{{ nginx_image_tag }}