Commit Graph

113 Commits

Author SHA1 Message Date
Patrick Ohly
d88a153086 scheduler_perf: add DRA structured parameters test with shared claims
Several pods sharing the same claim is not common, but can be useful and thus
should get tested.

Before, createPods and createAny operations were not able to do this because
each generated object was the same. What we need are different, predictable
names of the claims (from createAny) and different references to those in the
pods (from createPods). Now text/template processing with the index number of
the pod respectively claim as input is used to inject these varying fields. A
"div" function is needed to use the same claim in several different pods.

While at it, some existing test cases get cleaned up a bit (removal of
incorrect comments, adding comments for testing with queuing hints).
2024-06-17 10:13:22 +02:00
Lubomir I. Ivanov
5e290ebc90 switch k/k to pause version 3.10 2024-05-24 10:02:51 +03:00
Maciej Szulik
0c0bd6d0b7
Cleanup unused functions 2024-05-13 17:01:50 +02:00
Mahmoud Atwa
6073d1cd3d Adds tests for bypassing scheduler processing 2024-01-10 20:23:43 +00:00
Patrick Ohly
2472291790 api: introduce separate VolumeResourceRequirements struct
PVC and containers shared the same ResourceRequirements struct to define their
API. When resource claims were added, that struct got extended, which
accidentally also changed the PVC API. To avoid such a mistake from happening
again, PVC now uses its own VolumeResourceRequirements struct.

The `Claims` field gets removed because risk of breaking someone is low:
theoretically, YAML files which have a claims field for volumes now
get rejected when validating against the OpenAPI. Such files
have never made sense and should be fixed.

Code that uses the struct definitions needs to be updated.
2023-08-21 15:31:28 +02:00
Kubernetes Prow Robot
f0417ac850
Merge pull request #110779 from jbartosik/extend-e2e-framework-helpers
Add parameter to set SecurityContext for containers in tests
2023-05-07 23:49:17 -07:00
Yuan Chen
a24aef6510 Replace a function closure
Replace more closures with pointer conversion

Replace deprecated Int32Ptr to Int32
2023-02-27 09:13:36 -08:00
Patrick Ohly
501a7678b3 test/utils: avoid data race during parallel create
The client-go Create call writes into the object that it gets passed. Each call
therefore needs its own copy when invoked in parallel.

Seen in

   go test -v -timeout=0 -bench=.*/SchedulingBasic/5000Nodes -race ./test/integration/scheduler_perf

WARNING: DATA RACE
Read at 0x00c003fa5b00 by goroutine 45227:
  k8s.io/apimachinery/pkg/apis/meta/v1.(*TypeMeta).GroupVersionKind()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go:126 +0x84
  k8s.io/apimachinery/pkg/runtime.WithVersionEncoder.Encode()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/helper.go:231 +0x176
  k8s.io/apimachinery/pkg/runtime.(*WithVersionEncoder).Encode()
      <autogenerated>:1 +0xfb
  k8s.io/apimachinery/pkg/runtime.Encode()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/codec.go:50 +0xb3
  k8s.io/client-go/rest.(*Request).Body()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/rest/request.go:469 +0x884
  k8s.io/client-go/kubernetes/typed/core/v1.(*pods).Create()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go:126 +0x264
  k8s.io/kubernetes/test/utils.CreatePodWithRetries.func1()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/create_resources.go:61 +0x111
  k8s.io/apimachinery/pkg/util/wait.ConditionFunc.WithContext.func1()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:222 +0x30
  k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:262 +0x7b
  k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtection()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:255 +0x5c
  k8s.io/apimachinery/pkg/util/wait.ExponentialBackoff()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:431 +0x67
  k8s.io/kubernetes/test/utils.RetryWithExponentialBackOff()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/create_resources.go:53 +0x1be
  k8s.io/kubernetes/test/utils.CreatePodWithRetries()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/create_resources.go:70 +0x1bf
  k8s.io/kubernetes/test/utils.makeCreatePod()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/runners.go:1339 +0x68
  k8s.io/kubernetes/test/utils.CreatePod.func1()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/runners.go:1349 +0xab
  k8s.io/client-go/util/workqueue.ParallelizeUntil.func1()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/util/workqueue/parallelizer.go:90 +0x1c1

