kubernetes / website

Kubernetes website and documentation repo:

Home Page:https://kubernetes.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document canonical way to set priority for static pods

stackbaek opened this issue · comments

commented

Per doc, static pods does not support priorityClassName field. However, when static pods are created with only priority values set to 2000001000 (that matches with system-node-critical) kubelet prints the following error:

forbidden: the integer value of priority (2000001000) must not be provided in pod spec; priority admission controller computed 0 from the given PriorityClass name" pod="kube-system/...

/language en
/sig docs

What's the defect @stackbaek? Are you saying that the docs are incorrect, that there is a bug in the kubelet, or that there is a problem but you are not sure where?

commented

The instruction to add priority to static pods is unclear from the doc. From the doc, it implies that I should just add spece.priority to the manifest (since priorityClassName was documented to be not supported). In reality, I had to add both priority and priorityClassName.

At the end of the day, I just want to confirm the canonical way to set priority on the static pods to ensure node critical pods are running under node pressure.


NOTE: I have not tried to set just priorityClassName on the static pods.

/retitle Document canonical way to set priority for static pods

/kind bug

/priority backlog
/triage accepted

The necessary information needs to be added, and the documentation should be corrected. I'd want to hear from more people too.

/assign

@SergeyKanzhelev I was able to create a static pod with priorityClassName and was planning on adding the example to the document. Let me know if anything else is needed or if that isn't expected behavior. I see you have this added for triage with Node bugs.

k get priorityclass
NAME VALUE GLOBAL-DEFAULT AGE
system-cluster-critical 2000000000 false 5d2h
system-node-critical 2000001000 false 5d2h

cat static-web.yaml
apiVersion: v1
kind: Pod
metadata:
name: static-web
labels:
role: myrole
spec:
containers:
- name: web
image: nginx
ports:
- name: web
containerPort: 80
protocol: TCP
priorityClassName: system-cluster-critical

k describe pod static-web-minikube

Name: static-web-minikube
Namespace: default
Priority: 2000000000
Priority Class Name: system-cluster-critical
Node: minikube/192.168.49.2
Start Time: Tue, 25 Jun 2024 15:18:25 -0400
Labels: role=myrole
Annotations: kubernetes.io/config.hash: d13d717ea915d4c4049f7783bb26358a
kubernetes.io/config.mirror: d13d717ea915d4c4049f7783bb26358a
kubernetes.io/config.seen: 2024-06-25T19:18:25.377885764Z
kubernetes.io/config.source: file
Status: Running

@stackbaek and @sftim, I was able to confirm that using just priorityClassName on the static pods works (see example above). Since this is a concept page, we do want to add an example or not? Otherwise, it is just a quick update on the docs to use priorityClassName on the static pods as well.