Commit Graph

126703 Commits

Author SHA1 Message Date
Tim Allclair
d37634a930 Fixup linting 2024-11-01 14:02:58 -07:00
Tim Allclair
45b1104878 Fix resize E2E tests 2024-11-01 14:02:58 -07:00
Tim Allclair
32e6eac753 Fix clearing pod resize status 2024-11-01 14:02:58 -07:00
Tim Allclair
81df195819 Stop using status.AllocatedResources to aggregate resources 2024-11-01 14:02:58 -07:00
Tim Allclair
61c1beeda2 Always set status Resources, default to allocated 2024-11-01 14:02:58 -07:00
Tim Allclair
0f0e27d226 Move container status AllocatedResources behind a separate feature gate 2024-11-01 14:02:58 -07:00
Kubernetes Prow Robot
3f5d0ee2cf
Merge pull request #128497 from benluddy/cbor-request-contenttype-circuit-breaker
KEP-4222: Fall back to JSON request encoding after CBOR 415.
2024-11-01 20:05:34 +00:00
Kubernetes Prow Robot
b845968421
Merge pull request #128344 from kannon92/revert-128333-eviction-manager
Allow for container fs and image fs to be on the same drive but in a different partition
2024-11-01 20:05:27 +00:00
Kubernetes Prow Robot
f8e64e1d6e
Merge pull request #128219 from carlory/fix-127520-128126
kubelet: Fix the volume manager didn't check the device mount state in the actual state of the world before marking the volume as detached
2024-11-01 18:55:34 +00:00
Kubernetes Prow Robot
1a7326902f
Merge pull request #127743 from googs1025/cleanup/leaderelection
chore(leader-election): modify leader-election comment to OnStoppedLeading callback is always called when the LeaderElector exits, even if it did not start leading.
2024-11-01 18:55:27 +00:00
Kubernetes Prow Robot
ca797af2af
Merge pull request #128491 from benluddy/cbor-dynamic-watch
KEP-4222: Add integration test for  CBOR-enabled dynamic client watches.
2024-11-01 17:05:26 +00:00
Ben Luddy
1745dfdd15
Fall back to JSON request encoding after CBOR 415.
If a client is configured to encode request bodies to CBOR, but the server does not support CBOR,
the server will respond with HTTP 415 (Unsupported Media Type). By feeding this response back to the
RESTClient, subsequent requests can fall back to JSON, which is assumed to be acceptable.
2024-11-01 12:54:04 -04:00
Ben Luddy
faf07915e1
Add integration test for CBOR-enabled dynamic client watches. 2024-11-01 12:03:30 -04:00
Davanum Srinivas
d450b6e653
Drop go-colortext and its usage
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-11-01 11:55:53 -04:00
Kubernetes Prow Robot
88a997ac01
Merge pull request #128481 from carlory/dependencies-ginkgo-gomega
dependencies: ginkgo v2.21.0, gomega v1.35.1
2024-11-01 15:53:26 +00:00
Davanum Srinivas
f74d6bc86b
Remove incorrect usage of golang.org/x/net/context
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-11-01 09:32:39 -04:00
Kubernetes Prow Robot
1a16c2d578
Merge pull request #128487 from neolit123/1.32-fix-get-node-from-ssr-bug
kubeadm: ensure proper parsing of SSR username
2024-11-01 12:47:25 +00:00
Kevin Hannon
48dc7d3267 add TODO for image fs 2024-11-01 08:46:55 -04:00
Patrick Ohly
6f07fa3a5e DRA scheduler: update some stale comments 2024-11-01 13:23:42 +01:00
Patrick Ohly
ae6b5522ea DRA scheduler: rename variable
"Allocated devices" are the ones which can be observed from the informer. "All
allocated devices" also includes those which are in flight and haven't been
written back to the apiserver.
2024-11-01 13:23:42 +01:00
Patrick Ohly
0130ebba1d DRA scheduler: refactor "allocated devices" lookup
The logic for skipping "admin access" was repeated in three different places. A
single foreachAllocatedDevices with a callback puts it into one function.
2024-11-01 13:23:28 +01:00
Patrick Ohly
bd7ff9c4c7 DRA scheduler: update some log strings 2024-11-01 13:23:11 +01:00
Patrick Ohly
bc55e82621 DRA scheduler: maintain a set of allocated device IDs
Reacting to events from the informer cache (indirectly, through the assume
cache) is more efficient than repeatedly listing it's content and then
converting to IDs with unique strings.

    goos: linux
    goarch: amd64
    pkg: k8s.io/kubernetes/test/integration/scheduler_perf
    cpu: Intel(R) Core(TM) i9-7980XE CPU @ 2.60GHz
                                                                                       │            before            │                        after                        │
                                                                                       │ SchedulingThroughput/Average │ SchedulingThroughput/Average  vs base               │
    PerfScheduling/SchedulingWithResourceClaimTemplateStructured/5000pods_500nodes-36                      54.70 ± 6%                     76.81 ± 6%  +40.42% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_100nodes-36                     106.4 ± 4%                     105.6 ± 2%        ~ (p=0.413 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_500nodes-36                     120.0 ± 4%                     118.9 ± 7%        ~ (p=0.117 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_100nodes-36                      112.5 ± 4%                     105.9 ± 4%   -5.87% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_500nodes-36                      87.13 ± 4%                    123.55 ± 4%  +41.80% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_100nodes-36                      113.4 ± 2%                     103.3 ± 2%   -8.95% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_500nodes-36                      65.55 ± 3%                    121.30 ± 3%  +85.05% (p=0.002 n=6)
    geomean                                                                                                90.81                          106.8       +17.57%
2024-11-01 13:23:06 +01:00
Patrick Ohly
f0efb8a5fd DRA scheduler: populate set of allocated devices only once
The devices which are allocated before starting the allocation always remain
allocated. They can be stored once in a set, then each Filter call for the
different nodes can reuse that set instead of allocating it anew for each node.

    goos: linux
    goarch: amd64
    pkg: k8s.io/kubernetes/test/integration/scheduler_perf
    cpu: Intel(R) Core(TM) i9-7980XE CPU @ 2.60GHz
                                                                                       │            before            │                        after                         │
                                                                                       │ SchedulingThroughput/Average │ SchedulingThroughput/Average  vs base                │
    PerfScheduling/SchedulingWithResourceClaimTemplateStructured/5000pods_500nodes-36                      36.89 ± 2%                     54.70 ± 6%   +48.26% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_100nodes-36                     105.7 ± 5%                     106.4 ± 4%         ~ (p=0.970 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_500nodes-36                     117.8 ± 3%                     120.0 ± 4%         ~ (p=0.134 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_100nodes-36                      119.5 ± 4%                     112.5 ± 4%    -5.86% (p=0.009 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_500nodes-36                      63.22 ± 2%                     87.13 ± 4%   +37.82% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_100nodes-36                      109.5 ± 2%                     113.4 ± 2%    +3.65% (p=0.006 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_500nodes-36                      27.56 ± 5%                     65.55 ± 3%  +137.84% (p=0.002 n=6)
    geomean                                                                                                72.44                          90.81        +25.37%
2024-11-01 13:22:14 +01:00
Patrick Ohly
f070dd760c DRA scheduler: also pre-compute the unique ResourceSlice.NodeName
Converting a node's name once to a unique string and then converting to many
unique names is faster than memory comparisons.

    goos: linux
    goarch: amd64
    pkg: k8s.io/kubernetes/test/integration/scheduler_perf
    cpu: Intel(R) Core(TM) i9-7980XE CPU @ 2.60GHz
                                                                                       │            before            │                       after                        │
                                                                                       │ SchedulingThroughput/Average │ SchedulingThroughput/Average  vs base              │
    PerfScheduling/SchedulingWithResourceClaimTemplateStructured/5000pods_500nodes-36                      36.65 ± 2%                     36.89 ± 2%       ~ (p=0.452 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_100nodes-36                     106.7 ± 3%                     105.7 ± 5%       ~ (p=0.701 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_500nodes-36                     119.7 ± 3%                     117.8 ± 3%       ~ (p=0.084 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_100nodes-36                      121.1 ± 4%                     119.5 ± 4%       ~ (p=0.297 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_500nodes-36                      63.72 ± 3%                     63.22 ± 2%       ~ (p=0.485 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_100nodes-36                      110.2 ± 2%                     109.5 ± 2%       ~ (p=0.258 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_500nodes-36                      28.16 ± 5%                     27.56 ± 5%       ~ (p=0.513 n=6)
    geomean                                                                                                73.15                          72.44       -0.98%
2024-11-01 13:21:59 +01:00
Patrick Ohly
814c9428fd DRA scheduler: cache compiled CEL expressions
DeviceClasses and different requests are very likely to contain the same
expression string. We don't need to compile that over and over again.

To avoid hanging onto that cache longer than necessary, it's currently tied to
each PreFilter/Filter combination. It might make sense to move this up into the
scheduler plugin and thus reuse compiled expressions for different pods.

    goos: linux
    goarch: amd64
    pkg: k8s.io/kubernetes/test/integration/scheduler_perf
    cpu: Intel(R) Core(TM) i9-7980XE CPU @ 2.60GHz
                                                                                       │            before            │                        after                        │
                                                                                       │ SchedulingThroughput/Average │ SchedulingThroughput/Average  vs base               │
    PerfScheduling/SchedulingWithResourceClaimTemplateStructured/5000pods_500nodes-36                      33.95 ± 4%                     36.65 ± 2%   +7.95% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_100nodes-36                     105.8 ± 2%                     106.7 ± 3%        ~ (p=0.177 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_500nodes-36                     100.7 ± 1%                     119.7 ± 3%  +18.82% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_100nodes-36                      90.78 ± 1%                    121.10 ± 4%  +33.40% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_500nodes-36                      50.51 ± 7%                     63.72 ± 3%  +26.17% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_100nodes-36                      103.7 ± 5%                     110.2 ± 2%   +6.32% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_500nodes-36                      28.50 ± 2%                     28.16 ± 5%        ~ (p=0.102 n=6)
    geomean                                                                                                64.99                          73.15       +12.56%
2024-11-01 13:20:06 +01:00
Patrick Ohly
941d17b3b8 DRA scheduler: code cleanups
Looking up the slice can be avoided by storing it when allocating a device.
The AllocationResult struct is small enough that it can be copied by value.

    goos: linux
    goarch: amd64
    pkg: k8s.io/kubernetes/test/integration/scheduler_perf
    cpu: Intel(R) Core(TM) i9-7980XE CPU @ 2.60GHz
                                                                                       │            before            │                       after                        │
                                                                                       │ SchedulingThroughput/Average │ SchedulingThroughput/Average  vs base              │
    PerfScheduling/SchedulingWithResourceClaimTemplateStructured/5000pods_500nodes-36                      33.30 ± 2%                     33.95 ± 4%       ~ (p=0.288 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_100nodes-36                     105.3 ± 2%                     105.8 ± 2%       ~ (p=0.524 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_500nodes-36                     100.8 ± 1%                     100.7 ± 1%       ~ (p=0.738 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_100nodes-36                      90.96 ± 2%                     90.78 ± 1%       ~ (p=0.952 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_500nodes-36                      49.84 ± 4%                     50.51 ± 7%       ~ (p=0.485 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_100nodes-36                      103.8 ± 1%                     103.7 ± 5%       ~ (p=0.582 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_500nodes-36                      27.21 ± 7%                     28.50 ± 2%       ~ (p=0.065 n=6)
    geomean                                                                                                64.26                          64.99       +1.14%
2024-11-01 13:19:51 +01:00
Patrick Ohly
1246898315 DRA scheduler: ResourceSlice with unique strings
Using unique strings instead of normal strings speeds up allocation with
structured parameters because maps that use those strings as key no longer need
to build hashes of the string content. However, care must be taken to call
unique.Make as little as possible because it is costly.

Pre-allocating the map of allocated devices reduces the need to grow the map
when adding devices.

    goos: linux
    goarch: amd64
    pkg: k8s.io/kubernetes/test/integration/scheduler_perf
    cpu: Intel(R) Core(TM) i9-7980XE CPU @ 2.60GHz
                                                                                       │            before            │                        after                         │
                                                                                       │ SchedulingThroughput/Average │ SchedulingThroughput/Average  vs base                │
    PerfScheduling/SchedulingWithResourceClaimTemplateStructured/5000pods_500nodes-36                     18.06 ±  2%                     33.30 ± 2%   +84.31% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_100nodes-36                    104.7 ±  2%                     105.3 ± 2%         ~ (p=0.818 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_500nodes-36                    96.62 ±  1%                    100.75 ± 1%    +4.28% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_100nodes-36                     83.00 ±  2%                     90.96 ± 2%    +9.59% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_500nodes-36                     32.45 ±  7%                     49.84 ± 4%   +53.60% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_100nodes-36                     95.22 ±  7%                    103.80 ± 1%    +9.00% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_500nodes-36                     9.111 ± 10%                    27.215 ± 7%  +198.69% (p=0.002 n=6)
    geomean                                                                                               45.86                           64.26        +40.12%
2024-11-01 13:19:48 +01:00
Jan Safranek
09afd667d7 Remove useless comment
seLinuxOptions are copied few lines below during `append()`
2024-11-01 12:46:39 +01:00
Jan Safranek
d7daa688c9 Collect SELinux options only when needed
Remove feature gate check from GetPodVolumeNames and collect SELinux
options only when it's really needed.
2024-11-01 12:46:39 +01:00
Jan Safranek
6e4504685f Fix access mode evaluation
Now that SELinuxMount can support volumes with any access modes, length of
the access modes does not need to be 1. That was requirement for RWOP
volumes only.
2024-11-01 12:46:39 +01:00
Jan Safranek
97b03e29b9 Document getSELinuxLabel function 2024-11-01 12:46:39 +01:00
Jan Safranek
53e5335d3c Add SELinuxMount tests 2024-11-01 12:46:39 +01:00
Jan Safranek
89da53cdeb Add SELinuxChangePolicy tests 2024-11-01 12:46:38 +01:00
Jan Safranek
db353e0485 Refactor AddPodToVolume unit tests with multiple pods
Refactor existing tests that run AddPodToVolume with multiple pods
to a table.
2024-11-01 12:46:38 +01:00
Jan Safranek
db3d995c2a Refactor AddPodToVolume unit tests with a single pod
Refactor existing tests that run AddPodToVolume with a single pod / volume
to a table. And add few extra tests, covering existing ReadWriteOncePod
functionality.
2024-11-01 12:46:38 +01:00
Jan Safranek
e4eedfe105 Refactor getSELinuxLabel
Return early and reduce indentation
2024-11-01 12:46:38 +01:00
Jan Safranek
8a400124f9 Use SELinuxChangePolicy 2024-11-01 12:46:38 +01:00
Jan Safranek
6ca7b959e4 Add SELinuxChangePolicy validation 2024-11-01 12:46:34 +01:00
Jan Safranek
3867cb40ad Regenerated API 2024-11-01 12:45:56 +01:00
Jan Safranek
c73308e90a Introduce SELinuxChangePolicy
Feature gate + the API
2024-11-01 12:45:56 +01:00
Patrick Ohly
7de6d070f2 DRA scheduler: avoid listing claims during Filter
The Allocate call used to call back into the claim lister for each node. This
was significant work which showed up at the top of the CPU profile. It's
okay to list only once during PreFilter because the Filter call does not change
the claim status between Allocate calls.

    goos: linux
    goarch: amd64
    pkg: k8s.io/kubernetes/test/integration/scheduler_perf
    cpu: Intel(R) Core(TM) i9-7980XE CPU @ 2.60GHz
                                                                                       │            before            │                        after                        │
                                                                                       │ SchedulingThroughput/Average │ SchedulingThroughput/Average  vs base               │
    PerfScheduling/SchedulingWithResourceClaimTemplateStructured/5000pods_500nodes-36                      15.04 ± 0%                    18.06 ±  2%  +20.07% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_100nodes-36                     105.5 ± 1%                    104.7 ±  2%        ~ (p=0.485 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/empty_500nodes-36                     95.83 ± 1%                    96.62 ±  1%        ~ (p=0.063 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_100nodes-36                      79.67 ± 3%                    83.00 ±  2%   +4.18% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/half_500nodes-36                      27.11 ± 5%                    32.45 ±  7%  +19.68% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_100nodes-36                      84.00 ± 3%                    95.22 ±  7%  +13.36% (p=0.002 n=6)
    PerfScheduling/SteadyStateClusterResourceClaimTemplateStructured/full_500nodes-36                      7.110 ± 6%                    9.111 ± 10%  +28.15% (p=0.002 n=6)
    geomean                                                                                                41.05                         45.86        +11.73%
2024-11-01 12:43:17 +01:00
Patrick Ohly
ad22b74c60 DRA scheduler: fix match attribute names in test
FullyQualifiedNames must include a domain. The current code doesn't care, but
once it does, the tests better should behave correctly.
2024-11-01 12:43:16 +01:00
Kubernetes Prow Robot
d87bf75c29
Merge pull request #128439 from oxxenix/migrate-security-components-to-contextual-logging
clustertrustbundle, token_manager: migrate to contextual logging
2024-11-01 11:17:25 +00:00
carlory
1335f203fe kubelet: Fix the volume manager did't check the device mount state in the actual state of the world before marking the volume as detached. It may cause a pod to be stuck in the Terminating state due to the above issue when it was deleted. 2024-11-01 18:51:33 +08:00
Lubomir I. Ivanov
fceb39ecd2 kubeadm: ensure proper parsing of SSR username
- Split the code that tries to get node name from SSR into
a new function getNodeNameFromSSR(). Unit test the function.
- Fix error that the "system:nodes:" prefix was not trimmed.
- Fix mislearding errors around FetchInitConfigurationFromCluster.
This function performs multiple actions, and the "get node"
action can also be of type apierrors.NotFound(). This creates
confusion in the returned error in enforceRequirement during
upgrade. Fix this problem.
2024-11-01 11:42:58 +02:00
Kubernetes Prow Robot
c4eea34dcf
Merge pull request #128293 from sebastiaanspeck/fix/kubeamd-typo
Fix typo for `kubeadm`
2024-11-01 09:15:26 +00:00
carlory
529ad9029d improve error message format for WaitForPodSuccessInNamespaceTimeout 2024-11-01 14:33:07 +08:00
carlory
f36042dc5c gomega forces Eventually to apply a default timeout even when a context is provided. 2024-11-01 11:37:04 +08:00
carlory
80b1a29786 dependencies: ginkgo v2.21.0, gomega v1.35.1 2024-11-01 11:35:24 +08:00