Commit Graph

10759 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
86d786090a
Merge pull request #117793 from tzneal/memory-oom-group-support
use the cgroup aware OOM killer if available
2023-06-12 14:45:58 -07:00
Todd Neal
4e20a8f52b kill all processes in a container in the event of OOM
Set memory.oom.group if using cgroups v2 unified mode so all processes in
the container will be killed together in the event of an OOM kill.
2023-06-12 15:49:01 -05:00
Kubernetes Prow Robot
d627045949
Merge pull request #118373 from saschagrunert/seccomp-unused
Remove unused `getSeccompProfilePath` helper function
2023-06-12 13:46:57 -07:00
Kubernetes Prow Robot
da4646c080
Merge pull request #118096 from tnqn/fix-confusing-check
Remove undesired verbose fields from log
2023-06-12 13:46:42 -07:00
Kubernetes Prow Robot
9d231f8ce7
Merge pull request #118329 from danwinship/fix-dual-stack-cloud-node-ip-annotation
Set the node-ips annotation correctly with CloudDualStackNodeIPs
2023-06-12 11:44:10 -07:00
Kubernetes Prow Robot
18d05b646d
Merge pull request #117702 from kannon92/pod-ready-to-start-rename
feat: rename PodHasNetwork to PodReadyToStartContainers
2023-06-11 18:59:48 -07:00
Kubernetes Prow Robot
89bfdf0276
Merge pull request #117079 from qingwave/sort-volumes
kubelet/volumemanager: sort unmounted volumes in error message
2023-06-07 18:52:12 -07:00
Kubernetes Prow Robot
c831a08c8e
Merge pull request #118253 from saschagrunert/streaming-cri-api
Move `cri/streaming` to `k8s.io/kubelet` staging repository
2023-06-06 14:14:12 -07:00
Kubernetes Prow Robot
3d4a243742
Merge pull request #116742 from moshe010/fix-pod-resource-api-ut
kubelet PodResources API: follow-up review comments
2023-06-06 11:18:35 -07:00
Kubernetes Prow Robot
299b72c587
Merge pull request #114760 from TommyStarK/unit-tests/pkg-kubelet-cm-containermap
kubelet/cm/containermap: Improving test coverage
2023-06-06 11:18:24 -07:00
Sascha Grunert
db9fcfeed2
Move cri/streaming to k8s.io/kubelet staging repository
Container runtimes like CRI-O and containerd reuse the code by copying
it from Kubernetes. To have a single source of truth for the streaming
server we now move the already isolated implementation to the
k8s.io/kubelet staging repository. This way runtimes can re-use the code
without copying the parts.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-06-05 08:08:18 +02:00
Dan Winship
a6c7f63b18 Set the node-ips annotation correctly with CloudDualStackNodeIPs 2023-06-01 07:20:17 -04:00
Sascha Grunert
15aa00fc83
Remove unused getSeccompProfilePath helper function
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-06-01 11:03:39 +02:00
Kubernetes Prow Robot
0bb17a88fa
Merge pull request #116741 from gjkim42/promote-expanded-dns-config-to-ga
Promote ExpandedDNSConfig feature to the GA stage
2023-05-30 18:19:56 -07:00
Kubernetes Prow Robot
cfeb83d56b
Merge pull request #116525 from ffromani/kubelet-podresources-endpoint-ga
node: podresources: graduate to GA
2023-05-25 16:38:50 -07:00
Kubernetes Prow Robot
03ebd4b7ef
Merge pull request #116656 from HirazawaUi/fik-fd-leaks
Cleanup fd leaks and file removal cleanup
2023-05-24 22:50:50 -07:00
Kubernetes Prow Robot
484645e817
Merge pull request #116659 from claudiubelu/skip-flaky-tests-2
unit tests: Skip flaky tests on Windows (part 2)
2023-05-23 20:04:48 -07:00
Kubernetes Prow Robot
de12f89cd4
Merge pull request #116994 from mmiranda96/fix/116505
Create local copy to avoid potential race condition
2023-05-23 19:06:49 -07:00
Kubernetes Prow Robot
8b8dfcad12
Merge pull request #117586 from mimowo/preemption-for-critical-pods
Add DisruptionTarget condition when preempting for critical pod
2023-05-23 11:22:27 -07:00
Kubernetes Prow Robot
74c66a8b39
Merge pull request #116231 from kannon92/kubelet-image-cleanup
Using parsers in applyDefaultImageTag and adding error test cases.
2023-05-23 10:24:27 -07:00
Kubernetes Prow Robot
1cad20dece
Merge pull request #117935 from saschagrunert/cri-errors-additional
Allow runtimes to provide additional context on CRI pull errors
2023-05-22 23:06:26 -07:00
Quan Tian
d9b941b782 Remove undesired verbose fields from log
The if and else branches have the exactly same code, which looks
confusing and doesn't make sense. According to the comment, the else
branch should log the error and podUID only.

