mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Merge pull request #114338 from champtar/kubeadm-priority
kubeadm: set priority for "system-node-critical" Pods
This commit is contained in:
commit
f380944261
@ -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),
|
||||
|
@ -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{},
|
||||
|
Loading…
Reference in New Issue
Block a user