Previous write at 0x00c003fa5b00 by goroutine 45250:
  k8s.io/apimachinery/pkg/apis/meta/v1.(*TypeMeta).SetGroupVersionKind()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go:121 +0x1cc
  k8s.io/apimachinery/pkg/runtime.WithVersionEncoder.Encode()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/helper.go:241 +0x408
  k8s.io/apimachinery/pkg/runtime.(*WithVersionEncoder).Encode()
      <autogenerated>:1 +0xfb
  k8s.io/apimachinery/pkg/runtime.Encode()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/codec.go:50 +0xb3
  k8s.io/client-go/rest.(*Request).Body()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/rest/request.go:469 +0x884
  k8s.io/client-go/kubernetes/typed/core/v1.(*pods).Create()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go:126 +0x264
  k8s.io/kubernetes/test/utils.CreatePodWithRetries.func1()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/create_resources.go:61 +0x111
  k8s.io/apimachinery/pkg/util/wait.ConditionFunc.WithContext.func1()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:222 +0x30
  k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:262 +0x7b
  k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtection()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:255 +0x5c
  k8s.io/apimachinery/pkg/util/wait.ExponentialBackoff()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:431 +0x67
  k8s.io/kubernetes/test/utils.RetryWithExponentialBackOff()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/create_resources.go:53 +0x1be
  k8s.io/kubernetes/test/utils.CreatePodWithRetries()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/create_resources.go:70 +0x1bf
  k8s.io/kubernetes/test/utils.makeCreatePod()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/runners.go:1339 +0x68
  k8s.io/kubernetes/test/utils.CreatePod.func1()
      /nvme/gopath/src/k8s.io/kubernetes/test/utils/runners.go:1349 +0xab
  k8s.io/client-go/util/workqueue.ParallelizeUntil.func1()
      /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/util/workqueue/parallelizer.go:90 +0x1c1
2023-02-16 08:44:42 +01:00
Patrick Ohly
2f6c4f5eab e2e: use Ginkgo context
All code must use the context from Ginkgo when doing API calls or polling for a
change, otherwise the code would not return immediately when the test gets
aborted.
2022-12-16 20:14:04 +01:00
Mark Rossetti
534f052a8d
Updating pause image refernces to 3.9
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-11-14 10:24:54 -08:00
Mark Rossetti
40f3e624a6 Switching everything to use pause:3.8
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-07-21 14:53:15 -07:00
Joachim Bartosik
583ea17efd Add parameter to set SecurityContext for containers in tests
After #106454 tests run with e2e tests run under the restricted pod security
policy level by default.

In order for containers to start with this security policy they must set
appropriate SecurityContext.

See
https://groups.google.com/a/kubernetes.io/g/dev/c/BZlDyz9FK1U/m/57PgQlA4BgAJ
2022-06-24 19:27:37 +02:00
Davanum Srinivas
50bea1dad8
Move from k8s.gcr.io to registry.k8s.io
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-05-31 10:16:53 -04:00
Davanum Srinivas
f7ad09c447
Switch to pause 3.7
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-29 15:36:38 -04:00
Claudiu Belu
18936d4785 updates pause image references
The pause:3.6 image has been published.

Also updates older / incorrect references.
2021-08-29 21:50:05 -07:00
Vivek Singh
80e4007bc3 test: e2e: HPA ContainerResource
This add e2e test for HPA ContainerResource metrics. This add test to cover two scenarios
1. Scale up on a busy application with an idle sidecar container
2. Do not scale up on a busy sidecar with an idle application.

Signed-off-by: Vivek Singh <svivekkumar@vmware.com>
2021-07-21 10:24:00 +05:30
maruiyan
1b6cf83cf4 Error message should not be capitalized. 2021-05-28 16:00:05 +08:00
Kubernetes Prow Robot
b0e9cdb298
Merge pull request #101853 from sanposhiho/scheduler_perf/fix/error-handling-correctly
scheduler_perf: correct error handling
2021-05-25 15:57:15 -07:00
Sascha Grunert
b167fc24d7
Update pause image to v3.5
Update dependencies and the test images to use pause 3.5. We also
provide a changelog entry for the new container image version.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-05-25 09:04:46 +02:00
sanposhiho
074f25523b scheduler_perf: correct error handling 2021-05-11 11:47:20 +09:00
David Eads
b8194cf77c switch most e2e tests to storage/v1 over v1beta1 2021-03-08 13:04:24 -05:00
pacoxu
0c152cbbbe update pause to 3.4.1 for tests(e2e)
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-02-05 21:32:53 +08:00
Dave Chen
b9d9a5ebed Make sure the volume name is not empty when the PVC is bound
Current logic to check whether a PVC is fully bound are:
1. PVC's volume name is not empty
2. Annotation "pv.kubernetes.io/bind-completed" is properly set

