mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2026-01-08 16:21:50 +00:00
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