Commit Graph

4493 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
49c20d6f44 Merge pull request #132173 from dejanzele/feat/promote-job-pod-replacement-policy-ga
KEP-3939: Job Pod Replacement Policy; promote to GA
2025-06-24 07:04:28 -07:00
Kubernetes Prow Robot
3e39d1074f Merge pull request #132221 from dims/new-cmp-diff-impl
New implementation for `Diff` (drop in replacement for `cmp.Diff`)
2025-06-16 18:02:58 -07:00
Davanum Srinivas
03afe6471b Add a replacement for cmp.Diff using json+go-difflib
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-06-16 17:10:42 -04:00
Kubernetes Prow Robot
354520cd9b Merge pull request #131354 from tomoish/fix-netpol-podselector-doc
Fix: Clarify optional podSelector in NetworkPolicy docs and schema
2025-06-16 10:12:59 -07:00
Dejan Zele Pejchev
bccc9fe470 KEP-3939: Job Pod Replacement Policy; promote to GA
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
2025-06-16 16:26:03 +02:00
tomoish
7a95f3e478 Fix NetworkPolicy podSelector comments
Clarify that podSelector is optional and defaults to an empty selector,
matching all pods.
Replace “ingress rules” with “rules” to reflect both directions.

Update podSelector descriptions in NetworkPolicy documentation for clarity
2025-06-16 00:11:48 +09:00
Kubernetes Prow Robot
bb639c3dc7 Merge pull request #132313 from thockin/jp_invalid_ne_type_invalid
Use "Invalid" errors rather than "TypeInvalid"
2025-06-15 04:23:03 -07:00
Tim Hockin
384240b4d9 Use "Invalid" errors rather than "TypeInvalid" 2025-06-14 17:50:38 -07:00
Kubernetes Prow Robot
7e94ec9eac Merge pull request #132000 from pohly/dra-api-alpha3-removal
DRA API: remove obsolete types from v1alpha3
2025-06-12 09:39:12 -07:00
Kubernetes Prow Robot
d2af3329e9 Merge pull request #131214 from carlory/remove-unneeded-code
cleanup unneeded code
2025-06-12 09:39:04 -07:00
Kubernetes Prow Robot
158fce12ba Merge pull request #132236 from yongruilin/master_vg_ratcheting-default
feat(validation-gen): add default validation ratcheting support
2025-06-11 22:15:01 -07:00
Kubernetes Prow Robot
bf84dd0cc9 Merge pull request #132127 from danwinship/kep-3015-to-beta
KEP-3015: PreferSameTrafficDistribution to Beta
2025-06-11 22:14:54 -07:00
yongruilin
1574001a1c run update-codegen.sh 2025-06-11 23:44:52 +00:00
Kubernetes Prow Robot
4db16edaa8 Merge pull request #132054 from HirazawaUi/promote-4369-to-ga
[KEP-4369]: Graduate RelaxedEnvironmentVariableValidation to GA
2025-06-10 11:19:02 -07:00
Dan Winship
dacafec88c KEP-3015: PreferSameTrafficDistribution to Beta 2025-06-10 08:46:34 -04:00
HirazawaUi
0ca9c380ad update all api files 2025-06-08 12:00:14 +08:00
Patrick Ohly
10de6780cf DRA API: remove obsolete types from v1alpha3
The v1alpha3 version is still needed for DeviceTaintRule, but the rest of the
types and most structs became obsolete in v1.32 when we introduced v1beta1 and
bumped the storage version to v1beta1.

