408 Commits

Author SHA1 Message Date
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
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
Natasha Sarkar
8a20e90839 [FG:InPlacePodVerticalScaling] Drop 'Proposed' resize status 2025-03-10 20:46:02 +00:00
Dan Winship
7316d83137 Add warnings to all IP/CIDR-valued fields 2025-03-07 11:00:11 -05:00
Natasha Sarkar
bb3ba9d073 Preserve old observedGen if incoming attempts to clear it 2025-03-06 20:14:46 +00:00
Natasha Sarkar
abdc760ba5 call dropDisabledPodFields from pod status strategy 2025-03-06 17:05:36 +00:00
Natasha Sarkar
f91105a77e fix prep and validation for pod subresource updates 2025-02-28 16:51:10 +00:00
Natasha Sarkar
d02401dea9 start setting pod metadata.generation 2025-02-24 16:22:14 +00:00
Kubernetes Prow Robot
7a8a4c201a Merge pull request #129933 from serathius/deprecate-namespace-index
Disable StorageNamespaceIndex feature gate when BtreeWatchCache enabled and deprecate it
2025-02-11 06:29:59 -08:00
Marek Siarkowicz
b1ad53c533 Disable StorageNamespaceIndex feature gate when BtreeWatchCache is enabled and deprecate it
Previously, the cache used a map keyed by the full object key,
requiring iteration and filtering by namespace for namespace-scoped requests.
This index allowed for faster responses by avoiding this iteration.

With the introduction of the BtreeWatchCache, this optimization is no longer necessary.
The B-tree structure allows efficient prefix-based searches,
including fetching objects by namespace.
Furthermore, the B-tree returns elements ordered by key, eliminating the need for separate sorting.

Performance improvements with the BtreeWatchCache have been validated through benchmarks matching K8s scalability dimentions (see table below).
These results demonstrate that the B-tree approach provides comparable or better performance than the map with index.
Therefore, the StorageNamespaceIndex feature flag can be safely flipped to false and subsequently deprecated.

| Benchmark                                                                         | Btree with Index (current) | Btree without Index    | Map with Index         | Map without Index (sanity check) |
| --------------------------------------------------------------------------------- | -------------------------- | ---------------------- | ---------------------- | -------------------------------- |
| StoreList (10k Namespaces, 150k Pods, 5k Nodes, RV=, Namespace Scope)             | 20.77µs ± 10%              | 20.14µs ± 13% (~0%)    | 19.73µs ± 6% (~0%)     | 1067.34µs ± 10% (+5037.73%)      |
| StoreList (10k Namespaces, 150k Pods, 5k Nodes, RV=NotOlderThan, Namespace Scope) | 3.943µs ± 6%               | 3.928µs ± 6% (~0%)     | 3.665µs ± 3% (-7.05%)  | 944.641µs ± 1% (+23857.41%)      |
| StoreList (50 Namespaces, 150k Pods, 5k Nodes, RV=, Namespace Scope)              | 303.3µs ± 2%               | 258.2µs ± 2% (-14.85%) | 340.1µs ± 3% (+12.15%) | 1668.6µs ± 4% (+450.23%)         |
| StoreList (50 Namespaces, 150k Pods, 5k Nodes, RV=NotOlderThan, Namespace Scope)  | 286.2µs ± 3%               | 234.7µs ± 1% (-17.99%) | 326.9µs ± 2% (+14.22%) | 1347.7µs ± 4% (+370.91%)         |
| StoreList (100 Namespaces, 110k Pods, 1k Nodes, RV=, Namespace Scope)             | 125.3µs ± 2%               | 112.3µs ± 5% (-10.38%) | 137.5µs ± 2% (+9.81%)  | 1395.1µs ± 8% (+1013.78%)        |
| StoreList (100 Namespaces, 110k Pods, 1k Nodes, RV=NotOlderThan, Namespace Scope) | 120.6µs ± 2%               | 113.2µs ± 1% (-6.13%)  | 133.8µs ± 1% (+10.92%) | 1719.1µs ± 5% (+1325.35%)        |
| Geometric Mean                                                                    | 68.94µs                    | 62.73µs (-9.02%)       | 72.72µs (+5.48%)       | 1.326ms (+1823.40%)              |
2025-02-05 10:49:22 +01:00
vivzbansal
242dec3e34 Updated some unit tests and resolved some review comments 2025-01-27 19:46:54 +00:00
vivzbansal
8fa8277908 Added some unit tests 2025-01-27 19:46:54 +00:00
vivzbansal
1cf4587277 Fix build error 2025-01-27 19:42:14 +00:00
vivzbansal
591b0f547a Fix issue of pod spec mismatch if there is any non-restarble init container present 2025-01-27 19:42:13 +00:00
vivzbansal
3885d2f8ab Added sidecar support in ValidatePodResize and dropNonResizeUpdates 2025-01-27 19:42:13 +00:00
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Kevin Hannon
3d08c10c8a fix PodLogsQuerySplitStream if feature is enabled and using defaults 2024-11-08 22:32:30 -05:00
Abu Kashem
b6773f1589 api: add a new field to meta/v1 DeleteOptions
- add a new boolean field
  IgnoreStoreReadErrorWithClusterBreakingPotential to meta/v1 DeleteOptions

- add validation for the new delete option
add validation for the new field in the delete options
ignoreStoreReadErrorWithClusterBreakingPotential

