diff --git a/test/integration/scheduler_perf/event_handling/performance-config.yaml b/test/integration/scheduler_perf/event_handling/performance-config.yaml index 7bacfe923a8..612adbb795b 100644 --- a/test/integration/scheduler_perf/event_handling/performance-config.yaml +++ b/test/integration/scheduler_perf/event_handling/performance-config.yaml @@ -228,13 +228,20 @@ stageRequirement: Attempted labelSelector: type: unsched - # Update blocker pods' labels and scale down their resource requests - # to make the unschedulable pods schedulable. + # Update blocker pods' labels to make the unschedulable pods schedulable. - opcode: updateAny countParam: $blockerPods templatePath: templates/podupdate-pod-blocker-update.yaml updatePerSecond: 100 namespace: blocker + # Scale down blocker pods' resource requests to make the unschedulable pods schedulable. + - opcode: updateAny + countParam: $blockerPods + templatePath: templates/podupdate-pod-blocker-scale-down.yaml + updatePerSecond: 100 + namespace: blocker + subresources: + - resize # Update pods blocked by SchedulingGates by removing the gate from themselves. - opcode: updateAny countParam: $measurePods diff --git a/test/integration/scheduler_perf/event_handling/templates/podupdate-pod-blocker-scale-down.yaml b/test/integration/scheduler_perf/event_handling/templates/podupdate-pod-blocker-scale-down.yaml new file mode 100644 index 00000000000..f8209a057ca --- /dev/null +++ b/test/integration/scheduler_perf/event_handling/templates/podupdate-pod-blocker-scale-down.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + name: pod-blocker-{{ .Index }} +spec: + containers: + - image: registry.k8s.io/pause:3.10 + name: pause + resources: + requests: + cpu: 0.0001 + memory: 1Mi + nodeName: scheduler-perf-node diff --git a/test/integration/scheduler_perf/event_handling/templates/podupdate-pod-blocker-update.yaml b/test/integration/scheduler_perf/event_handling/templates/podupdate-pod-blocker-update.yaml index f8209a057ca..4bff867a6f9 100644 --- a/test/integration/scheduler_perf/event_handling/templates/podupdate-pod-blocker-update.yaml +++ b/test/integration/scheduler_perf/event_handling/templates/podupdate-pod-blocker-update.yaml @@ -9,5 +9,5 @@ spec: resources: requests: cpu: 0.0001 - memory: 1Mi + memory: {{ div 30000 .Count }}Mi nodeName: scheduler-perf-node diff --git a/test/integration/scheduler_perf/update.go b/test/integration/scheduler_perf/update.go index e8f93c926e7..74cc273468b 100644 --- a/test/integration/scheduler_perf/update.go +++ b/test/integration/scheduler_perf/update.go @@ -49,6 +49,10 @@ type updateAny struct { UpdatePerSecond int // Internal field of the struct used for caching the mapping. cachedMapping *meta.RESTMapping + // List of subresources to update. + // If empty, update operation is performed on the actual resource. + // Optional + Subresources []string } var _ runnableOp = &updateAny{} @@ -145,7 +149,7 @@ func (c *updateAny) update(tCtx ktesting.TContext, env map[string]any) error { if c.cachedMapping.Scope.Name() != meta.RESTScopeNameNamespace { return fmt.Errorf("namespace %q set for %q, but %q has scope %q", c.Namespace, c.TemplatePath, c.cachedMapping.GroupVersionKind, c.cachedMapping.Scope.Name()) } - _, err := resourceClient.Namespace(c.Namespace).Update(tCtx, obj, options) + _, err := resourceClient.Namespace(c.Namespace).Update(tCtx, obj, options, c.Subresources...) if err != nil { return fmt.Errorf("failed to update object in namespace %q: %w", c.Namespace, err) } @@ -158,7 +162,7 @@ func (c *updateAny) update(tCtx ktesting.TContext, env map[string]any) error { if c.cachedMapping.Scope.Name() != meta.RESTScopeNameRoot { return fmt.Errorf("namespace not set for %q, but %q has scope %q", c.TemplatePath, c.cachedMapping.GroupVersionKind, c.cachedMapping.Scope.Name()) } - _, err := resourceClient.Update(tCtx, obj, options) + _, err := resourceClient.Update(tCtx, obj, options, c.Subresources...) if err != nil { return fmt.Errorf("failed to update object: %w", err) }