Commit Graph

11283 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
2a327f8e96 Merge pull request #117538 from TommyStarK/fix-flaky-test/TestGeneratePodSandboxConfig
kubelet/kuberuntime: Fix flaky test 'TestGeneratePodSandboxConfig'
2023-05-06 07:23:34 -07:00
Kubernetes Prow Robot
98d2dc9557 Merge pull request #117523 from sourcelliu/event
Fix potential mutex usage bug
2023-05-06 07:23:27 -07:00
RuquanZhao
936265e870 Add podUID in AddReference and DeleteReference
Signed-off-by: Ruquan Zhao <ruquan.zhao@arm.com>
2023-05-06 13:58:14 +08:00
Kubernetes Prow Robot
af92da5cb7 Merge pull request #117717 from saschagrunert/invalid-signature-error
Add support for CRI `ErrSignatureValidationFailed`
2023-05-05 10:39:25 -07:00
Gunju Kim
b249b4ca9b Promote ExpandedDNSConfig feature to the GA stage 2023-05-04 20:37:10 +09:00
Sascha Grunert
63b69dd50c Add support for CRI ErrSignatureValidationFailed
This allows container runtimes to propagate an image signature
verification error through the CRI and display that to the end user
during image pull. There is no other behavioral difference compared to a
regular image pull failure.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-05-04 08:34:11 +02:00
Kubernetes Prow Robot
d86b74b017 Merge pull request #116575 from claudiubelu/fixes-kuberuntime-unittests
unit tests: Fixes kuberuntime unittests for Windows
2023-05-03 13:48:42 -07:00
Kubernetes Prow Robot
59caf65fff Merge pull request #117136 from claudiubelu/unittest-kubelet-server-journal-boot
unittests: Fixes server journal unit test on Windows
2023-05-03 12:02:20 -07:00
Ian K. Coolidge
cede96336a Depend on k8s.io/utils cpuset
Steps performed:

$ find . -name '*.go' -exec sed -i
's|k8s.io/kubernetes/pkg/kubelet/cm/cpuset|k8s.io/utils/cpuset|g' {} \
$ ./hack/update-vendor.sh
$ ./hack/update-gofmt.sh
$ git rm -r pkg/kubelet/cm/cpuset/
2023-05-03 16:26:09 +00:00
Claudiu Belu
561548e86c unit tests: Fixes kuberuntime unittests for Windows
InPlace Pod Vertical Scaling has been introduced as a feature recently,
and with it new unit tests. The feature does not have Windows support
yet, thus, the unit tests fail on Windows.

Fixes unit test which checks Linux-specific fields on Windows.
2023-05-02 20:25:42 +00:00
kannon92
5f489a3327 feat: rename PodHasNetwork to PodReadyToStartContainers 2023-05-02 19:52:23 +00:00
Jongwoo Han
e51e5962d5 Use early return pattern to avoid nested conditions
Signed-off-by: jongwooo <jongwooo.han@gmail.com>
2023-05-03 02:27:26 +09:00
Kubernetes Prow Robot
2e78e07ee5 Merge pull request #117716 from thockin/validation_test_whitespace
Clean up brace whitespace in **/validation_test.go
2023-05-02 10:02:25 -07:00
Michal Wozniak
e1e38148bb Add DisruptionTarget condition when preempting for critical pod 2023-05-02 18:53:19 +02:00
Kubernetes Prow Robot
a2e2df61a1 Merge pull request #117198 from charles-chenzz/deprecated_function
replace ioutil with os, update doc in kubelet
2023-05-02 08:18:14 -07:00
Tim Hockin
d55b67b349 Clean up brace whitespace in **/validation_test.go
This was making my eyes bleed as I read over code.

I used the following in vim.  I made them up on the fly, but they seemed
to pass manual inspection.

