Commit Graph

117461 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
1d846a12da
Merge pull request #118804 from benluddy/authz-deferred-errors
CEL lib: Expose errors on authz decisions instead of raising them from check()
2023-07-13 12:39:37 -07:00
David Eads
be2e5417ea allow api-approvers to approve directories touched by generation 2023-07-13 15:27:53 -04: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
Patrick Ohly
cffbb1f1b2 dra controller: enhance testing
The allocation mode is relevant when clearing the reservedFor: for delayed
allocation, deallocation gets requested, for immediate allocation not. Both
should get tested.

All pre-defined claims now use delayed allocation, just as they would if
created normally.
2023-07-13 21:27:11 +02:00
Patrick Ohly
5cec6d798c dra: revamp event handlers in kube-controller-manager
Enabling logging is useful to track what the code is doing.

There are some functional changes:
- The pod handler checks for existence of claims. This
  avoids adding pods to the work queue in more cases
  when nothing needs to be done, at the cost of
  making the event handlers a bit slower. This will become
  more important when adding more work to the controller
- The handler for deleted ResourceClaim did not check for
  cache.DeletedFinalStateUnknown.
2023-07-13 21:27:11 +02:00
Andrew Sy Kim
0bb419b149 promote the following APF metrics to beta:
apiserver_flowcontrol_request_wait_duration_seconds
apiserver_flowcontrol_request_concurrency_in_use
apiserver_flowcontrol_request_concurrency_limit
apiserver_flowcontrol_rejected_requests_total
apiserver_flowcontrol_dispatched_requests_total
apiserver_flowcontrol_current_inqueue_requests
apiserver_flowcontrol_current_executing_requests

Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2023-07-13 19:00:31 +00:00
Kubernetes Prow Robot
4fa97eae1b
Merge pull request #119291 from mimowo/use-jobctx-for-first-pending
Pass Job context down to firstPendingIndexes
2023-07-13 09:57:05 -07:00
Kubernetes Prow Robot
d39965270e
Merge pull request #119286 from ardaguclu/remove-openapiv3-alpha-env
Remove KUBECTL_EXPLAIN_OPENAPIV3 environment variable
2023-07-13 09:56:57 -07:00
Ricardo Katz
c688478a28
Fix lifecycle generator to check the version correctly (#119268)
* Fix lifecycle generator to check the version correctly

* Fix file header

Co-authored-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>

---------

Co-authored-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
2023-07-13 09:56:49 -07:00
Kubernetes Prow Robot
20e60a03df
Merge pull request #110863 from claudiubelu/path-filepath-update-2
Replaces path.Operation with filepath.Operation (part 2)
2023-07-13 09:56:37 -07:00
Patrick Ohly
ddc0d94790 dra API: ensure that pod status contains no duplicate resource claims
This is a follow-up to https://github.com/kubernetes/kubernetes/pull/117351
which just got merged.
2023-07-13 18:41:40 +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
Jan Safranek
22d8ae1ba6 Enable NewVolumeManagerReconstruction
Enable the feature after all bugs have been (hopefuly) fixed.
2023-07-13 18:11:40 +02:00
Kubernetes Prow Robot
eee56d56ed
Merge pull request #119219 from cpanato/update-prombot
Update publishing-bot rules for release branches to Go 1.20.5
2023-07-13 08:40:49 -07:00
Kubernetes Prow Robot
d37c62dcbf
Merge pull request #117800 from cyclinder/loggin_format
Add '--logging-format' flag to kube-proxy
2023-07-13 08:40:37 -07:00
Dan Winship
9914909f5a Define tcpProtocol in one place in the unit tests rather than many 2023-07-13 10:26:33 -04:00
Dan Winship
967ef29378 Remove/clarify two FIXME comments in the proxier unit test
When I first wrote TestInternalExternalMasquerade, I put "FIXME"
comments in all of the cases that seemed wrong to me, most of which
got removed as we fixed the corner cases. But there were two cases
where we decided that the implemented behavior, though odd, was
correct, and those FIXMEs never got removed.
2023-07-13 10:26:29 -04:00
Dan Winship
1437594786 Remove some stray references to the ProxyTerminatingEndpoints feature gate
All the code to deal with enabling/disabling the feature gate is gone,
but some of the tests were still specifying "this test case assumes
PTE is enabled".
2023-07-13 10:26:25 -04:00
Michal Wozniak
7e3b53042b Pass Job context down to firstPendingIndexes 2023-07-13 16:11:06 +02:00
Kubernetes Prow Robot
cd9215915b
Merge pull request #118480 from carlory/gc_metrics
podgc metrics should count all pod deletion behaviors
2023-07-13 06:52:05 -07:00
Dan Winship
4835d9e137 Belatedly clean up some "Endpoints" vs "EndpointSlice" distinctions in the unit tests
Remove "EndpointSlice" from some unit test names, because they don't
need to clarify that they use EndpointSlices now, because all of the
tests use EndpointSlices now.

Likewise, remove TestEndpointSliceE2E entirely; it was originally an
EndpointSlice version of one of the other tests, but the other test
uses EndpointSlices now too.
2023-07-13 09:41:32 -04:00
Kubernetes Prow Robot
2d6d2b938a
Merge pull request #119271 from aojea/servicedefault_informer
controlplane: kubernetes.default controller stop polling
2023-07-13 05:52:05 -07:00
Arda Güçlü
4d8f569b03 Remove KUBECTL_EXPLAIN_OPENAPIV3 environment variable
Since explain openapiv3 has been moved to beta already, there is no
point to having this environment variable.

This PR removes it.
2023-07-13 13:44:43 +03:00
Antonio Ojea
c5147c91b8 controlplane: kubernetes.default controller stop polling
the kubernetesservice controller is in charge of reconciling the
kubernetes.default service with the first IP in the service CIDR range
and port 443, it also maintains the Endpoints associated to the Service
using the configure EndpointReconciler.

Until now, the controller was creating the default namespace if it
doesn't exist , and creating the kubernetes.default service if it
doesn't exist too. However, it was polling the Service in each loop,
with this change we reuse the apiserver informers to watch the Service
instead of polling.

It also removes the logic to create the default network namespace, since
this is part of the systemnamespaces controller now.

Change-Id: I70954f8e6309e7af8e4b749bf0752168f0ec2c42
Signed-off-by: Antonio Ojea <aojea@google.com>
2023-07-13 10:41:06 +00:00
Kubernetes Prow Robot
56b5f05aea
Merge pull request #119278 from r4f4/azure-fix-cloud-err-detection
test: azure: check error for cloud detection.
2023-07-13 01:28:07 -07: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
cyclinder
71ef0dafa7 add flag 'logging-format' to kube-proxy 2023-07-13 14:33:33 +08:00
cyclinder
c550c17f7f accept int or string flush frequency 2023-07-13 14:33:33 +08:00
SataQiu
148acc8632 enable arm64 support for GCE node configuration 2023-07-13 14:16:46 +08:00
Mike Spreitzer
75186b1c32 Fix, deprecate apiserver_flowcontrol_request_concurrency_limit
Because it is redundant and has a bad name and its HELP string was
outdated.

Also note intended retention period for request_concurrency_in_use.

Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com>
2023-07-13 01:50:37 -04:00
vadasambar
c52911e59a docs: add comment describing LoadConfigFromFile 2023-07-13 09:59:39 +05:30
vadasambar
5c18810f35 chore: update license date for configfile tests 2023-07-13 09:59:39 +05:30
vadasambar
72aeb96132 test: add tests for LoadConfigFromFile 2023-07-13 09:59:39 +05:30
vadasambar
b3373ae273 refactor: make only LoadConfigFromFile public
- `loadConfig` can be made public again when needed (not required now)
2023-07-13 09:59:39 +05:30
vadasambar
8e284389a5 feat: make loadConfig and loadConfigFile public functions
- so that users who import kube-scheduler libraries can use these functions to read kube scheduler config
2023-07-13 09:59:39 +05:30
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
70370d0210
Merge pull request #117731 from jongwooo/refactor/use-early-return-pattern
Use early return pattern to avoid nested conditions
2023-07-12 17:59:41 -07:00
Kubernetes Prow Robot
0086712926
Merge pull request #116922 from sourcelliu/checkpoint
Improve the performance of map usage
2023-07-12 17: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
79c02ceb73
Merge pull request #119154 from aimuz/fix-119152
fix: Add "metav1.CauseType" to "field.ErrorType" map
2023-07-12 12:01:11 -07:00
Kubernetes Prow Robot
e3fe07e322
Merge pull request #119243 from dprotaso/standard-app-protocol
Update standard app protocols
2023-07-12 10:58:00 -07:00
Kubernetes Prow Robot
374866eaf0
Merge pull request #119226 from enj/enj/i/kms_owners
Add enj to apiserver options approver
2023-07-12 10:57:52 -07:00
Kubernetes Prow Robot
1f117fc72e
Merge pull request #119108 from sttts/sttts-restrcore-split-generic-file
kube-apiserver/corerest: split apart generic code
2023-07-12 10:57:44 -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
Kubernetes Prow Robot
ac07b4612e
Merge pull request #117804 from jsafrane/fix-csi-attachable-reconstruction
Fix reconstruction of CSI volumes
2023-07-12 10:57:15 -07:00
carlory
0599b3caa0 change the QueueingHintFn to pass a logger 2023-07-13 00:56:41 +08:00
Kubernetes Prow Robot
be13c6a884
Merge pull request #118508 from serathius/kep2340
Implement Alpha state for KEP #2340
2023-07-12 09:33:11 -07:00
Marek Siarkowicz
39bb8f4bb1 Implement ConsistentListFromCache feature gate
Request bookmark every 100ms when there is at least one request blocked on revision not present in watch cache.
2023-07-12 17:26:17 +02:00
Amine
0695853a30 Improve naming and code comments 2023-07-12 16:20:14 +01:00