The behavior in the test case only set the annotation, and leave the
volume name to be set by a `FakePVController`.

This will cause a problem for us to run some testcase like scheduler's
perf test, scheduling pod with volume as an example, the first try will
always hit "unbound immediate PersistentVolumeClaims" exception.

As a result, the metric data "schedule_attempts_total", or "scheduling_algorithm_duration_seconds"
will not accurate enough.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2020-12-11 16:57:51 +08:00
Dave Chen
d293ae1298 Create PVC first if it's referenced by PV
Signed-off-by: Dave Chen <dave.chen@arm.com>
2020-12-03 13:56:54 +08:00
Adhityaa Chandrasekar
71bc9ce9c2 scheduler_perf: refactor to allow arbitrary workloads
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2020-09-17 19:22:20 +00:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Guangming Wang
bbd4fea21c cleanup: delete unnacessary nil check before range 2020-04-23 20:28:14 +08:00
Aldo Culquicondor
c9314dde59 Add support for multiple label values in test cases
They are assigned in a round robin fashion

Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-03-25 10:06:09 -04:00
Mike Danese
76f8594378 more artisanal fixes
Most of these could have been refactored automatically but it wouldn't
have been uglier. The unsophisticated tooling left lots of unnecessary
struct -> pointer -> struct transitions.
2020-03-05 14:59:47 -08:00
Maciej Borsz
7d59ea8394 Reorder conditions in FindMatchingVolume to avoid checking NodeAffinity
in trivial cases.
2020-02-26 09:20:38 +01:00
Maciej Borsz
bd8ed0a2a7 Add BenchmarkSchedulingWaitForFirstConsumerPVs benchmark 2020-02-25 14:41:14 +01:00
Benjamin Elder
3fb7183215 bump pause to 3.2 in test/ 2020-02-14 14:03:19 -08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Kubernetes Prow Robot
cc5144ff13
Merge pull request #86160 from notpad/feautre/scheduler_perf
Define workloads specs by YAML
2020-01-02 19:15:41 -08:00
danielqsj
fc738cbb1d unify alias of api errors under test 2019-12-26 16:40:45 +08:00
notpad
6511b603c9 Define workloads specs by YAML 2019-12-19 09:08:11 +08:00
Kubernetes Prow Robot
62965b9e47
Merge pull request #83067 from vivekbagade/lifecycle
Adding lifecycle to RC, RCSet, Deployment, and Job testutils
2019-09-25 13:51:51 -07:00
Vivek Bagade
24f15a5823 Adding lifecycle to RC, RCSet, Deployment, and Job testutils 2019-09-25 10:53:28 +02:00
Łukasz Osipiuk
95d1f4d9b0 Allow relaxing deleted pods checking in RC runner
There is strong probabilty that some pods will be deleted when
we are bombarding cluster with high volume of pods. We do that in
Cluster Autoscaler scalability tests and we want to relax check there.

Change-Id: Ib7883666c0c952f61914ab51dcf1f5244e1e7e42
2019-09-19 21:49:03 +02:00
Vivek Bagade
6392b69a1d Adding termination grace period to Deployment, RC, RCSet, and Job 2019-08-30 14:47:10 +02:00
knight42
92c4c2ec72 test(scale): fix tests 2019-08-23 10:19:09 +08:00
AdamDang
799fb862a5
Typo fix: DaemonsSet->DaemonSet
Typo fix: DaemonsSet->DaemonSet
2019-08-01 22:11:15 +08:00
Jan Safranek
f6430c0159 Add benchmark for scheduling of pods with PVs 2019-06-26 14:07:17 +02:00
Andrew Sy Kim
1470df7a05 remove usages of internal clientset in e2e framework
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-03-28 21:13:40 -04:00
wojtekt
7d46e27db1 Avoid allocations in ByIndex() function 2019-03-26 14:14:42 +01:00
luhualin
2bf84f1cc0 fix pod spec affinity mishandling 2019-01-24 16:33:43 +08:00
Weibin Lin
842bd1e1ec update deployment, daemonset, replicaset, statefulset to apps/v1 2018-12-19 10:46:45 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Maciej Borsz
0748cbe2b2 Don't fail RCConfig.start on node restart. 2018-11-07 11:03:51 +01:00