Merge pull request #114338 from champtar/kubeadm-priority

kubeadm: set priority for "system-node-critical" Pods
This commit is contained in:
Kubernetes Prow Robot 2022-12-10 09:05:48 -08:00 committed by GitHub
commit f380944261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,8 @@ var (
// ComponentPod returns a Pod object from the container, volume and annotations specifications
func ComponentPod(container v1.Container, volumes map[string]v1.Volume, annotations map[string]string) v1.Pod {
// priority value for system-node-critical class
priority := int32(2000001000)
return v1.Pod{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1",
@ -71,6 +73,7 @@ func ComponentPod(container v1.Container, volumes map[string]v1.Volume, annotati
},
Spec: v1.PodSpec{
Containers: []v1.Container{container},
Priority: &priority,
PriorityClassName: "system-node-critical",
HostNetwork: true,
Volumes: VolumeMapToSlice(volumes),

View File

@ -392,6 +392,8 @@ func TestGetEtcdProbeEndpoint(t *testing.T) {
}
func TestComponentPod(t *testing.T) {
// priority value for system-node-critical class
priority := int32(2000001000)
var tests = []struct {
name string
expected v1.Pod
@ -419,6 +421,7 @@ func TestComponentPod(t *testing.T) {
Name: "foo",
},
},
Priority: &priority,
PriorityClassName: "system-node-critical",
HostNetwork: true,
Volumes: []v1.Volume{},