Commit Graph

5666 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
d433db0782 Merge pull request #133978 from aramase/aramase/i/fix_kms_test_133945
kmsv2: run `TestKMSv2ProviderKeyIDStaleness` tests in parallel
2025-09-10 15:05:55 -07:00
Anish Ramasekar
480fad996d kmsv2: run TestKMSv2ProviderKeyIDStaleness in parallel
This change updates the NowFunc to be per KMS provider instead of global
to the API server. This allows integration tests that use distinct
provider names to run in parallel when simulating key expiry.

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-09-10 14:15:43 -07:00
Kubernetes Prow Robot
5cef241d82 Merge pull request #133218 from nmn3m/kube-controller-manager-statuz
adds a list of available HTTP endpoints for the kube-controller-manag…
2025-09-10 11:48:22 -07:00
Kubernetes Prow Robot
2854e946c3 Merge pull request #131430 from carlory/follow-up-127017
remove v1beta3 flowcontrol from rest storage
2025-09-10 11:48:05 -07:00
Kubernetes Prow Robot
bbd859808d Merge pull request #133921 from dims/update-prometheus-client-golang-and-common-packages
update prometheus' client_golang and common packages
2025-09-10 08:40:06 -07:00
carlory
7e6aafe157 fix intergation test
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-09-10 22:51:41 +08:00
Kubernetes Prow Robot
a9fe67a1dd Merge pull request #133990 from macsko/minor_fixes_in_scheduler
Fix minor inconsistencies in scheduler
2025-09-10 06:58:11 -07:00
Patrick Ohly
83273e21b9 DRA scheduler_perf: clean up usage of steady-state pod scheduling
The steady-state pod scheduling is less suitable for integration tests because
the duration is either short (making the test potentially flaky if nothing gets
scheduled yet due to the time constraint) or long (making the test run too
long). It is more useful for benchmark testcase because of the bounded runtime.

Now a single workload definition can be used in both modes with a configuration
parameter for "steadyState".

Workload definitions get updated accordingly. While at it, their names get
simplified and some (in the case of the main DRA config) redundant testcases
get removed.
2025-09-10 13:47:08 +02:00
Patrick Ohly
9af3e86810 scheduler_perf: detect testcases with no pods scheduled
Some of the DRA testcases schedule pods in a steady state for a certain
duration. They pass even if no pods got scheduled at all because in contrast to
the non-steady-state variants they don't wait for fixed number of pods to be
scheduled. This made them unsuitable for integration testing because a real
problem is not flagged as test failure. Now "zero pods scheduled" is detected
for them.

However, they are still not good integration tests (either run quickly and then
risk being flaky or run for a longer time period and then are slow). Revisiting
how they are used in configurations will be done separately.
2025-09-10 13:47:08 +02:00
Maciej Skoczeń
3dfcda9afd Fix minor inconsistencies in scheduler 2025-09-10 11:40:10 +00:00
Kubernetes Prow Robot
2e13e70d5f Merge pull request #133983 from sunya-ch/simplified-consumable-capacity-integration-test
DRA: Fix ConsumableCapacity shceduler perf test (simplified)
2025-09-10 02:16:14 -07:00
Sunyanan Choochotkaew
5483c52e10 DRA: Fix ConsumableCapacity shceduler perf test (simplified)
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>
2025-09-10 13:41:37 +09:00
Morten Torkildsen
81cb5b7df2 DRA: Fix PrioritizedList scheduler perf test 2025-09-09 22:13:32 +00:00
Davanum Srinivas
e2e7fa1799 switch our usage of expfmt.TextParser 2025-09-09 15:53:48 -04:00
Kubernetes Prow Robot
8548f32a46 Merge pull request #133941 from pohly/scheduler-perf-dra-resourceslices
scheduler_perf: treat ResourceSlice publishing as workload startup
2025-09-09 11:57:56 -07:00
Patrick Ohly
8b50c77eb6 scheduler_perf: measure DRA setup time
The time required for pulling ResourceSlices into the scheduler is relevant in
two cases:
- The scheduler was (re)started and waits for informers to sync.
- A driver got deployed and needs to inform the scheduler about its devices.

