Commit Graph

23725 Commits

Author SHA1 Message Date
Kensei Nakada
c7e7eee554
feature(scheduling_queue): track events per Pods (#118438)
* feature(sscheduling_queue): track events per Pods

* fix typos

* record events in one slice and make each in-flight Pod to refer it

* fix: use Pop() in test before AddUnschedulableIfNotPresent to register in-flight Pods

* eliminate MakeNextPodFuncs

* call Done inside the scheduling queue

* fix comment

* implement done() not to require lock in it

* fix UTs

* improve the receivedEvents implementation based on suggestions

* call DonePod when we don't call AddUnschedulableIfNotPresent

* fix UT

* use queuehint to filter out events for in-flight Pods

* fix based on suggestion from aldo

* fix based on suggestion from Wei

* rename lastEventBefore → previousEvent

* fix based on suggestion

* address comments from aldo

* fix based on the suggestion from Abdullah

* gate in-flight Pods logic by the SchedulingQueueHints feature gate
2023-07-17 15:53:07 -07:00
Kubernetes Prow Robot
a776bf0462
Merge pull request #116335 from gnufied/update-api-recovery-apis
Update api recovery apis
2023-07-17 14:52:35 -07:00
Kubernetes Prow Robot
1da70b0736
Merge pull request #119264 from logicalhan/promote-metrics
promote beta metrics
2023-07-17 13:47:41 -07:00
Kubernetes Prow Robot
92856db662
Merge pull request #118973 from ffromani/kubelet-podresources-getallocatable-ga
node: podresources: getallocatable: move to GA
2023-07-17 13:47:33 -07:00
Kubernetes Prow Robot
8633adbb07
Merge pull request #119342 from A-Hilaly/api-server/webhooks/match-conditions-integration-tests
Add integration tests for `MatchConditions` feature gate enablement
2023-07-17 12:47:23 -07:00
Hemant Kumar
e011187114 Update code to use new generic allocatedResourceStatus field 2023-07-17 15:30:35 -04:00
Kubernetes Prow Robot
890a6c8f70
Merge pull request #118895 from RyanAoh/kep-1860
Make Kubernetes aware of the LoadBalancer behaviour
2023-07-17 11:41:10 -07:00
Han Kang
aa788219f4 fix metric names 2023-07-17 11:22:21 -07:00
Amine
00de051729 Make matchConditionsFeatureGateInitiallyEnabled a boolean instead 2023-07-17 18:34:42 +01:00
Kubernetes Prow Robot
4f60a8d493
Merge pull request #119110 from andrewsykim/apf-metrics-beta
Promote kube-apiserver flowcontrol metrics to Beta
2023-07-17 09:05:12 -07:00
Aohan Yang
b1850497b4 Integration tests for IP mode field 2023-07-17 16:03:02 +08:00
Amine
6b3ce3004d Add integration tests for match conditions feature gate enablement 2023-07-16 01:06:08 +01:00
Kubernetes Prow Robot
900237fada
Merge pull request #118635 from ffromani/devmgr-check-pod-running
kubelet: devices: skip allocation for running pods
2023-07-15 05:43:16 -07:00
Kubernetes Prow Robot
5c96e5321e
Merge pull request #119324 from xmudrii/go1206
[go] Bump images, versions and deps to use Go 1.20.6
2023-07-15 03:07:15 -07:00
Kubernetes Prow Robot
8a0ea1bd58
Merge pull request #109616 from wzshiming/feat/pod-host-ips
Field `status.hostIPs` added for Pod
2023-07-15 00:31:04 -07:00
Cici Huang
13172cba5c
ValidatingAdmissionPolicy: support namespace access (#118267)
* Support namespace access from cel expression in validatingadmissionpolicy.

* Whitelist the exposed fields in namespace object and add test

* better handling of cluster-scoped resources.

* [API REVIEW] namespaceObject in Expression doc.

* compatibility with composition.

* generated: ./hack/update-codegen.sh && ./hack/update-openapi-spec.sh

* workaround namespace of namespace is unexpectedly set.

* basic test coverage for namespaceObject.

---------

Co-authored-by: Jiahui Feng <jhf@google.com>
2023-07-14 17:53:08 -07:00
Kubernetes Prow Robot
47aeec63a8
Merge pull request #119272 from deads2k/resources
add list of served versions to storage version
2023-07-14 13:22:41 -07:00
David Eads
90ab7580aa add list of served versions to storage version 2023-07-14 13:47:19 -04:00
Marko Mudrinić
69c4bc29f5
[go] Bump images, versions and deps to use Go 1.20.6
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
2023-07-14 12:04:13 +02:00
Shiming Zhang
b2613dd381 Add e2e to check that hostIPs and Downward API works 2023-07-14 09:35:31 +08:00
Jiahui Feng
b635f2a401
ValidatingAdmissionPolicy: Variable Composition (#118642)
* [API REVIEW] Variable Composition

* lazy map.

* variable composition implementation.

* check variables during VAP validation.

* generated: ./hack/update-vendor.sh

* generated: UPDATE_COMPATIBILITY_FIXTURE_DATA

(cd staging/src/k8s.io/api/ && env UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test)

* cost calucation.

* tests for cost calculations.

* e2e test for variables.

* fix doc for Validation.Expression.

* generated: ./hack/update-codegen.sh

* fix missing utilruntime import.

* generated: ./hack/update-openapi-spec.sh
2023-07-13 17:13:28 -07:00
Kubernetes Prow Robot
1e21da87b8
Merge pull request #118988 from nilekhc/hash-keyid
[KMSv2] chore: hashes keyID being logged
2023-07-13 15:47:48 -07:00
Kubernetes Prow Robot
be2cfc9697
Merge pull request #118228 from carlory/move-non-graceful-node-shutdown-to-GA
move non-graceful node shutdown to GA
2023-07-13 15:47:37 -07:00
Kubernetes Prow Robot
bea27f82d3
Merge pull request #118209 from pohly/dra-pre-scheduled-pods
dra: pre-scheduled pods
2023-07-13 14:43:37 -07:00
Kubernetes Prow Robot
1db4658614
Merge pull request #119295 from jsafrane/remove-serial-localvolume
Remove test Pods sharing a single local PV
2023-07-13 13:43:21 -07:00
Nilekh Chaudhari
131216fa8f
chore: hashes keyID
Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>
2023-07-13 20:42:09 +00:00
Jiahui Feng
049614f884
ValidatingAdmissionPolicy controller for Type Checking (#117377)
* [API REVIEW] ValidatingAdmissionPolicyStatucController config.

worker count.

* ValidatingAdmissionPolicyStatus controller.

* remove CEL typechecking from API server.

* fix initializer tests.

* remove type checking integration tests

from API server integration tests.

* validatingadmissionpolicy-status options.

* grant access to VAP controller.

* add defaulting unit test.

* generated: ./hack/update-codegen.sh

* add OWNERS for VAP status controller.

* type checking test case.
2023-07-13 13:41:50 -07:00
Andrew Sy Kim
d25075f342 update generated list of stable metrics
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2023-07-13 20:13:04 +00:00
Patrick Ohly
80ab8f0542 dra: handle scheduled pods in kube-controller-manager
When someone decides that a Pod should definitely run on a specific node, they
can create the Pod with spec.nodeName already set. Some custom scheduler might
do that. Then kubelet starts to check the pod and (if DRA is enabled) will
refuse to run it, either because the claims are still waiting for the first
consumer or the pod wasn't added to reservedFor. Both are things the scheduler
normally does.

Also, if a pod got scheduled while the DRA feature was off in the
kube-scheduler, a pod can reach the same state.

The resource claim controller can handle these two cases by taking over for the
kube-scheduler when nodeName is set. Triggering an allocation is simpler than
in the scheduler because all it takes is creating the right
PodSchedulingContext with spec.selectedNode set. There's no need to list nodes
because that choice was already made, permanently. Adding the pod to
reservedFor also isn't hard.

What's currently missing is triggering de-allocation of claims to re-allocate
them for the desired node. This is not important for claims that get created
for the pod from a template and then only get used once, but it might be
worthwhile to add de-allocation in the future.
2023-07-13 21:27:11 +02:00
Jan Safranek
052b06bdad Remove test Pods sharing a single local PV
The test runs two pods accessing the same local volume, which is duplicate
with "Two pods mounting a local volume at the same time" test.
2023-07-13 18:33:18 +02:00
Rafael Fonseca
9f5b6db8be test: azure: check error for cloud detection.
If something goes wrong during the Azure cloud detection, trying to cast
the returned value will result in the following panic and give no clue
as to what the error was.

```
  panic: interface conversion: cloudprovider.Interface is nil, not *azure.Cloud

goroutine 1 [running]:
k8s.io/kubernetes/test/e2e/framework/providers/azure.newProvider()
	test/e2e/framework/providers/azure/azure.go:50 +0x2b5
k8s.io/kubernetes/test/e2e/framework.SetupProviderConfig({0xc0007966b8, 0x5})
	test/e2e/framework/provider.go:82 +0x1a6
```
2023-07-13 09:04:24 +02:00
Kubernetes Prow Robot
406d2dfe61
Merge pull request #119250 from pohly/controller-contextual-logging
kube-controller-manager: finish conversion to contextual logging
2023-07-12 18:59:30 -07:00
Kubernetes Prow Robot
4af23c157c
Merge pull request #119242 from carlory/add-logger
change the QueueingHintFn to pass a logger
2023-07-12 13:03:31 -07:00
Kubernetes Prow Robot
047d040ce7
Merge pull request #119012 from pohly/dra-batch-node-prepare
kubelet: support batched prepare/unprepare in v1alpha3 DRA plugin API
2023-07-12 10:57:37 -07:00
Kubernetes Prow Robot
2ec4e14bfa
Merge pull request #118812 from serathius/storage-metric
Improve apiserver storage size metric
2023-07-12 10:57:26 -07:00
carlory
0599b3caa0 change the QueueingHintFn to pass a logger 2023-07-13 00:56:41 +08:00
Patrick Ohly
08d40f53a7 dra: test with and without immediate ReservedFor
The recommendation and default in the controller helper code is to set
ReservedFor to the pod which triggered delayed allocation. However, this
is neither required nor enforced. Therefore we should also test the fallback
path were kube-scheduler itself adds the pod to ReservedFor.
2023-07-12 16:57:17 +02:00
Patrick Ohly
7d064812bb kube-controller-manager: finish conversion to contextual logging
This removes all exceptions and fixes the remaining unconverted log calls.
2023-07-12 14:57:29 +02:00
Kubernetes Prow Robot
3cc729fc7f
Merge pull request #119195 from pohly/dra-reallocate-flake
dra e2e: fix "reallocation works" flake
2023-07-12 05:55:25 -07:00
Patrick Ohly
d743c50bb9 kubelet: support batched prepare/unprepare in v1alpha3 DRA plugin API
Combining all prepare/unprepare operations for a pod enables plugins to
optimize the execution. Plugins can continue to use the v1beta2 API for now,
but should switch. The new API is designed so that plugins which want to work
on each claim one-by-one can do so and then report errors for each claim
separately, i.e. partial success is supported.
2023-07-12 14:50:30 +02:00
Marek Siarkowicz
7a63997c8a Improve apiserver storage size metric to allow it's graduation
Change name to make it compliant with prometheus guidelines.
Calculate it on demand instead of periodic to comply with prometheus standards.
Replace "endpoint" with "server" label to make it semantically consistent with storage factory
2023-07-12 14:33:10 +02:00
Francesco Romani
01c3a51a78 node: podresources: getallocatable: move to GA
lock the feature gate to GA, and remove the now-redundant code.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-07-12 14:11:22 +02:00
Francesco Romani
d78671447f e2e: node: add test to check device-requiring pods are cleaned up
Make sure orphanded pods (pods deleted while kubelet is down) are
handled correctly.
Outline:
1. create a pod (not static pod)
2. stop kubelet
3. while kubelet is down, force delete the pod on API server
4. restart kubelet
the pod becomes an orphaned pod and is expected to be killed by HandlePodCleanups.

There is a similar test already, but here we want to check device
assignment.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-07-12 13:25:36 +02:00
Francesco Romani
5cf50105a2 e2e: node: devices: improve the node reboot test
The recently added e2e device plugins test to cover node reboot
works fine if runs every time on CI environment (e.g CI) but
doesn't handle correctly partial setup when run repeatedly on
the same instance (developer setup).

To accomodate both flows, we extend the error management, checking
more error conditions in the flow.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-07-12 13:25:36 +02:00
Francesco Romani
b926aba268 e2e: node: devicemanager: update tests
Fix e2e device manager tests.
Most notably, the workload pods needs to survive a kubelet
restart. Update tests to reflect that.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-07-12 13:25:36 +02:00
Maciej Szulik
ab3a0b78ea
Match both old and new kubectl version for a while in e2e 2023-07-12 12:49:33 +02:00
Kubernetes Prow Robot
745cfa35bd
Merge pull request #119147 from mengjiao-liu/contextual-logging-controller-disruption
Migrate /pkg/controller/disruption to structured and contextual logging
2023-07-12 03:35:25 -07:00
Kubernetes Prow Robot
a8093823c3
Merge pull request #119042 from sttts/sttts-restcore-split
cmd/kube-apiserver: turn core (legacy) rest storage into standard RESTStorageProvider
2023-07-12 03:35:17 -07:00
Patrick Ohly
c143a875ed dra e2e: fix "reallocation works" flake
The main problem probably was that
https://github.com/kubernetes/kubernetes/pull/118862 moved creating the first
pod before setting up the callback which blocks allocating one claim for that
pod. This is racy because allocations happen in the background.

The test also was unnecessarily complex and hard to read:
- The intended effect can be achieved with three instead of four claims.
- It wasn't clear which claim has "external-claim-other" as name.
  Using the claim variable avoids that.
2023-07-12 11:20:47 +02:00
Mengjiao Liu
19869478c1 Migrate /pkg/controller/disruption to structured and contextual logging 2023-07-12 11:30:45 +08:00