mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
Merge pull request #55394 from krzysztof-jastrzebski/e2e6
Automatic merge from submit-queue (batch tested with PRs 55394, 55412). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Adds e2e tests for Pod Priority and Preemption in Cluster Autoscaler This PR adds e2e tests for Pod Priority and Preemption in Clucter Autoscaler: - shouldn't scale up when expendable pod is created - should scale up when non expendable pod is created - shouldn't scale up when expendable pod is preempted - should scale down when expendable pod is running - shouldn't scale down when non expendable pod is running
This commit is contained in:
@@ -112,23 +112,24 @@ type RunObjectConfig interface {
|
||||
}
|
||||
|
||||
type RCConfig struct {
|
||||
Affinity *v1.Affinity
|
||||
Client clientset.Interface
|
||||
InternalClient internalclientset.Interface
|
||||
Image string
|
||||
Command []string
|
||||
Name string
|
||||
Namespace string
|
||||
PollInterval time.Duration
|
||||
Timeout time.Duration
|
||||
PodStatusFile *os.File
|
||||
Replicas int
|
||||
CpuRequest int64 // millicores
|
||||
CpuLimit int64 // millicores
|
||||
MemRequest int64 // bytes
|
||||
MemLimit int64 // bytes
|
||||
ReadinessProbe *v1.Probe
|
||||
DNSPolicy *v1.DNSPolicy
|
||||
Affinity *v1.Affinity
|
||||
Client clientset.Interface
|
||||
InternalClient internalclientset.Interface
|
||||
Image string
|
||||
Command []string
|
||||
Name string
|
||||
Namespace string
|
||||
PollInterval time.Duration
|
||||
Timeout time.Duration
|
||||
PodStatusFile *os.File
|
||||
Replicas int
|
||||
CpuRequest int64 // millicores
|
||||
CpuLimit int64 // millicores
|
||||
MemRequest int64 // bytes
|
||||
MemLimit int64 // bytes
|
||||
ReadinessProbe *v1.Probe
|
||||
DNSPolicy *v1.DNSPolicy
|
||||
PriorityClassName string
|
||||
|
||||
// Env vars, set the same for every pod.
|
||||
Env map[string]string
|
||||
@@ -539,6 +540,7 @@ func (config *RCConfig) create() error {
|
||||
DNSPolicy: *config.DNSPolicy,
|
||||
NodeSelector: config.NodeSelector,
|
||||
TerminationGracePeriodSeconds: &one,
|
||||
PriorityClassName: config.PriorityClassName,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -615,6 +617,9 @@ func (config *RCConfig) applyTo(template *v1.PodTemplateSpec) {
|
||||
if len(config.VolumeMounts) > 0 {
|
||||
template.Spec.Containers[0].VolumeMounts = config.VolumeMounts
|
||||
}
|
||||
if config.PriorityClassName != "" {
|
||||
template.Spec.PriorityClassName = config.PriorityClassName
|
||||
}
|
||||
}
|
||||
|
||||
type RCStartupStatus struct {
|
||||
|
||||
Reference in New Issue
Block a user