:g/},\n\s*{$/s//}, {/
:w
:g/{$\n\s*{$/s//{{/
:w
:g/^\(\s*\)},\n\1},$/s//}},/
:w
:g/^\(\s*\)},$\n\1}$/s//}}/
:w
2023-05-02 00:48:42 -07:00
Kubernetes Prow Robot
19830bf51b Merge pull request #117627 from skitt/intstr-fromint32-cloud-node
kubelet: use new intstr functions
2023-05-01 23:42:22 -07:00
Kubernetes Prow Robot
544bd825f9 Merge pull request #117394 from sourcelliu/allowli
Remove unnecessary if judgments
2023-05-01 22:34:30 -07:00
Kubernetes Prow Robot
f5fff0f2bc Merge pull request #117105 from yoongon/feature/assert-order
Swap assert.Equal parameters oders to follow convention
2023-05-01 22:34:22 -07:00
Kubernetes Prow Robot
9121e82e64 Merge pull request #117050 from charles-chenzz/remove_seccomp
remove seccomp profile path on security context
2023-05-01 22:34:11 -07:00
Kubernetes Prow Robot
72afd8558e Merge pull request #117612 from saschagrunert/image-pull-errors
Fix image pull error type `ErrRegistryUnavailable`
2023-05-01 21:30:19 -07:00
Kubernetes Prow Robot
1241ddc567 Merge pull request #116376 from swatisehgal/device-mgr-recovery-wip
node: device-mgr: Handle recovery flow by checking if healthy devices exist- attempt 2
2023-05-01 21:30:11 -07:00
Mark Rossetti
ab9c8eb1e8 Removing WindowsHostProcessContainers feature-gate
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2023-05-01 13:30:38 -07:00
Francesco Romani
69bc685556 node: podresources: graduate to GA
Lock the feature gate to ON and simplify the code
accordingly.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-05-01 16:23:28 +02:00
Moshe Levi
04ad946e8f kubelet dra: lock before getting claimInfo CDIDevices and annotations fields
Currently claimInfo CDIDevices and annotations access directly without RLock.
This can lead to concurrent read write error.

To avoid it we added RLock all before getting the CDIDevices and annotations

Signed-off-by: Moshe Levi <moshele@nvidia.com>
2023-05-01 15:09:43 +03:00
Stephen Kitt
0ee9f1b7a7 kubelet: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-05-01 09:17:35 +02:00
mansikulkarni96
7926656038 kubelet: Implement support for Windows podAndContainerStatsFromCRI
Part of kubernetes/enhancements#2371

Follow up to the initial work introducing CRI API fields for Windows
metrics collection #110754
Windows equivalent work for adding support for Windows
podAndContainerStatsFromCRI #103095, which will allow users to get
Windows pod and container stats only from CRI.

Signed-off-by: mansikulkarni96 <mankulka@redhat.com>
2023-05-01 01:02:44 -04:00
mansikulkarni96
14952cef5b kubelet: Move Linux stats to a Linux specific file
This commit moves the Linux stats from CRI to a linux specific
file and adds unimplemented methods for platform other than
Linux and Windows.
2023-05-01 01:02:36 -04:00
xyz-li
847df6d915 kubelet: output log even file is rotated 2023-04-30 23:20:27 +08:00
Swati Sehgal
dc1a592632 node: device-mgr: Handle recovery by checking if healthy devices exist
In case of node reboot/kubelet restart, the flow of events involves
obtaining the state from the checkpoint file followed by setting
the `healthDevices`/`unhealthyDevices` to its zero value. This is
done to allow the device plugin to re-register itself so that
capacity can be updated appropriately.

During the allocation phase, we need to check if the resources requested
by the pod have been registered AND healthy devices are present on
the node to be allocated.

