Commit Graph

22781 Commits

Author SHA1 Message Date
Patrick Ohly
1057407cee DRA e2e: more flexible socket listening
Instead of hard-coding two instances of the hostpathplugin which listen on
certain socket paths, the hostpathplugin now gets started through Pod exec as
needed. The advantage is that the helper code is in charge of socket naming,
just like it would be in real deployment.

One nuisance is that exec.StreamWithContext always complains in copyFromStdout
and copyFromStderr when the remote hostpathplugin gets killed via context
cancellation:

    E0312 11:56:31.637669  289446 v2.go:167] "Unhandled Error" err="next reader: read tcp [::1]:59006->[::1]:6444: use of closed network connection" logger="UnhandledError"
    E0312 11:56:31.637749  289446 v2.go:150] "Unhandled Error" err="next reader: read tcp [::1]:59006->[::1]:6444: use of closed network connection" logger="UnhandledError"

These can be ignored.
2025-03-14 16:46:15 +01:00
Patrick Ohly
ec12727957 DRA kubeletplugin: revise socket path handling
When supporting rolling updates, we cannot use the same fixed socket paths for
old and new pod. With the revised API, the caller no longer specifies the full
socket paths, only directories. The logic about how to name sockets then can be
in the helper.

While at it, avoid passing a context to the gRPC helper code when
all that the helper code needs is a logger. That leads to confusion
about whether cancellation has an effect.
2025-03-14 14:19:56 +01:00
Patrick Ohly
c6252daccb DRA kubeletplugin: turn helper into wrapper
The goal is to simplify writing DRA drivers. This is also a first step towards
supporting seamless upgrades.

DRA drivers no longer need to implement the kubelet plugin API
directly. Instead, the helper wraps an implementation of an interface. The
helper then provides common functionality:

- retrieve and validate ResourceClaims
- serialize gRPC calls (enabled by default, can be opted out)
- gRPC logging

The definition of that interface is meant to be comprehensive enough that a
correct DRA driver can be implemented by following the documentation of the
package, without having to cross-reference KEPs.

The DRAPlugin interface used to be the abstract API of the helper. Now it's
what the DRA driver kubelet plugin needs to implement. The helper is a concrete
Server struct with no exported fields. It only exports the methods that
drivers need when using the helper.

While at it, support for the v1alpha4 API gets removed from the helper, which
implies removing the corresponding E2E tests. The kubelet implementation will
be dropped separately.
2025-03-14 14:17:05 +01:00
Kubernetes Prow Robot
92d7e55abd Merge pull request #129886 from danwinship/endpointslice-api-notes
Try to clarify EndpointSlice semantics some more
2025-03-12 21:19:53 -07:00
Kubernetes Prow Robot
7b6c56e5fb Merge pull request #130135 from saschagrunert/image-volume-beta
[KEP-4639] Graduate image volume sources to beta
2025-03-12 18:03:58 -07:00
Kubernetes Prow Robot
2261137135 Merge pull request #122550 from danwinship/tighten-ip-validation
Tighten IP/CIDR validation
2025-03-12 15:57:46 -07:00
Kubernetes Prow Robot
6c3332e870 Merge pull request #130747 from soltysh/exec_context
kubectl: expose context parameter in DefaultRemoteExecutor
2025-03-12 13:36:10 -07:00
Kubernetes Prow Robot
69467d3547 Merge pull request #130648 from jpbetz/semver-tolerant
Enable Semver CEL library, add normalization support
2025-03-12 13:36:01 -07:00
Kubernetes Prow Robot
21f7eaa8e2 Merge pull request #130705 from aaron-prindle/validation-gen-add-metric-and-runtime-verification-upstream
[Declarative Validation] feat: add declarative validation metrics and associated runtime verification tests
2025-03-12 11:29:54 -07:00
Dan Winship
ad22c0d495 Fix IP/CIDR validation to allow updates to existing invalid objects
Ignore pre-existing bad IP/CIDR values in:
  - pod.spec.podIP(s)
  - pod.spec.hostIP(s)
  - service.spec.externalIPs
  - service.spec.clusterIP(s)
  - service.spec.loadBalancerSourceRanges (and corresponding annotation)
  - service.status.loadBalancer.ingress[].ip
  - endpoints.subsets
  - endpointslice.endpoints
  - networkpolicy.spec.{ingress[].from[],egress[].to[]}.ipBlock
  - ingress.status.loadBalancer.ingress[].ip