- prevent the pod eviction handler from issuing an unsafe pod delete
prevent the pod eviction handler from enabling the
'ignoreStoreReadErrorWithClusterBreakingPotential' delete option
2024-11-07 15:12:56 -05:00
Kubernetes Prow Robot
9660e5c4cd Merge pull request #127360 from knight42/feat/split-stdout-stderr-server-side
API: add a new `Stream` field to `PodLogOptions`
2024-11-07 19:44:45 +00:00
Kevin Hannon
350b0d2b93 Revert "Graduate PodLifecycleSleepAction to GA" 2024-11-06 16:29:19 -05:00
Jian Zeng
d9687a8c3a feat(apiserver): set stream param in LogLocation
Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2024-11-06 22:42:18 +08:00
Anish Shah
e55bf09ca5 Fix unit tests 2024-11-06 01:33:16 +00:00
Anish Shah
832d7f7dc2 apply feedback 2024-11-06 01:33:15 +00:00
Anish Shah
4c69bf2496 implement GetResetFieldsFilter
GetResetFieldsFilter returns a set of fields filter reset
by pod resize strategy. This is needed to make server-side apply
work correctly.
2024-11-06 01:33:15 +00:00
Anish Shah
3b91edb660 unit tests to ensure pod metadata cannot be updated during resize. 2024-11-06 01:33:15 +00:00
Anish Shah
07ca0b09bb refactor logic to override pod fields 2024-11-06 01:33:14 +00:00
Anish Shah
878c54fc9a test: add unit tests to verify the .status.resize field 2024-11-06 01:33:14 +00:00
Anish Shah
2bf1f2349c validate resize request
We validate resize request by ensuring that pod QoS is unchanged and
only cpu and memory resources and resize policies are mutated.
2024-11-06 01:33:14 +00:00
Anish Shah
8f967c19b3 drop unrelated changes for /resize request
Since resize request takes the full pod object as the request type, drop
any unrelated changes. Only container resources and resize policy should
be validated.
2024-11-06 01:33:13 +00:00
Anish Shah
507ce443b0 introduce resize REST object
This commit introduces a basic REST object for resize subresource and
adds it to the pod storage.
2024-11-06 01:33:13 +00:00
Kubernetes Prow Robot
9fe41b6198 Merge pull request #128046 from AxeZhan/ga3960
Graduate PodLifecycleSleepAction to GA
2024-11-04 22:09:35 +00:00
AxeZhan
200a61b6b9 Graduate PodLifecycleSleepAction to GA 2024-11-02 11:05:36 +08:00
carlory
9cb7d58b3c Tighten validation on the qosClass field of pod status 2024-11-01 10:36:03 +08:00
Abu Kashem
bc0ea34bc3 refactor: add delete options for Delete method in storage interface 2024-10-08 10:45:15 -04:00
Kubernetes Prow Robot
7590cb7adf Merge pull request #125257 from vinayakankugoyal/armor
KEP-24: Update AppArmor feature gates to GA stage.
2024-07-23 09:20:52 -07:00
Kubernetes Prow Robot
5d40866fae Merge pull request #125994 from carlory/fix-job-api
clean up codes after PodDisruptionConditions was promoted to GA
2024-07-17 14:37:09 -07:00
Vinayak Goyal
bc06071495 Update AppArmor feature gates to GA stage.
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
2024-07-15 23:29:37 +00:00
Kubernetes Prow Robot
2d4514e169 Merge pull request #125802 from mmorel-35/testifylint/len+empty
fix: enable empty and len rules from testifylint on pkg and staging package
2024-07-11 23:12:06 -07:00
carlory
850bc09e9b clean up codes after PodDisruptionConditions was promoted to GA and locked to default 2024-07-11 10:40:21 +08:00
Kubernetes Prow Robot
4a214f6ad9 Merge pull request #125461 from mimowo/pod-disruption-conditions-ga
Graduate PodDisruptionConditions to stable
2024-07-09 11:08:13 -07:00
Matthieu MOREL
f014b754fb fix: enable empty and len rules from testifylint on pkg package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
2024-07-06 23:15:43 +00:00
Michael Fraenkel
a7264f95ff pod terminationGracePeriodSeconds is always valid (#124461)
* Pod terminationGracePeriodSeconds is always valid

Validation of a pod spec will always use the pod's
TerminationGracePeriodSeconds value.

A set of pod test-helpers have been created to help construct Pods.

* remove unused func

* reduction

* reduce 2

* simplify test

* report invalid grace period

* update SupplementalGroupPolicy tests
2024-06-29 18:09:29 -07:00
Michal Wozniak
780191bea6 review remarks for graduating PodDisruptionConditions 2024-06-28 17:32:27 +02:00
Michal Wozniak
bf0c9885a4 Graduate PodDisruptionConditions to stable 2024-06-28 16:36:51 +02:00
Kubernetes Prow Robot
fb0195df11 Merge pull request #123428 from atiratree/UnhealthyPodEvictionPolicy-GA
promote PDBUnhealthyPodEvictionPolicy to GA
2024-06-25 21:56:20 -07:00
Filip Křepinský
68d34580e0 promote PDBUnhealthyPodEvictionPolicy to GA 2024-06-21 16:13:53 +02:00
Kubernetes Prow Robot
b616d91675 Merge pull request #122636 from lianghao208/pod_condition
kube-scheduler: fix empty lastTransitionTime in pod condition
2024-06-18 10:39:35 -07:00
Michal Wozniak
70f7c02bea Cleanup eviction tests to make linter happy 2024-06-12 11:26:37 +02:00
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
Lan Liang
78762c70db u 2024-04-15 09:24:44 +00:00