Also we need to move this check above `needed==0` where needed is
required - devices allocated to the container (which is obtained from
the checkpoint file) because even in cases where no additional devices
have to be allocated (as they were pre-allocated), we still need to
make sure he devices that were previously allocated are healthy.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2023-04-28 14:41:30 +01:00
Harshal Patil
05f04f866e Keep PLEG interruptions in a separate interface
Signed-off-by: Harshal Patil <harpatil@redhat.com>
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
2023-04-26 12:14:26 -04:00
charles-chenzz
c96188a38b remove seccomp profile path 2023-04-26 20:08:06 +08:00
Sascha Grunert
4cdfe600e0 Fix image pull error type ErrRegistryUnavailable
The current error comparison `imagePullResult.err ==
ErrRegistryUnavailable` will never work with any remote runtime, because
we produce gRPC errors which wrap a code and a description, like:

```
rpc error: code = Unknown desc = This is the error description
```

To be able to check custom error types from `pkg/kubelet/images/types.go`,
we now strip the code if the status is unknown on image pull.

Beside that, we use a string comparison to check against
`ErrRegistryUnavailable.Error()`, because validating them via the
`errors` package is not yet supported by grpc-go:
https://github.com/grpc/grpc-go/issues/3616

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-04-26 11:02:47 +02:00
TommyStarK
73d9a9cfa0 kubelet/kuberuntime: Fix flaky test 'TestGeneratePodSandboxConfig'
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-04-25 17:29:25 +02:00
mantuliu
b109a58539 Improve the performance of isPodStatusCacheTerminal 2023-04-22 15:55:29 +08:00
mantuliu
17db22d055 Fix potential mutex usage bug
Signed-off-by: mantuliu <240951888@qq.com>
2023-04-21 23:50:33 +08:00
mantuliu
84c14c65c6 Remove unnecessary type conversion
Signed-off-by: mantuliu <240951888@qq.com>
2023-04-21 16:20:50 +08:00
Kubernetes Prow Robot
7fe63a9b1a Merge pull request #116902 from sourcelliu/cast
Remove unnecessary int type conversion
2023-04-20 19:15:10 -07:00
Kubernetes Prow Robot
9d34ca5b66 Merge pull request #117276 from pacoxu/image-pull-event
kubelet: truncate the precision at a millisecond for image pull event message
2023-04-20 17:45:10 -07:00
Kubernetes Prow Robot
53cccbe4f9 Merge pull request #117019 from bobbypage/gh_116925
kubelet: Mark new terminal pods as non-finished in pod worker
2023-04-17 15:10:58 -07:00
Todd Neal
453f81d1ca kubelet: pass context to VolumeManager.WaitFor*
This allows us to return with a timeout error as soon as the
context is canceled.  Previously in cases where the mount will
never succeed pods can get stuck deleting for 2 minutes.

In the Sync*Pod methods that call VolumeManager.WaitFor*, we
must filter out wait.Interrupted errors from being logged as
they are part of control flow, not runtime problems. Any
early interruption should result in exiting the Sync*Pod method
as quickly as possible without logging intermediate errors.
2023-04-17 11:53:28 -05:00
mantuliu
ee99ca25ee Remove unnecessary if judgments 2023-04-16 23:55:31 +08:00
mantuliu
37ea51fd56 Improve the performance of map usage 2023-04-16 11:41:14 +08:00
kidddddddddddddddddddddd
4e928c96b5 skip checks when topologyPolicyName is PolicyNone 2023-04-14 22:44:24 +08:00
mantuliu
3b7c14e8cf Remove unnecessary int type conversion 2023-04-14 16:41:44 +08:00
Dan Winship
2bb35e08f4 Clarify kubelet/kube-proxy iptables rule skew constraints 2023-04-13 14:05:58 -04:00
Claudiu Belu
0979d55443 unit tests: Skip flaky tests on Windows (part 2)
Some of the unit tests are currently flaky on Windows. This commit
skips them until they are resolved.
2023-04-13 12:07:18 +00:00
Paco Xu
c042837a76 truncate the precision at a millisecond for image pull event message 2023-04-13 15:56:16 +08:00
charles-chenzz
db5d74935e optimize evict sandbox logic 2023-04-13 09:02:46 +08:00
charles-chenzz
ccf7ddacfc replace ioutil with os, update doc 2023-04-13 09:02:46 +08:00