Commit Graph

10639 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
c7cc7886e2
Merge pull request #116702 from vinaykul/restart-free-pod-vertical-scaling-podmutation-fix
Fix pod object update that may cause data race
2023-03-21 19:26:36 -07:00
Kubernetes Prow Robot
9c6414cdfe
Merge pull request #116792 from pacoxu/fix-safe-sysctl-windows
safe-sysctl: skip checking for windows
2023-03-21 17:39:59 -07:00
vinay kulkarni
f41702b8d2 Return updatedPod if resize upon successful checkpointing of allocated resources 2023-03-22 00:24:00 +00:00
Paco Xu
e154b73535 safe-sysctl: skip checking for windows 2023-03-22 07:40:29 +08:00
Claudiu Belu
c68bc27f73 kubelet: Read DNS Config options from file for Windows
A previous commit added the capability to read the DNS configuration options
from a Windows host, while removing the capability to read from a resolv.conf-like
file.

This commit addresses this issue: if the given ``--resolv-conf`` option is not set to
``Host``, it will consider it as a file, preserving the previous behavior.
2023-03-21 22:21:57 +00:00
vinay kulkarni
d753893260 Do not modify original pod object when processing pod resource resize 2023-03-18 17:57:25 +00:00
vinay kulkarni
358474b71d Explicitly return from checkpoint update failures. SyncPod will retry 2023-03-17 18:00:04 +00:00
Paco Xu
5134520a3b add lock in volume manager reconciler to avoid data race
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2023-03-17 21:29:10 +08:00
vinay kulkarni
f66e8848ee Fix pod object update that may cause data race 2023-03-17 08:50:52 +00:00
Paco Xu
7afcfe1826 kubelet: use filepath.Clean before init, validate it in setupDataDirs 2023-03-17 15:45:39 +08:00
Michal Wozniak
3d68f362c3 Give terminal phase correctly to all pods that will not be restarted 2023-03-16 21:25:29 +01:00
Clayton Coleman
58d1dc669f kubelet: Remove status manager channel
The status manager channel forces all container status to be
processed, even if multiple updates are generated in succession.
Instead of queueing the updates, just remember which ones changed
and process them in a batch. This should reduce QPS load from
the Kubelet for status, reduce latency of status propagation to
the API in general, and is easier to reason about.

This also prevents status from being lost when the channel is
full - all updates sent by SetPodStatus are guaranteed to be
recorded. Changing to remove the channel allows us to set a
marker flag when the pod worker state machine completes that
avoids the status manager having to call into the pod worker
directly.
2023-03-16 21:22:43 +01:00
Dan Winship
7605163620 Split up PreferNodeIP into legacy and non-legacy versions
Though not obvious as currently written, PreferNodeIP() has different
semantics with legacy and external cloud providers, since one kind of
node IP value never gets passed in the external cloud provider case.
Split it into two functions to make this clearer (and to prepare for
adding new external-cloud-only semantics, and to make it clearer that
some of the code can be deleted when legacy cloud providers go away).
2023-03-15 14:50:17 -04:00
Kubernetes Prow Robot
37937bb227
Merge pull request #110566 from claudiubelu/unittests-5
Adds Pod DNS Policies support for Windows pods
2023-03-14 23:54:14 -07:00
Kubernetes Prow Robot
74123a7341
Merge pull request #116621 from moshe010/dra-lock
kubelet dra: add lock to addCDIDevices
2023-03-14 19:27:28 -07:00
Kubernetes Prow Robot
815b1bf0d8
Merge pull request #116558 from klueska/update-dra-kubeletplugin-v1alpha2
Update kubeletplugin API for DRA to v1alpha2
2023-03-14 19:27:06 -07:00
Kubernetes Prow Robot
9ddf1a02bd
Merge pull request #116504 from vinaykul/restart-free-pod-vertical-scaling-kubeletonly-fix
Fix null pointer access in doPodResizeAction for kubeletonly mode
2023-03-14 19:26:59 -07:00
Kubernetes Prow Robot
ae36991498
Merge pull request #116332 from klueska/extend-resourceclaimstatus
Update resource.AllocationResult with a slice of ResourceHandlers
2023-03-14 19:26:50 -07:00
Kubernetes Prow Robot
9053b5dc2c
Merge pull request #116119 from vinaykul/restart-free-pod-vertical-scaling-fixes
Restructure resize policy naming and set default resize policy values
2023-03-14 19:26:42 -07:00
Kevin Klues
579295e727 Update kubeletplugin API for DynamicResourceAllocation to v1alpha2
This PR makes the NodePrepareResources() and NodeUnprepareResource()
calls of the kubeletplugin API for DynamicResourceAllocation
symmetrical. It wasn't clear how one would use the set of CDIDevices
passed back in the NodeUnprepareResource() of the v1alpha1 API, and the
new API now passes back the full ResourceHandle that was originally
passed to the Prepare() call. Passing the ResourceHandle is strictly
more informative and a plugin could always (re)derive the set of
CDIDevice from it.