In the Endpoints and EndpointSlice case, if *any* endpoint IP is
changed, then the entire object must be valid; invalid IPs are only
allowed to remain in place for updates that don't change any IPs.
(e.g., changing the labels or annotations).

In most of the other cases, when the invalid IP is part of an array,
it can be moved around within the array without triggering
revalidation.
2025-03-12 12:41:32 -04:00
Maciej Szulik
78e58b8c49 kubectl: expose context parameter in DefaultRemoteExecutor
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-03-12 17:02:00 +01:00
Joe Betz
37ddc637f5 Revert PR 125102: Add unit tests to client-go/tools/cache/listers.go 2025-03-12 11:43:34 -04:00
Kubernetes Prow Robot
caf541857f Merge pull request #130673 from gauravkghildiyal/kep-4444-ga
Promote ServiceTrafficDistribution feature-gate to GA and update docs with latest descriptions
2025-03-12 08:23:47 -07:00
Dan Winship
692785d25b Add legacy versions of IsValidIP/IsValidCIDR
Add validation.IsValidIPForLegacyField and
validation.IsValidCIDRForLegacyField, which validate "legacy" IP/CIDR
fields correctly. Use them for all such fields (indirectly, via a
wrapper in pkg/apis/core/validation that handles the
StrictIPCIDRValidation feature gate correctly).

Change IsValidIP and IsValidCIDR to require strict parsing and
canonical form, and update the IPAddr, ServiceCIDR, and
NetworkDeviceData validation to make use of them.
2025-03-12 09:58:04 -04:00
Dan Winship
ba189de78f Slightly improve EndpointSlice address validation
Because it used both IsValidIPv4Address and ValidateEndpointIP,
EndpointSlice validation produced duplicate error messages when given
an invalid IP. Fix this by calling IsValidIP first, and only doing the
other checks if that one fails.