Removing them now simplifies adding new features because new fields don't need
to be added to these obsolete types. This could have been done already in 1.33,
but wasn't to minimize disrupting on-going work.
2025-06-06 12:06:28 +02:00
Rita Zhang
5058e385b0 DRAAdminAccess: update label key
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2025-05-27 21:19:25 -07:00
Joe Betz
1d17ca9b7e generate code 2025-05-24 00:03:35 -04:00
Joe Betz
7dc8660d03 Update testing to fully track subresources 2025-05-23 21:47:08 -04:00
Joe Betz
030b4ab9cc Add declarative validation testing to Scale.spec.replicas 2025-05-23 21:47:07 -04:00
Joe Betz
8c5c5fb761 Add origin and use apivalidation.ValidateNonnegativeField for Scale.spec.replicas validation.
This does not change the resulting errors but it makes declarative validation testing easier.
2025-05-23 21:47:07 -04:00
Joe Betz
d0f6fe30bf Add k8s:minimum validation to Scale.spec.replicas
This applies to all group version kinds of Scale.  Validation-gen must be enabled for all at the
same time since our testing checks that cross-GV declarative validation to matches.
2025-05-23 21:47:07 -04:00
Joe Betz
ffb4e003f7 Enable validation-gen for scale group-versions
This adds declarative validation for all all versioned types of Scale
since our testing uses apitesting.VerifyVersionedValidationEquivalence,
will fail if we don't convert them all at the same time.
2025-05-23 21:47:06 -04:00
Kubernetes Prow Robot
889cd833a2 Merge pull request #131844 from pohly/dra-no-static-pods
DRA node: reject static pods which reference ResourceClaims
2025-05-20 07:07:24 -07:00
Kubernetes Prow Robot
fbd474a286 Merge pull request #131644 from Uladzislau97/taint-time-added
Remove misleading comment from NodeTaint TimeAdded field
2025-05-13 15:53:26 -07:00
Kubernetes Prow Robot
c96032addd Merge pull request #131318 from aojea/lock_servicecidr
Lock MultiCIDRServiceAllocator to default and DisableAllocatorDualWrite to GA
2025-05-13 09:51:28 -07:00
Vlad Vasilyeu
c4d6fcb197 Remove misleading comment from NodeTaint TimeAdded field 2025-05-13 15:35:21 +00:00
Keita Mochizuki
a3097010fa Change the implementation design of matchLabelKeys in PodTopologySpread to be aligned with PodAffinity (#129874)
* Change the implementation design of matchLabelKeys in PodTopologySpread to be aligned with PodAffinity

* fix1
2025-05-07 13:01:15 -07:00
Antonio Ojea
15ab88f88b remove networking v1alpha1 and make update 2025-05-06 13:29:54 +00:00
Joe Betz
d2fa246b06 Update codegen 2025-05-06 09:00:38 -04:00
Joe Betz
164fefa948 Update codegen 2025-05-05 22:06:59 -04:00
Patrick Ohly
1ec7231f63 DRA node: reject static pods which reference ResourceClaims
If someone gains the ability to create static pods, they might try to use that
ability to run code which gets access to the resources associated with some
existing claim which was previously allocated for some other pod. Such an
attempt already fails because the claim status tracks which pods are allowed to
use the claim, the static pod is not in that list, the node is not authorized
to add it, and the kubelet checks that list before starting the pod in
195803cde5/pkg/kubelet/cm/dra/manager.go (L218-L222).

Even if the pod were started, DRA drivers typically manage node-local resources
which can already be accessed via such an attack without involving DRA. DRA
drivers which manage non-node-local resources have to consider access by a
compromised node as part of their threat model.

Nonetheless, it is better to not accept static pods which reference
ResourceClaims or ResourceClaimTemplates in the first place because there
is no valid use case for it.

This is done at different levels for defense in depth:
- configuration validation in the kubelet
- admission checking of node restrictions
- API validation

Co-authored-by: Jordan Liggitt <liggitt@google.com>

Code changes by Jordan, with one small change (resourceClaims -> resourceclaims).
Unit tests by Patrick.
2025-05-05 14:21:25 +02:00
Kubernetes Prow Robot
0b8133816b Merge pull request #131477 from pohly/golangci-lint@v2
golangci-lint v2
2025-05-02 23:03:55 -07:00
jayson wang
49f765e2b3 Remove redundant Required validation for IngressRules 2025-05-02 20:56:29 +08:00
Matthieu MOREL
4adb58565c chore: bump golangci-lint to v2
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-02 12:51:02 +02:00
carlory
c6f652d5fe Refactor pod failure policy defaults 2025-04-29 14:58:57 +08:00
Kubernetes Prow Robot
595516a149 Merge pull request #130468 from jingyuanliang/PodAntiAffinity
fix: comment on preferred PodAntiAffinity
2025-04-24 12:00:34 -07:00
Kubernetes Prow Robot
93cc525932 Merge pull request #131333 from tenzen-y/fix-successpolicy-api-comment
Job: Fix API comments for SuccessCriteriaMet
2025-04-23 18:20:58 -07:00
Kubernetes Prow Robot
aa9e98805c Merge pull request #131256 from mimowo/job-improve-backoff-docs
Improve Job API comment for the backoffLimit
2025-04-23 17:09:58 -07:00
Kubernetes Prow Robot
a9c75b0da8 Merge pull request #131213 from carlory/fix-131045
Fix the allocatedResourceStatuses Field name mismatch in PVC status validation
2025-04-23 17:09:06 -07:00
Luca Lanziani
2ea6892077 Always check for Immutable selector in Deployment Replicaset Daemonset (#131017)
* Always for Immutable selector in Deployment Replicaset Daemonset

With extensions/v1beta1 removed there is no need of a special case
to check for Spec.Selector immutability.

The ValidateImmutableField is now moved into the
Validate[Resource]Update method, tests for v1beta1 are removed and test
for v1 are added.

Validation tests were updated to reflect the changes,
mostly decoupling other fields changes from selectors and creating a
dedicated case to test selector immutability.

* Move validation inside appropriate function

* Fix validation tests
2025-04-23 15:58:37 -07:00
Yuki Iwai
db1e107150 Job: Fix API comments for SuccessCriteriaMet
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2025-04-17 00:42:26 +09:00
Antonio Ojea
0266d3bcb3 Allow single-to-dual-stack reconfiguration for ServiceCIDR
This change modifies the validation logic for ServiceCIDR updates
(`ValidateServiceCIDRUpdate`) to specifically permit upgrading a
single-stack ServiceCIDR (either IPv4 or IPv6) to a dual-stack
configuration.

This reconfiguration path is considered safe because it only involves adding
a new CIDR range without altering the existing primary CIDR. This
ensures that existing Service IP allocations are not disrupted.

Other modifications, such as:
- Downgrading from dual-stack to single-stack
- Reordering CIDRs in a dual-stack configuration
- Changing the primary CIDR during a single-to-dual-stack
  reconfiguration

remain disallowed by the validation. These operations carry a higher
risk of breaking existing Services or cluster networking
configurations. Preventing these updates automatically encourages
administrators to perform such changes manually after carefully
assessing the potential impact on their specific cluster environment.
The validation errors and controller logs provide guidance when such
disallowed changes are attempted.

Change-Id: I41dc09dfddb05f277925da2262f8114d6accbd1d
2025-04-14 17:05:44 +00:00
Michal Wozniak
8f1326251c Improve Job API comment for the backoffLimit 2025-04-14 09:51:51 +02:00
carlory
16f4a5c4ea cleanup unneed code 2025-04-09 17:04:20 +08:00
carlory
88fbccd698 Fix the allocatedResourceStatuses Field name mismatch in PVC status validation 2025-04-09 16:21:38 +08:00
Filip Křepinský
8db1426554 rename DeploymentPodReplacementPolicy FG to DeploymentReplicaSetTerminatingReplicas 2025-03-27 20:27:44 +01:00
Kubernetes Prow Robot
070f0ad3bd Merge pull request #129970 from mortent/AddResourceV1beta2API
Add resource v1beta2 API
2025-03-26 09:10:47 -07:00
Morten Torkildsen
e761be47a4 Run make update 2025-03-26 14:52:36 +00:00