This is a breaking change, but this release is scheduled to break
multiple APIs for DynamicResourceAllocation, so it makes sense to do
this now instead of later.

Signed-off-by: Kevin Klues <kklues@nvidia.com>
2023-03-14 23:09:44 +00:00
Moshe Levi
ffb07d1e78 kubelet dra: add lock to addCDIDevices
Signed-off-by: Moshe Levi <moshele@nvidia.com>
2023-03-15 00:50:45 +02:00
Kevin Klues
74d634a028 Update kubelet support for recent changes to resource.k8s.io/v1alpha2
Signed-off-by: Kevin Klues <kklues@nvidia.com>
2023-03-14 22:34:18 +00:00
Kubernetes Prow Robot
715e957084
Merge pull request #115374 from pacoxu/add-net.ipv4.ip_local_reserved_ports
add net.ipv4.ip_local_reserved_ports to safe sysctls
2023-03-14 15:14:14 -07:00
Claudiu Belu
f335812719 unittests: Fixes unit tests for Windows (part 5)
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- getHostDNSConfig is reading a resolv.conf file. However, we don't have
  that on Windows. Instead, we can get the DNS server list and the DNS
  suffix list from Windows itself.

On Windows, getHostDNSConfig will now return the host's DNS configuration
if the given resolverConfig is "Host". If it's not "Host" or an empty string,
an error will be returned.

Based on the code from kubernetes/test/images/agnhost/dns/dns_windows.go
2023-03-14 22:11:29 +00:00
Kubernetes Prow Robot
34acfb877a
Merge pull request #116546 from marosset/winstats-10-seconds
Updating perfCounterUpdatePeriod for Windows to 10 seconds
2023-03-14 14:13:11 -07:00
Kubernetes Prow Robot
28fa3cbbf1
Merge pull request #115847 from moshe010/pod-resource-api-dra-upstream
Extend the PodResources API to include resources allocated by DRA
2023-03-14 14:12:26 -07:00
Kubernetes Prow Robot
89a9c0c8bb
Merge pull request #96120 from LorbusChris/kubelet-journal-logs
KEP 2258: add node log query
2023-03-14 14:12:14 -07:00
vinay kulkarni
86efc8bd79 Add isInPlacePodVerticalScalingAllowed for restart check block 2023-03-14 20:30:02 +00:00
vinay kulkarni
5b2682ac04 Make in-place resize exclusion conditions (such as static pods) very obvious 2023-03-14 19:37:35 +00:00
Kubernetes Prow Robot
6a111bebe2
Merge pull request #116377 from kinvolk/rata/userns
KEP-127: user namespace support for stateless pods
2023-03-14 10:40:43 -07:00
Kubernetes Prow Robot
49649c89ea
Merge pull request #113584 from yangjunmyfm192085/volume-contextual-logging
volume: use contextual logging
2023-03-14 10:40:16 -07:00
Moshe Levi
67a71c0bd7 kubelet podresources: add unit tests for DyanmicResource and Get method
Signed-off-by: Moshe Levi <moshele@nvidia.com>
2023-03-14 19:33:04 +02:00
Moshe Levi
2a568bcfc8 kubelet podresources: extend List to support Dynamic Resources and implement Get API
Signed-off-by: Moshe Levi <moshele@nvidia.com>
2023-03-14 19:33:04 +02:00
Moshe Levi
9c57613912 Add ClassName to chekpoint state and in-memory cache
Signed-off-by: Moshe Levi <moshele@nvidia.com>
2023-03-14 19:33:04 +02:00
Moshe Levi
71d6e4d53c kubelet metrics: add pod resources get metrics
Signed-off-by: Moshe Levi <moshele@nvidia.com>
2023-03-14 19:33:03 +02:00
Francesco Romani
5e03998991 kubelet: podresources: pack parameters in a struct
To enable rate limiting, needed for GA graduation,
we need to pass more parameters to the already crowded
`ListenAndServePodresources` function.