Signed-off-by: Quan Tian <qtian@vmware.com>
2023-05-18 16:07:45 +08:00
Kubernetes Prow Robot
bdbfbffef3
Merge pull request #117371 from smarterclayton/minimal_podmanager
kubelet: Don't reference the pod manager interface directly from components
2023-05-16 14:34:33 -07:00
Kubernetes Prow Robot
03b2e84183
Merge pull request #113209 from luozhiwenn/personal/etc-host
ensure etc-host file permission is 644 whatever umask is
2023-05-16 01:41:35 -07:00
kannon92
0819d34204 using parsers in applyDefaultImageTag 2023-05-15 15:53:47 +00:00
Sascha Grunert
aa405c8aac
Allow runtimes to provide additional context on CRI pull errors
Right now container runtimes have no way to provide additional context
to the pull errors. We now loosen the constraints and check for
additional messages after the actual CRI errors, which allows to enrich
the verbosity of the warning events, for example:

```
Warning  Failed     2s (x3 over 43s)   kubelet            Failed to pull image "localhost:5000/foo": RegistryUnavailable: pinging container registry localhost:5000: Get "http://localhost:5000/v2/": dial tcp [::1]:5000: connect: connection refused
```

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-05-15 09:08:14 +02:00
Clayton Coleman
1f16d71185
kubelet: Rename PodManager DeletePod to RemovePod
RemovePod is more consistent within the kubelet to be the opposite
of AddPod, and the pod is not being deleted just "removed" from
tracking.
2023-05-12 12:57:27 -04:00
Clayton Coleman
166256f73e
kubelet: Reduce the interface pod.Manager consumers accept
Every component that uses a pod.Manager should use a stub interface
(like we do for podWorker) that explicitly describes what methods
they use. This will allow podWorker to implement the minimum set
of manager interfaces.
2023-05-12 12:57:27 -04:00
Clayton Coleman
8bd94dfa76
kubelet: Organize and document kubelet pod-related members
Clearly describe core pod related component responsibilities in
the kubelet members. Organize the PodManager interface for clarity.
2023-05-12 12:57:27 -04:00
Clayton Coleman
bb568844b6
kubelet: Separate the MirrorClient from the PodManager
The two are not coupled except accidentally. Separate them and
update callsites. This will reduce the scope of PodManager interface
to make exposing the pod worker cleaner.
2023-05-12 12:57:26 -04:00
Clayton Coleman
80b1aca580
kubelet: Remove dispatchWork and inline calls to UpdatePod
The HandlePod* methods are all structurally similar, but accrued
subtle differences. In general the only point for Handle is to
process admission and to update the pod worker with the desired
state of the kubelet's config (so that pod worker can make it
the actual state).

Add a new GetPodAndMirrorPod() method that handles when the config
pod is ambiguous (pod or mirror pod) and inline the structure.
Add comments on questionable additions in the config methods for
future improvement.

Move the metric observation of container count closer to where
pods are actually started (in the pod worker). A future change
can likely move it to syncPod.
2023-05-12 12:57:26 -04:00
Clayton Coleman
e7207c8546
kubelet: Merge orphaned mirror pod names into GetPodsAndMirrorPods
There is only one caller and both sets of data are part of the
resync operation between kubelet's desired state and the actual
state of the pod workers. Reduces the size of the interface so
that it is easier to create another pod manager.
2023-05-12 12:57:26 -04:00
Clayton Coleman
f8086f2dac
kubelet: Convert IsMirrorOf to a function
Shrinks the PodManager interface by one method, no abstraction is
necessary here.
2023-05-12 12:57:26 -04:00
Clayton Coleman
02960a8253
kubelet: Remove unused mirrorPodFunc in eviction
Not referenced
2023-05-12 12:57:25 -04:00
Kubernetes Prow Robot
8f9c185696
Merge pull request #116761 from iancoolidge/devel-cpuset-revendor
Complete cpuset export to k/utils by revendoring
2023-05-12 08:37:02 -07:00
Claudiu Belu
11f1d24165 unit tests: Fixes kubelet util unit tests for Windows
The unit tests are currently failing due to missing imports. This commit
addresses this issue.

Additionally, TestIsUnixDomainSocket expects an error to be raised by
IsUnixDomainSocket if the file does not exist, but on Windows we do not
raise such error.

This issue is addressed by Stat-ing the file, and checking
if the file exists or not. We're also handling the case in which the given
filePath is a named pipe, returning false immediately, instead of trying to
dial it as a Unix domain socket.
2023-05-10 11:25:49 +00:00
Kubernetes Prow Robot
65c13c5c21
Merge pull request #117836 from ruquanzhao/addPodUID
Passing podUID in AddReference and DeleteReference
2023-05-10 00:18:59 -07:00
RuquanZhao
9150e6b55a s/of referencedFrom/from referenceFrom/
Signed-off-by: Ruquan Zhao <ruquan.zhao@arm.com>
2023-05-10 10:22:52 +08:00
HirazawaUi
82e3fa0930 fix fd leaks and failed file removing for main pkg and cmd 2023-05-09 09:24:11 -05:00
RuquanZhao
308ab380d7 Add unit testcases of refMap.
Signed-off-by: Ruquan Zhao <ruquan.zhao@arm.com>
2023-05-09 18:05:43 +08:00
RuquanZhao
ccb4ca8954 record podUID in refMap in watchBasedManager
Signed-off-by: Ruquan Zhao <ruquan.zhao@arm.com>
2023-05-08 15:32:10 +08:00
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