The new workload measures the second scenario. It's indirectly relevant for
the first one because it allows drawing conclusion about the code which is also
involved in the first one.
2025-09-09 15:15:29 +02:00
Kubernetes Prow Robot
1bec132e1e Merge pull request #133939 from pohly/scheduler-perf-testing-B-metrics
scheduler_perf: reset and stop testing.B metrics
2025-09-09 02:59:31 -07:00
Patrick Ohly
8ff5cec261 scheduler_perf: block after creating ResourceSlices
After creating ResourceSlices, the workload was allowed to proceed even while
the scheduler was still busy receiving those new ResourceSlices. This blurred
the line between "setup" and "measurement" phase of DRA workloads. It's not
immediately clear how much that affected results, but it is cleaner to block.

This is done by returning the scheduler instance to the main scheduler_perf
loop and then pass the SharedDRAManager into the driver setup operation. There
it can be used to poll until that manager has processed all ResourceSlices.
2025-09-08 19:36:32 +02:00
Patrick Ohly
af6da561dd scheduler_perf: reset and stop testing.B metrics
Before, metrics gathered by testing.B (runtime_seconds,
-benchmem's B/op and allocs/op) covered the entire test case, including
starting the apiserver and the initialization steps of a workload. Now those
metrics are also limited to the period where the workload is configured to
collect metrics.
2025-09-08 19:17:24 +02:00
Kubernetes Prow Robot
08946ca255 Merge pull request #132606 from Peac36/fix/132539
add paths section to scheduler statusz endpoint
2025-09-08 07:39:31 -07:00
Kubernetes Prow Robot
597a684bb0 Merge pull request #133172 from ania-borowiec/move_handle_and_plugin
Move interfaces: Handle and Plugin and related types from kubernetes/kubernetes to staging repo kube-scheduler
2025-09-08 06:05:31 -07:00
Nikola
b42b96f518 add paths section to scheduler statusz endpoint
Signed-off-by: Nikola <peac36@abv.bg>
2025-09-08 13:13:42 +03:00
Kubernetes Prow Robot
ef4add4509 Merge pull request #133356 from mayuka-c/issue-133175
Replace usage of deprecated ErrWaitTimeout with recommended method across all Pkgs
2025-09-05 06:43:34 -07:00
Kubernetes Prow Robot
76ab726b8e Merge pull request #133875 from pohly/apimachinery-apply-flake
apply integration test: fix ordering test flake
2025-09-03 14:03:23 -07:00
Patrick Ohly
7e9b228ff0 apply integration test: fix ordering test flake
Most of the time the managed fields were returned in the order as expected,
but not always. Semantically the order is irrelevant, so the comparison gets
relaxed to ignore it by normalizing first.
2025-09-03 16:50:42 +02:00
Patrick Ohly
07faaec2c4 scheduler-perf: fix data race in createPodsSteadily
A mutex lock around decrementing runningPods was missing, leading to a data
race report in ci-kubernetes-integration-race-master:

WARNING: DATA RACE
Read at 0x00c001bd20a8 by goroutine 95696:
  k8s.io/kubernetes/test/integration/scheduler_perf.createPodsSteadily.func7()
      /home/prow/go/src/k8s.io/kubernetes/test/integration/scheduler_perf/scheduler_perf.go:2133 +0x238
  ...

Previous write at 0x00c001bd20a8 by goroutine 101407:
  k8s.io/kubernetes/test/integration/scheduler_perf.createPodsSteadily.func5()
      /home/prow/go/src/k8s.io/kubernetes/test/integration/scheduler_perf/scheduler_perf.go:2064 +0x1a4
  ...
2025-09-03 10:34:38 +02:00
Kubernetes Prow Robot
a6693542b7 Merge pull request #133781 from pohly/test-apiserver-flag-registration
test/integration/apiserver: fix several data races
2025-09-02 13:09:17 -07:00
Patrick Ohly
fa1f9d444c apiserver: avoid default toleration seconds data race for all tests
This reverts commit 2e756e7412,
which addressed the data race only for test/integration/apiserver/oidc.
It also occurs for test/integration/controlplane/transformation:

    WARNING: DATA RACE
    Read at 0x000008b9de38 by goroutine 104616:
      k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds.RegisterFlags()
          /home/prow/go/src/k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds/admission.go:42 +0x30
      k8s.io/kubernetes/pkg/kubeapiserver/options.registerAllAdmissionPluginFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/kubeapiserver/options/plugins.go:115 +0x64
      k8s.io/kubernetes/pkg/kubeapiserver/options.(*AdmissionOptions).AddFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/kubeapiserver/options/admission.go:73 +0x55
      k8s.io/kubernetes/pkg/controlplane/apiserver/options.(*Options).AddFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/controlplane/apiserver/options/options.go:154 +0x388
      k8s.io/kubernetes/cmd/kube-apiserver/app/options.(*ServerRunOptions).Flags()
          /home/prow/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/options/options.go:101 +0x73
      k8s.io/kubernetes/cmd/kube-apiserver/app/testing.StartTestServer()
          /home/prow/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/testing/testserver.go:219 +0xb77
      k8s.io/kubernetes/test/integration/controlplane/transformation.newTransformTest()
          /home/prow/go/src/k8s.io/kubernetes/test/integration/controlplane/transformation/transformation_test.go:131 +0x6d0
      k8s.io/kubernetes/test/integration/controlplane/transformation.TestKMSv2Healthz()
          /home/prow/go/src/k8s.io/kubernetes/test/integration/controlplane/transformation/kmsv2_transformation_test.go:874 +0x1c8
      testing.tRunner()
          /usr/local/go/src/testing/testing.go:1792 +0x225
      testing.(*T).Run.gowrap1()
          /usr/local/go/src/testing/testing.go:1851 +0x44

    Previous write at 0x000008b9de38 by goroutine 111926:
      github.com/spf13/pflag.newInt64Value()
          /home/prow/go/src/k8s.io/kubernetes/vendor/github.com/spf13/pflag/int64.go:9 +0x49
      github.com/spf13/pflag.(*FlagSet).Int64Var()
          /home/prow/go/src/k8s.io/kubernetes/vendor/github.com/spf13/pflag/int64.go:41 +0x3d
      k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds.RegisterFlags()
          /home/prow/go/src/k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds/admission.go:42 +0x25
      k8s.io/kubernetes/pkg/kubeapiserver/options.registerAllAdmissionPluginFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/kubeapiserver/options/plugins.go:115 +0x64
      k8s.io/kubernetes/pkg/kubeapiserver/options.(*AdmissionOptions).AddFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/kubeapiserver/options/admission.go:73 +0x55
      k8s.io/kubernetes/pkg/controlplane/apiserver/options.(*Options).AddFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/controlplane/apiserver/options/options.go:154 +0x388
      k8s.io/kubernetes/cmd/kube-apiserver/app/options.(*ServerRunOptions).Flags()
          /home/prow/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/options/options.go:101 +0x73
      k8s.io/kubernetes/cmd/kube-apiserver/app/testing.StartTestServer()
          /home/prow/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/testing/testserver.go:219 +0xb77
      k8s.io/kubernetes/test/integration/controlplane/transformation.newTransformTest()
          /home/prow/go/src/k8s.io/kubernetes/test/integration/controlplane/transformation/transformation_test.go:131 +0x6d0
      k8s.io/kubernetes/test/integration/controlplane/transformation.TestKMSv2FeatureFlag()
          /home/prow/go/src/k8s.io/kubernetes/test/integration/controlplane/transformation/kmsv2_transformation_test.go:1009 +0x117
      testing.tRunner()
          /usr/local/go/src/testing/testing.go:1792 +0x225
      testing.(*T).Run.gowrap1()
          /usr/local/go/src/testing/testing.go:1851 +0x44

A more general solution is to lock while registering the variables (= write)
and while reading the variables once in InspectFeatureGates.
2025-09-02 21:01:04 +02:00
Patrick Ohly
ad9ae3ab9d test: fix data race in test/integration/controlplane/transformation
TestKMSv2ProviderKeyIDStaleness runs two tests which both modify
kmsv2.NowFunc temporarily. Those two cannot run in parallel. They can be run in
parallel with other tests because nothing else changes kmsv2.NowFunc.

Found during local testing.
2025-09-02 21:01:04 +02:00
Ania Borowiec
fadb40199f Move interfaces: Handle and Plugin and related types from kubernetes/kubernetes to staging repo kube-scheduler 2025-09-02 09:42:53 +00:00
Kubernetes Prow Robot
cb163eb55b Merge pull request #133782 from aojea/lockDisableAllocatorDualWrite
lock DisableAllocatorDualWrite
2025-09-01 22:43:40 -07:00
Kubernetes Prow Robot
5fb3296920 Merge pull request #132451 from macsko/fix_race_in_scheduler_integration_tests
Fix race in scheduler integration tests
2025-08-31 05:03:09 -07:00
Antonio Ojea
8a6f173652 lock DisableAllocatorDualWrite 2025-08-29 19:50:56 +00:00
carlory
faa0f33b8b remove v1beta3 flowcontrol from rest storage
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-08-29 16:32:08 +08:00
Kubernetes Prow Robot
6b33567f9b Merge pull request #133684 from soltysh/drop_StatefulSetAutoDeletePVC
Drop StatefulSetAutoDeletePVC after the feature GA-ed in 1.32
2025-08-28 10:49:15 -07:00
Maciej Szulik
09e357d31f Drop StatefulSetAutoDeletePVC after the feature GA-ed in 1.32
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-08-28 13:35:16 +02:00
Stephen Kitt
c35d5473dd Remove the otel semantics override
With the bump to otelhttp 0.61, this is no longer necessary.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-08-28 09:23:06 +02:00
Kubernetes Prow Robot
f0ee0ddc55 Merge pull request #133703 from macsko/fix_flaking_readyz_check_integration
Fix flaking readyz check in scheduler TestEndpointHandlers
2025-08-27 20:24:35 -07:00
Kubernetes Prow Robot
e162622b5c Merge pull request #133621 from pohly/scheduler-perf-klog-race
scheduler_perf: fix data race warning around klog flush
2025-08-27 20:23:51 -07:00
Kubernetes Prow Robot
63013fca52 Merge pull request #133585 from KobayashiD27/dra-fix-bindingcond-integration-flake
DRA: Fix flake in dra BindingConditions integration test
2025-08-27 20:23:23 -07:00
Kubernetes Prow Robot
993d286230 Merge pull request #133398 from macsko/split_preemption_integration_tests_to_mitigate_timeout
Split preemption integration tests to mitigate the timeout
2025-08-27 17:18:26 -07:00
Kubernetes Prow Robot
dd7ae1fc4f Merge pull request #133319 from dashpole/test_new_semconv
Migrate tracing tests to use the new otelhttp semantic conventions
2025-08-27 17:17:20 -07:00
Kubernetes Prow Robot
36a1587dbf Merge pull request #133080 from togettoyou/cleanup-scheduler_perf_TODO
scheduler_perf: remove outdated TODO comments
2025-08-27 16:05:27 -07:00
Maciej Skoczeń
1c336e3fc6 Fix flaking readyz check in scheduler integration tests 2025-08-26 10:28:47 +00:00
Patrick Ohly
f6b3f916b1 scheduler_perf: fix data race warning around klog flush
Explicitly shutting down background flushing addresses the following data race:

    WARNING: DATA RACE
    Write at 0x0000091173b8 by goroutine 166:
      k8s.io/component-base/logs/api/v1.apply.FlushLogger.func2()
          /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/contextual.go:95 +0x35
      k8s.io/klog/v2.SetLoggerWithOptions()
          /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/contextual.go:75 +0xb4
      k8s.io/component-base/logs/api/v1.apply()
          /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/component-base/logs/api/v1/options.go:277 +0x10fb
      k8s.io/component-base/logs/api/v1.validateAndApply()
          /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/component-base/logs/api/v1/options.go:132 +0x90
      k8s.io/component-base/logs/api/v1.ValidateAndApply()
          /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/component-base/logs/api/v1/options.go:94 +0xd4
      k8s.io/component-base/logs/api/v1.ResetForTest()
          /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/component-base/logs/api/v1/options.go:314 +0xd5
      k8s.io/kubernetes/test/integration/scheduler_perf.setupTestCase.func1()
          /nvme/gopath/src/k8s.io/kubernetes/test/integration/scheduler_perf/scheduler_perf.go:1062 +0x95
      testing.(*common).Cleanup.func1()
          /nvme/gopath/go-1.24.0/src/testing/testing.go:1211 +0x16f
      testing.(*common).runCleanup()
          /nvme/gopath/go-1.24.0/src/testing/testing.go:1445 +0x2b3
      testing.(*common).runCleanup()
          /nvme/gopath/go-1.24.0/src/testing/testing.go:1445 +0x2b3
      testing.tRunner.func2()
          /nvme/gopath/go-1.24.0/src/testing/testing.go:1786 +0x4c
      runtime.deferreturn()
          /nvme/gopath/go-1.24.0/src/runtime/panic.go:605 +0x5d
      k8s.io/apiserver/pkg/endpoints.(*APIInstaller).Install()
          /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go:208 +0x3ad

    ...

    Previous read at 0x0000091173b8 by goroutine 169:
      k8s.io/klog/v2.(*loggingT).flushAll()
          /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1215 +0x166
      k8s.io/klog/v2.(*loggingT).lockAndFlushAll()
          /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1193 +0x58
      k8s.io/klog/v2.(*loggingT).lockAndFlushAll-fm()
          <autogenerated>:1 +0x33
      k8s.io/klog/v2.(*flushDaemon).run.func1()
          /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1143 +0x179

That the cleanup code is shown as being called by runtime/panic.go and
k8s.io/apiserver/pkg/endpoints/installer.go seems to be an oddity of `go test
-race`. Under a debugger it gets called normally, without a panic, and the test
finishes normally either way.

It's debatable whether StopFlushDaemon should be called by the caller of
ResetForTest or by ResetForTest itself. It's explicitly called out as "not
thread safe", so making the caller responsible seems appropriate.
2025-08-20 12:01:56 +02:00
Kobayashi,Daisuke
97a146d47d Refactor error handling: reuse err inside closures and avoid re-shadowing 2025-08-18 22:33:14 +00:00
Kobayashi,Daisuke
38da6d767d DRA: Fixed ResourceClaim UpdateStatus to wrap with RetryOnConflict to automatically retry in the event of a conflict. 2025-08-18 00:46:51 +00:00
Junhao Zou
a405844e66 scheduler_perf(fix): correct typos, clarify comments, and minor tweaks 2025-08-15 16:34:38 +08:00
Nour
d4bd007d3b adds a list of available HTTP endpoints for the kube-controller-manager component under the /statusz page 2025-08-11 22:51:59 +03:00
Jefftree
3fc91586a7 Fix metrics test 2025-08-07 13:59:19 +00:00