To tidy up a bit, pack the parameters in a helper struct,
with no intended changes in behavior.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-03-14 19:33:01 +02:00
Kubernetes Prow Robot
e192a7dbcc
Merge pull request #116330 from SataQiu/clean-kubelet-20230307
Followup 112643: remove residual code associated with DynamicKubeletConfig
2023-03-14 09:39:51 -07:00
Kubernetes Prow Robot
cb5ad1e044
Merge pull request #115576 from silenceshell/fix-fake-os-files-concurrent-map-write
fix concurrent-map-write of FakeOS.Create
2023-03-14 09:39:26 -07:00
Kubernetes Prow Robot
8bf7805e05
Merge pull request #115397 from sourcelliu/boottime
Add test for pkg/kubelet/util
2023-03-14 09:39:18 -07:00
Kubernetes Prow Robot
af97bb9ac5
Merge pull request #115053 from qingwave/remove-unuse-code
Remove unuse code in pkg/kubelet/util
2023-03-14 09:39:10 -07:00
Kubernetes Prow Robot
898143a96a
Merge pull request #114904 from TommyStarK/kubelet/pod_startup_latency_tracker
kubelet: fix recording when pulling image did finish
2023-03-14 09:39:02 -07:00
Kubernetes Prow Robot
aa49f001bc
Merge pull request #114701 from goushicui/vlm
update comment
2023-03-14 09:38:53 -07:00
Kubernetes Prow Robot
b623fcc181
Merge pull request #114634 from TommyStarK/unit-tests/pkg-kubelet-cloudresource
kubelet/cloudresource: Improving test coverage
2023-03-14 09:38:45 -07:00
kunkunhaohao
a772691165
Update pod_container_manager_linux.go (#114598)
* Update pod_container_manager_linux.go

This is a simple optimization to reduce repeated invoking of the GetPodContainerName function.

* Update pod_container_manager_linux.go

将podContainerName, _ := m.GetPodContainerName(pod)更靠近使用podcontainerName变量的位置
2023-03-14 09:38:36 -07:00
Aravindh Puthiyaparambil
d12696c20f
kubelet: Expose simple journald and Get-WinEvent shims on the logs endpoint
Provide an administrator a streaming view of journal logs on Linux
systems using journalctl, and event logs on Windows systems using the
Get-WinEvent PowerShell cmdlet without them having to implement a client
side reader.

Only available to cluster admins.

The implementation for journald on Linux was originally done by Clayton
Coleman.

Introduce a heuristics approach to query logs

The logs query for node objects will follow a heuristics approach
when asked to query for logs from a service. If asked to get the
logs from a service foobar, it will first check if foobar logs to the
native OS service log provider. If unable to get logs from these, it
will attempt to get logs from /var/foobar, /var/log/foobar.log or
/var/log/foobar/foobar.log in that order.
The logs sub-command can also directly serve a file if the query looks
like a file.

Co-authored-by: Clayton Coleman <ccoleman@redhat.com>
Co-authored-by: Christian Glombek <cglombek@redhat.com>
2023-03-14 08:54:36 -07:00
Aravindh Puthiyaparambil
26279a5282
kubelet: Add validation for EnableNodeLogQuery 2023-03-14 08:45:20 -07:00
Aravindh Puthiyaparambil
aadad09410
api: Add EnableNodeLogQuery to KubeletConfiguration
Added EnableNodeLogQuery field to kubelet/apis/config/types.go and
staging/src/k8s.io/kubelet/config/v1beta1/types.go, then executed.
 `hack/update-codegen.sh`.

This new field will default to off and will need to be explicitly
enabled in addition to the NodeLogQuery gate to use the feature.
2023-03-14 08:45:19 -07:00
Kubernetes Prow Robot
a9008b502d
Merge pull request #116577 from jsafrane/fix-standalone-mode
Fix volume reconstruction in standalone mode
2023-03-14 08:37:02 -07:00
Kubernetes Prow Robot
204a9a1f17
Merge pull request #116459 from ffromani/podresources-ratelimit-minimal
add podresources DOS prevention using rate limit
2023-03-14 08:36:45 -07:00
Kubernetes Prow Robot
2bd69db8d7
Merge pull request #116351 from vinaykul/restart-free-pod-vertical-scaling-kubelet-fix-followup
Initialize pod resource allocation checkpoint manager to noop
2023-03-14 08:36:37 -07:00