Also, since no one else was using the IsValidIPv4Address and
IsValidIPv6Address methods anyway, just inline them into the
EndpointSlice validation, so we don't have to worry about "should they
do legacy or strict validation" later.
2025-03-12 09:37:39 -04:00
Dan Winship
fc4bb4fdb9 Add validation.IsValidInterfaceAddress
Split "ifaddr"-style ("192.168.1.5/24") validation out of IsValidCIDR.
Since there is currently only one field that uses this format, and it
already requires canonical form, IsValidInterfaceAddress requires
canonical form unconditionally.
2025-03-12 09:37:39 -04:00
Kubernetes Prow Robot
e0ab1a16ad Merge pull request #128372 from aramase/aramase/f/kep_4412_alpha_impl
KSA token for Kubelet image credential providers alpha
2025-03-12 00:39:50 -07:00
Kubernetes Prow Robot
0b00454617 Merge pull request #125102 from 0xMALVEE/unit-tests-listers.go
Add unit tests to client-go/tools/cache/listers.go
2025-03-11 23:33:46 -07:00
Kubernetes Prow Robot
7d6700a532 Merge pull request #130739 from jpbetz/declarative-validation-test-infra
Introduce versioned validation test utilitizes and add fuzz tester
2025-03-11 21:37:53 -07:00
Kubernetes Prow Robot
c28e7ffe24 Merge pull request #130708 from fuweid/reduce-spans-in-writer
*: reduce tracing events during streaming JSON objects
2025-03-11 21:37:46 -07:00
Kubernetes Prow Robot
c7c0c62edb Merge pull request #130737 from aaron-prindle/validation-gen-rename-extra-arg-flag-upstream
[Declarative Validation] chore(validation-gen): rename flag --extra-pkg -> --readonly-pkg in validation-gen
2025-03-11 19:48:13 -07:00
Kubernetes Prow Robot
7edfb53f1f Merge pull request #130736 from siyuanfoundation/owner
Add approver permission for jpbetz in component-base/compatibility
2025-03-11 19:48:06 -07:00
Aaron Prindle
de904f8099 feat: add declarative validation metrics and associated runtime verification tests 2025-03-12 02:41:30 +00:00
Tim Hockin
1d365762a5 Introduce versioned validation test utilitizes and add fuzz tester
This makes a bold assumption: that the errors (count and basic content)
will be the same across versions.  If this turns out to be untrue, this
may need to get more sophisticated.  It should fail obviously when we
hit that edge.
2025-03-11 20:37:21 -04:00
Anish Ramasekar
dd7b9f6171 Add service account token and annotation to v1 CredentialProviderRequest
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 19:24:43 -05:00
Anish Ramasekar
ba2eecca0d Add TokenAttributes field to v1 CredentialProvider
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 19:24:39 -05:00
Kubernetes Prow Robot
1b6e321e23 Merge pull request #129407 from serathius/streaming-proto-list-encoder
Implement streaming proto list encoder
2025-03-11 17:11:45 -07:00
Wei Fu
003f215767 *: reduce tracing events during streaming JSON objects
If apiserver is handing heavy traffic volume, it's likely to trigger
tracing events. After streaming JSON objects, the number of tracing events
are same to object number. It's unneccessary to log each write call.
This patch is to reduce tracing events.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2025-03-11 19:02:31 -04:00
Kubernetes Prow Robot
f3a23cfe90 Merge pull request #130730 from jpbetz/minimum-tag
Add +k8s:minimum validation tag
2025-03-11 15:59:46 -07:00
Joe Betz
2d810ddfa9 Apply feedback 2025-03-11 18:10:28 -04:00
Siyuan Zhang
b9cb44a593 Add approver permission for jpbetz in component-base/compatibility
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2025-03-11 14:33:18 -07:00
Kubernetes Prow Robot
549b9117a7 Merge pull request #130716 from pacoxu/fix-bind-address-already-in-use
use diff port for TestCreateConfigWithoutWebHooks from TestCreateConfig
2025-03-11 14:05:47 -07:00
Marek Siarkowicz
f5dd7107f7 Implement streaming proto encoding 2025-03-11 21:49:50 +01:00
Tim Hockin
d6ef05b9a8 Add +k8s:minimum validation tag 2025-03-11 16:47:05 -04:00
Kubernetes Prow Robot
309c4c17fb Merge pull request #128499 from stlaz/ctb_betav1
ClusterTrustBundles - move to beta
2025-03-11 12:47:45 -07:00
Aaron Prindle
cfcf7e93a3 chore(validation-gen): rename flag --extra-pkg -> --readonly-pkg in validation-gen 2025-03-11 19:17:48 +00:00
Aaron Prindle
cd9df2f115 chore: change error_matcher.go to use test interface instead of importing testing pkg 2025-03-11 18:15:50 +00:00
Stanislav Láznička
ccd2d4d62a generate code 2025-03-11 18:07:26 +01:00
Stanislav Láznička
e0f536bf1f use the ClusterTrustBundles beta API 2025-03-11 18:07:24 +01:00
Kubernetes Prow Robot
67e1a1ebbb Merge pull request #130626 from BenTheElder/sort-client-gen
sort client-gen output
2025-03-11 09:49:53 -07:00
Kubernetes Prow Robot
07d66d9c26 Merge pull request #130574 from natasha41575/drop_proposed_resize_status
[FG:InPlacePodVerticalScaling] Drop `Proposed` resize status
2025-03-11 09:49:46 -07:00
Stanislav Láznička
f598b4860c copy ClusterTrustBundle API to v1beta1 2025-03-11 17:39:07 +01:00
Sascha Grunert
f9e5dd84ad Graduate image volume sources to beta
Graduate the feature to beta, by:

- Allowing `subPath`/`subPathExpr` for image volumes
- Modifying the CRI to pass down the (resolved) sub path
- Adding metrics which are outlined in the KEP

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-03-11 13:41:45 +01:00
Kubernetes Prow Robot
4c311c9fcf Merge pull request #130475 from serathius/watchcache-consistency
Implement consistency checking
2025-03-11 05:09:46 -07:00
Paco Xu
63cd30e3f6 use diff port for TestCreateConfigWithoutWebHooks from TestCreateConfig 2025-03-11 18:23:58 +08:00
Marek Siarkowicz
e4d73c56cd Implement consistency checking 2025-03-11 10:17:23 +01:00
Kubernetes Prow Robot
1177529fa2 Merge pull request #130706 from jpbetz/handle-optional-value-types-with-defaults
Declarative validation: Add default + optional handling
2025-03-11 00:11:54 -07:00
Kubernetes Prow Robot
3782b558a2 Merge pull request #128786 from danwinship/bad-ip-warnings
warn on bad IPs in objects
2025-03-11 00:11:47 -07:00
Kubernetes Prow Robot
8f97ac7fcf Merge pull request #130530 from pacoxu/v1.33-fg-cleanup
v1.33 feature gate cleanup
2025-03-10 23:03:46 -07:00
Tim Hockin
92aeb63a5b Handle optional value-types with defaults 2025-03-10 23:10:17 -04:00