Commit Graph

10639 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
d0584179f4
Merge pull request #114367 from liggitt/kubelet-csr-init
Check for initial kubelet certificates more frequently
2023-01-30 09:07:05 -08:00
mantuliu
ef0e9b5cf5 Add test for pkg/kubelet/util
Signed-off-by: mantuliu <240951888@qq.com>
2023-01-30 21:19:48 +08:00
Kubernetes Prow Robot
232c0de57a
Merge pull request #115101 from HirazawaUi/delte-pkg-kubelet-unused-functions
delete unused functions in pkg/kubelet directory
2023-01-29 17:21:08 -08:00
mantuliu
8ca97dcde1 Add test for pkg/kubelet/sysctl/allowlist_test.go 2023-01-29 22:48:27 +08:00
Kubernetes Prow Robot
538c6c044f
Merge pull request #115329 from aojea/disable_probe
skip scale test for probes
2023-01-25 22:02:33 -08:00
Kubernetes Prow Robot
083e0d2be1
Merge pull request #114991 from TheOneTheOnlyJJ/skip-failing-unittests
Skip failing Windows unit tests
2023-01-25 22:02:25 -08:00
Antonio Ojea
3fb4edb257 skip scale test for probes
Change-Id: I215e2cf9211348aadcc0d262da01953d6523794a
2023-01-26 00:02:30 +00:00
Sergey Kanzhelev
15b63c380e use a proper regex looking for the restartCount 2023-01-25 23:55:27 +00:00
Kubernetes Prow Robot
a12dd4189e
Merge pull request #115102 from saschagrunert/cri-unavailable
Check for all errors in CRI connection validation
2023-01-24 02:24:17 -08:00
Kubernetes Prow Robot
674eb36f92
Merge pull request #115249 from thockin/codegen-13-proto-go-packages
Set go_package in all proto files
2023-01-23 12:14:07 -08:00
Tim Hockin
60ffa47f4f
Set proto go_package: kubelet example_plugin_apis
This creates some diff to the *.pb.go files to note that
in the "options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```
2023-01-23 09:31:18 -08:00
Jan Safranek
cca3d557e6 Split volume reconstruction refactoring from SELinuxMountReadWriteOncePod
Add a new feature gate NewVolumeManagerReconstruction and add the new
volume reconstruction done in 1.26 under that feature gate.
2023-01-23 14:43:29 +01:00
Patrick Ohly
bc6c7fa912 logging: fix names of keys
The stricter checking with the upcoming logcheck v0.4.1 pointed out these names
which don't comply with our recommendations in
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments.
2023-01-23 14:24:29 +01:00
Antonio Ojea
dbf178a8d1 add scale test for probes
Change-Id: I1e49943531b569b5e02f82369750a9ca899ae726
2023-01-22 16:57:41 +00:00
Jurj Andrei George
4df989d719 Skip failing Windows unit tests
As discussed during the SIG Testing meeting on January 10, 2023, failing
Windows unit tests are now skipped.
These changes should be reverted when the unit tests wil get fixed.
Mentioned SIG Testing meeting:
https://docs.google.com/document/d/1z8MQpr_jTwhmjLMUaqQyBk1EYG_Y_3D4y4YdMJ7V1Kk/edit#heading=h.qwblxf2uhgoo
2023-01-18 14:18:41 +02:00
Kubernetes Prow Robot
c913e6ce62
Merge pull request #114542 from pacoxu/EphemeralContainers
cleanup: EphemeralContainers feature gate related codes
2023-01-17 11:18:34 -08:00
Swati Sehgal
172c55d310 node: topologymgr: add metrics about admission requests and errors
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2023-01-17 17:50:29 +00:00
Kubernetes Prow Robot
727b5a4b47
Merge pull request #114231 from helio/fix-windows-cpu-maximum
win: fix cpu count to calculate cpu_maximum
2023-01-17 07:56:33 -08:00
Sascha Grunert
e89547d308
Check for all errors in CRI connection validation
We only have one CRI API (v1) to validate during the initial connection
of the kubelet with the container runtime. Therefore we can now verify
all kind of GRPC related issues.

Fixes: https://github.com/kubernetes/kubernetes/issues/114956

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-01-17 09:24:31 +01:00
HirazawaUi
a8173eded3 delete unused functions in pkg/kubelet directory 2023-01-16 20:00:49 +08:00
Paco Xu
70e56fa71a cleanup: EphemeralContainers feature gate related codes 2023-01-15 21:15:01 +08:00
qingwave
a9d92bcb25 remove unuse code in pkg/kubelet/util
Signed-off-by: qingwave <isguory@gmail.com>
2023-01-13 08:27:42 +00:00
David Porter
8e3a02efa8 Remove AcceleratorUsageMetrics from kubelet
The feature gate is GA'd and enabled by default and the metrics have
been removed from cAdvisor.

Signed-off-by: David Porter <david@porter.me>
2023-01-11 16:07:39 -08:00
Kubernetes Prow Robot
6f6c468168
Merge pull request #114802 from moshe010/pod-resource-metrics
kubelet podresource: fix GetAllocatableResources metrics
2023-01-11 06:43:44 -08:00
Kubernetes Prow Robot
2a2f994c24
Merge pull request #114187 from claudiubelu/refactor-platform-deps-3
Refactors kubelet's plugin watcher
2023-01-10 15:25:26 -08:00
TommyStarK
1fcc8fbf59 kubelet: Replace deprecated pointer function
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-01-08 13:44:09 +01:00
Ian K. Coolidge
5533e49e2c cpuset: Add package comment
Describe use cases (node IDs, HT siblings, etc)

Call out novelty (Linux CPU list parse/dump)

Describe future work (relax immutable, refactor to use 'set')
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
cbb985a310 cpuset: Delete 'builder' methods
All usage of builder pattern is convertible to cpuset.New()
with the same or fewer lines of code.

Migrate Builder.Add to a private method of CPUSet, with a comment
that it is only intended for internal use to preserve immutable
propoerty of the exported interface.

This also removes 'require' library dependency, which avoids
non-standard library usage.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
f3829c4be3 cpuset: Rename 'NewCPUSet' to 'New' 2023-01-06 23:32:51 +00:00
Ian K. Coolidge
768b1ecfb6 cpuset: hide 'Filter' API
FilterNot is only used in this file, and is trivially converted to a
'filter' call site by inverting the predicate.

Filter is only used in this file, so don't export it.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
e5143d16c2 cpuset: Make 'ToSlice*' methods look like 'set' methods
In 'set', conversions to slice are done also, but with different names:

ToSliceNoSort() -> UnsortedList()
ToSlice() -> List()

Reimplement List() in terms of UnsortedList to save some duplication.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
a0c989b99a cpuset: Remove *Int64 methods
These are rarely used and can be accommodated with a trivial helper.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
67a057d4f2 cpuset: Remove 'MustParse' method
Removes exit/fatal from cpuset library.

Usage in podresources test was not necessary.

Library reference in cpu_manager_test was moved to a local function, and
converted to use e2e test framework error catching.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
824bd57ad6 cpuset: Convert Union arguments to variadic
This allows Union to implement UnionAll easily.
2023-01-06 23:32:50 +00:00
Kubernetes Prow Robot
492637878f
Merge pull request #111660 from pacoxu/key-encipherment-v1.26
Key encipherment usage  v1.27
2023-01-04 15:51:57 -08:00
weizhi
575616cc72
fix: kubelet event about unattached volumes is incorrect (#112719)
* fix kubelet event

* add ut

* fix ut
2023-01-04 01:51:59 -08:00
Moshe Levi
ce46ba7be8 kubelet podresource: fix GetAllocatableResources metrics
The GetAllocatableResources increase twice the PodResourcesEndpointRequestsTotalCount
This PR fix this.

Signed-off-by: Moshe Levi <moshele@nvidia.com>
2023-01-04 10:58:55 +02:00
Kubernetes Prow Robot
b532f2b3e7
Merge pull request #112136 from pacoxu/migrate-runtime-endpoint-flags
kubelet: migrate container runtime endpoint flag to config
2023-01-03 09:29:31 -08:00
huyinhou
4702503d15 update test case
Signed-off-by: huyinhou <huyinhou@bytedance.com>
2023-01-03 15:00:12 +08:00
sorkinl
71d44a9348 Refactors kubelet's plugin watcher
Refactors platform specific code into separate files (*_linux.go / *_windows.go / *_others.go)

Adds unit tests for the pluginwatcher changes.
2023-01-01 00:26:37 +00:00
huyinhou
b9987eeb6c fix allDevices map data race 2022-12-29 18:27:08 +08:00
huyinhou
997cefc9da add unit test 2022-12-29 14:50:18 +08:00
Paco Xu
160f015ef4 kubelet: add key encipherment usage only if it is rsa key
remove allowOmittingUsageKeyEncipherment as it is always true

Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-12-27 16:04:25 +08:00
goushicui
6e0832a5aa update comment 2022-12-27 00:09:59 +08:00
Kubernetes Prow Robot
0b05897c30
Merge pull request #112021 from mrunalp/test_host_path_pv_selinux_fix
Set correct SELinux label for host paths volumes created by host path provisioner
2022-12-23 12:35:27 -08:00
TommyStarK
4ff1c86f7f kubelet/cloudresource: Improving test coverage
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2022-12-21 12:04:49 +01:00
Kubernetes Prow Robot
6a48538090
Merge pull request #114326 from sunnylovestiramisu/fixReconstructionBug
Add pod to dsw if termination is not completed during reconstruction
2022-12-20 16:31:24 -08:00
huyinhou
692f8aab27 fix kubelet crash, concurrent map iteration and map write
When kubelet starts a Pod that requires device resources, if the device
plug-in updates the device at the same time, it may cause kubelet to crash.

Signed-off-by: huyinhou <huyinhou@bytedance.com>
2022-12-19 12:45:17 +08:00
TommyStarK
a00221ee50 kubelet/nodestatus: Improving test coverage
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2022-12-18 23:19:47 +01:00
Jordan Liggitt
78cb3862f1
Fix indentation/spacing in comments to render correctly in godoc 2022-12-17 23:27:38 -05:00
Sunny Song
5e8ca18308 Add pod to dsw if termination is not completed during reconstruction #issues/113979 2022-12-16 16:32:34 -08:00
runzhliu
b3aefb7ba5
Update kuberuntime_manager_test.go
Typo fix.
2022-12-15 08:43:01 +08:00
Michael Weibel
8818c215c1 win: fix cpu count to calculate cpu_maximum
take all processor groups into account when calculating cpu maximum.

Signed-off-by: Michael Weibel <michael@helio.exchange>
2022-12-14 13:56:31 +01:00
Kubernetes Prow Robot
68f808e6db
Merge pull request #111371 from sivchari/improve-naming
feat: improve naming
2022-12-14 02:23:37 -08:00
Paco Xu
f28f40e521 remove a flag check that was introduced in #112542; address several comments
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-12-13 14:00:29 +08:00
Aditi Sharma
214a0ee7b8 Migrate container runtime endpoint flag to config
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-12-13 14:00:29 +08:00
SataQiu
4c60ee00aa remove GA featuregates: CSIInlineVolume, CSIMigration, DaemonSetUpdateSurge, EphemeralContainers, IdentifyPodOS, LocalStorageCapacityIsolation, NetworkPolicyEndPort, StatefulSetMinReadySeconds 2022-12-11 19:27:41 +08:00
Kubernetes Prow Robot
50ed8284ab
Merge pull request #114334 from claudiubelu/fix-files-unittest
unittests: Fixes TestReplaceFile for Windows
2022-12-10 09:05:41 -08:00
Kubernetes Prow Robot
767de11f88
Merge pull request #114178 from Octopusjust/k8s-pr19
pkg/kubelet/network/dns: omit unnecessary `fmt.Sprintf`
2022-12-10 06:05:34 -08:00
Kubernetes Prow Robot
7754f007d6
Merge pull request #114169 from jpbetz/improve-kubelet-flag-errors
Improve error messages of flags that parse quantities and percentages
2022-12-10 06:05:11 -08:00
Kubernetes Prow Robot
a668924cb6
Merge pull request #113255 from claudiubelu/path-filepath-update-kubelet
Replaces path.Operation with filepath.Operation (kubelet)
2022-12-09 22:27:41 -08:00
Jordan Liggitt
933494ab8d
Check for initial kubelet certificates more frequently 2022-12-08 08:57:45 -05:00
dengyufeng2206
8525cfab02 Log spelling formatting 2022-12-08 15:02:19 +08:00
Claudiu Belu
ba1195afeb unittests: Fixes TestReplaceFile for Windows
Currently, the test TestReplaceFile/neither_parent_nor_file_exists fails
because the error encountered doesn't match the expected error.

On Windows, if a file is missing, the encountered error is:

The system cannot find the file specified.

And if a folder / parent folder is missing, this error is encoutered instead:

The system cannot find the path specified.
2022-12-07 11:36:13 +00:00
lixiaobing1
fb327ddd15 improve performance 2022-11-29 16:02:47 +08:00
ZhangYu
6553ba246f pkg/kubelet/network/dns: omit unnecessary fmt.Sprintf 2022-11-29 14:44:14 +08:00
Joe Betz
ab3c353227 Improve error messages for parse errors of --kube-reserved, --system-reserved and --qos-reserved 2022-11-28 16:35:26 -05:00
arrowfeng
6a57404e28 kubelet: cleanup secretManager and configManager in podManager
Signed-off-by: arrowfeng <289716347@qq.com>
2022-11-14 23:05:32 +08:00
Ed Bartosh
abcb56defb kubelet: do not enter termination status if pod might need to unprepare resources 2022-11-11 21:58:03 +01:00
Ed Bartosh
ae0f38437c kubelet: add support for dynamic resource allocation
Dependencies need to be updated to use
github.com/container-orchestrated-devices/container-device-interface.

It's not decided yet whether we will implement Topology support
for DRA or not. Not having any toppology-related code
will help to avoid wrong impression that DRA is used as a hint
provider for the Topology Manager.
2022-11-11 21:58:03 +01:00
Kubernetes Prow Robot
2c1b7f5759
Merge pull request #112618 from jingyuanliang/fastStatusUpdateOnce
kubelet: Keep trying fast status update at startup until node is ready
2022-11-09 13:30:53 -08:00
PiotrProkop
540b5bd308 [topologymanager] rely on Cadvisor to calculate NUMA distance
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2022-11-09 17:52:14 +01:00
PiotrProkop
315f0dc6f1 Fix discovering numa distance when node ids are not starting from 0 or their ids are not sequential
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2022-11-09 17:52:08 +01:00
Kubernetes Prow Robot
7e0e0c8ec3
Merge pull request #113360 from mimowo/handling-pod-failures-beta-enable
Enable the "Retriable and non-retriable pod failures for jobs" feature into beta
2022-11-09 08:30:24 -08:00
Jingyuan Liang
9f5c5b82a9 kubelet: Keep trying fast status update at startup until node is ready 2022-11-09 15:55:20 +00:00
Jingyuan Liang
4a50fc4b8c kubelet: Refactor tryUpdateNodeStatus() into smaller functions 2022-11-09 15:52:04 +00:00
Kubernetes Prow Robot
70263d55b2
Merge pull request #113501 from pacoxu/fix-startReflector
kubelet: fix nil pointer in startReflector for standalone mode
2022-11-09 03:50:12 -08:00
Michal Wozniak
c803892bd8 Enable the feature into beta 2022-11-09 09:02:40 +01:00
Paco Xu
1b71dc77f2 linux: fix kubelet start unit test 2022-11-09 07:17:05 +08:00
Kubernetes Prow Robot
b4040b3b86
Merge pull request #113609 from haircommander/sandbox-metrics
kubelet: add support for broadcasting metrics from CRI
2022-11-08 15:08:26 -08:00
Kubernetes Prow Robot
da735b5415
Merge pull request #113596 from jsafrane/selinux-reconstruction
Reconstruct SELinux  mount label
2022-11-08 12:43:03 -08:00
Kubernetes Prow Robot
b3082c5e5b
Merge pull request #113582 from wzshiming/fix/grpc-probe-log
Fix grpc probe log
2022-11-08 12:42:56 -08:00
Peter Hunt
95489a26d6 kubelet: add cri metrics to server
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2022-11-08 14:47:08 -05:00
Peter Hunt
1a7388c2ef kubelet/metrics: add cri_metrics
that pulls metrics from the CRI

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2022-11-08 14:47:08 -05:00
Peter Hunt
6298ce68e2 kubelet: wire ListPodSandboxMetrics
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2022-11-08 14:47:08 -05:00
Daniel Ye
dcc7c2f660 Add fake runtimes and CRI changes for KEP-2371
Added new gRPC call 'ListPodSanboxMetrics' which would return additional
container stats currently supported by cAdvisor, but outside the scope
of /stats/summary api. Added new types to support metric exporting of
prometheus, including Metric and other subfields. Added fake runtime
changes associated with the CRI changes.
2022-11-08 14:47:08 -05:00
Kubernetes Prow Robot
c40d961324
Merge pull request #113718 from mimowo/handling-pod-failures-kubelet-nits
Add comments to clarify the updated logic in kubelet's status_manager
2022-11-08 10:38:51 -08:00
Kubernetes Prow Robot
114594e1d2
Merge pull request #111384 from harche/evented_pleg_pr
Add Support for Evented PLEG
2022-11-08 10:38:19 -08:00
Claudiu Belu
b9bf3e5c49 Replaces path.Operation with filepath.Operation (kubelet)
The path module has a few different functions:
Clean, Split, Join, Ext, Dir, Base, IsAbs. These functions do not
take into account the OS-specific path separator, meaning that they
won't behave as intended on Windows.

For example, Dir is supposed to return all but the last element of the
path. For the path "C:\some\dir\somewhere", it is supposed to return
"C:\some\dir\", however, it returns ".".

Instead of these functions, the ones in filepath should be used instead.
2022-11-08 16:05:48 +00:00
Harshal Patil
86284d42f8
Add support for Evented PLEG
Signed-off-by: Harshal Patil <harpatil@redhat.com>
Co-authored-by: Swarup Ghosh <swghosh@redhat.com>
2022-11-08 20:06:16 +05:30
Jan Safranek
cf912a2512 Update SELinux context log
SELinux context discovered from Pod is not final, it can be cleared when a
volume plugin does not support SELinux or the volume is not
ReadWriteOncePod. Update the existing log line + add a new one for easier
debugging.
2022-11-08 11:17:38 +01:00
Jan Safranek
e575e60ea4 Reconstruct SELinux mount option
When reconstructing volumes from disk after kubelet restart, reconstruct
also context=XYZ mount option and add it to the ActualStateOfWorld.
2022-11-08 11:17:38 +01:00
Michal Wozniak
026b97352f Add comments to clarify the updated logic in kubelet's status_manager 2022-11-08 10:21:25 +01:00
Kubernetes Prow Robot
64af9e03f1
Merge pull request #111597 from 249043822/evictionmessage
make eviction message more clear
2022-11-07 21:52:19 -08:00
Kubernetes Prow Robot
f328d3dc3d
Merge pull request #113291 from mengjiao-liu/fix-podAndContainerStatsFromCRI
Fix stats for podAndContainerStatsFromCRI
2022-11-07 19:48:17 -08:00
ZhangKe10140699
62177fd36d make eviction message more clear 2022-11-08 10:07:02 +08:00
Kubernetes Prow Robot
243ba086e7
Merge pull request #112914 from PiotrProkop/topology-manager-policies-flag
node: topologymanager:  Improved multi-numa alignment in Topology Manager
2022-11-07 16:00:51 -08:00
Kubernetes Prow Robot
47952e0917
Merge pull request #112360 from mimowo/handling-pod-failures-beta-kubelet
Add pod disruption conditions for kubelet-initiated failures
2022-11-07 16:00:40 -08:00
Kubernetes Prow Robot
43a2bb4df4
Merge pull request #111772 from pacoxu/image-pull-time
kubelet: make the image pull time more accurate in event
2022-11-07 14:52:16 -08:00
Kubernetes Prow Robot
1c230d519e
Merge pull request #113262 from jsafrane/rework-reconstruction
Rework volume reconstruction
2022-11-07 12:42:29 -08:00
Kubernetes Prow Robot
2ef00038d3
Merge pull request #112961 from marosset/windows-hostnetwork-alpha
Windows hostnetwork alpha
2022-11-07 12:42:16 -08:00
Michal Wozniak
4e732e20d0 Do not revert the pod condition if there might be running containers, skip condition update instead. 2022-11-07 16:22:29 +01:00
Michal Wozniak
52cd6755eb Add pod disruption conditions for kubelet initiated failures 2022-11-07 11:23:22 +01:00
Jan Safranek
9a98f7318b Increase verbosity of volume reconstruction messages
Add volume reconstruction logs to V(2) to see initial kubelet
ActualStateOfWorld after kubelet start. Kubelet logs SetUp / TearDown
events at V(2) already, so we can track the whole volume mount state in
V(2) logs.
2022-11-07 11:05:27 +01:00
Jan Safranek
286e19c460 Add node name parameter
Add nodeName to MarkVolumeAsAttached. MarkVolumeAsAttached implementation
in kubelet does not use the parameter, but it could do that in the future.
2022-11-07 10:50:23 +01:00
Mengjiao Liu
2940484a9a Fix stats for podAndContainerStatsFromCRI 2022-11-07 10:41:45 +08:00
Paco Xu
41902853fd image pull event include duration with waiting
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-11-06 13:42:44 +08:00
Paco Xu
054ceab58d kubelet: make the image pull time more accurate in event
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-11-06 13:42:44 +08:00
David Ashpole
64af1adace
Second attempt: Plumb context to Kubelet CRI calls (#113591)
* plumb context from CRI calls through kubelet

* clean up extra timeouts

* try fixing incorrectly cancelled context
2022-11-05 06:02:13 -07:00
Mark Rossetti
f4305db4ee
populate namespace options in runtimeapi.WindowsSandboxSecurityContext + unit tests
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-11-04 09:29:39 -07:00
Kubernetes Prow Robot
c8a3657bde
Merge pull request #113307 from andrewsykim/apiserver-identity-hostname
apiserver identity: use persistent names for lease objects
2022-11-04 07:28:25 -07:00
Kubernetes Prow Robot
1bf4af4584
Merge pull request #111930 from azylinski/new-histogram-pod_start_sli_duration_seconds
New histogram: Pod start SLI duration
2022-11-04 07:28:14 -07:00
Jan Safranek
20c5cc0a39 Add unit test for failed mount after reconstruction
To preserve fix in https://github.com/kubernetes/kubernetes/pull/110670,
add an unit test that check a volume is *uncertain* even after final mount
error when it was reconstructed.

And actually fix a regression introduced in the previous patch.
2022-11-04 12:25:21 +01:00
Paco Xu
89e4836dde add ut for kubelet standalone mode 2022-11-04 18:17:51 +08:00
Andrew Sy Kim
72f2e1cc0d lease controller: update NewController to accept leaseName as a parameter, remove NewControllerWithLeaseName
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2022-11-04 00:44:13 -04:00
Kubernetes Prow Robot
79014dd6da
Merge pull request #113216 from astraw99/ftr-add-backoff-container
Add container name in the `BackOff` event message
2022-11-03 21:24:13 -07:00
Jan Safranek
6d810f2cd4 Add unit tests 2022-11-03 17:54:58 +01:00
Jan Safranek
3a79466ddd Reshuffle functions between reconstruct and reconstruc_common
Move common functions to reconstruc_common.go and functions used only for
the current (old) reconstruction to reconstruct.go
2022-11-03 16:55:13 +01:00
Jan Safranek
44b72d0348 Move new reconciler logic into reconciler_new.go
Move reconciler logic from reconstruct{new}.go to:
- reconciler.go - only the functionality used by the current (old)
  reconciler.
- reconciler_new.go - only the functionality used by the new reconciler.
- reconciler_common.go - common functions.
2022-11-03 16:55:13 +01:00
Jan Safranek
fc245b339b Refactor ConstructVolumeSpec
Return a struct from ConstructVolumeSpec to be able to add more fields to
it later.
2022-11-03 16:55:13 +01:00
Jan Safranek
2dc8cc13a4 Remove SyncReconstructedVolume call
With the new reconstruction, AWS.MarkVolumeAsMounted will update outer spec
name with the correct value from Pod.
2022-11-03 16:55:12 +01:00
Jan Safranek
e0f3e5c457 Rework volume reconstruction
Subsequent SELinux work (see http://kep.k8s.io/1710) will need
ActualStateOfWorld populated around the time kubelet starts mounting
volumes.

Therefore reconstruct volumes before starting reconciler, but do not depend
on the desired state of world populated nor node.status - both need a
working API server, which may not be available at that time.

All reconstructed volumes are marked as Uncertain and reconciler will sort
them out - call SetUp to ensure the volume is really mounted when a pod
needs the volume or call TearDown then there is no such pod.

Finish the reconstruction when the API server becomes available:
- Clean up volumes that failed reconstruction and are not needed.

- Update devicePath of reconstructed volumes from node.status. Make sure
  not to overwrite devicePath that may have been updated when the volume
  was mounted by reconcile().

Hiding all this rework behind SELinuxMountReadWriteOncePod FeatureGate,
just to make sure we have a way back if this commit is buggy.
2022-11-03 16:55:12 +01:00
Shiming Zhang
101bfb5522 Fix grpc probe log 2022-11-03 18:05:39 +08:00
Paco Xu
57a3af1f87 kubelet: don't set secret and configmap manager if running in standalone mode 2022-11-03 17:46:52 +08:00
PiotrProkop
75bb437a6b Improved multi-numa alignment in Topology Manager: implement closest numa policy
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2022-11-03 10:45:25 +01:00
PiotrProkop
d5dd42dfac Improved multi-numa alignment in Topology Manager: introduce TopologyManagerOptions
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2022-11-03 10:45:21 +01:00
PiotrProkop
58ef3f202a Improved multi-numa alignment in Topology Manager: add NUMAInfo
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2022-11-03 10:45:09 +01:00
PiotrProkop
daee219210 Improved multi-numa alignment in Topology Manager: add topology-manager-policy-options flag in Kubelet
This patch adds new Kubelet option topologyManagerPolicyOptions.
To introduce new TopologyManager options, first we need to introduce new
flag called `topology-manager-policy-options` to allow users to modify
behaviour of best-effort and restricted policies.

Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2022-11-03 09:45:33 +01:00
Sascha Grunert
f9707064cf
Remove CRI v1alpha2
After the removal of dockershim we can finally also drop support for CRI
v1alpha2.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-11-03 09:13:43 +01:00
Kubernetes Prow Robot
98742f9d77
Merge pull request #110747 from harshanarayana/cleanup/GIT-110737/logging-improvements
structured-logging: replace KObjs with KObjSlice for logging
2022-11-03 00:49:34 -07:00
Kubernetes Prow Robot
6754265580
Merge pull request #109757 from STRRL/enriching-unit-test-for-container-manager
Add testcases for pkg/kubelet/cm/pod_container_manager_linux.go
2022-11-02 23:45:35 -07:00
Kubernetes Prow Robot
3cf75a2f76
Merge pull request #103177 from arkbriar/support_cancelable_exec_stream
Support cancelable SPDY executor stream
2022-11-02 19:47:36 -07:00
Kubernetes Prow Robot
433787d25b
Merge pull request #113018 from fromanirh/cpumanager-ga-features
node: kubelet: cpumgr: CPU Manager to GA
2022-11-02 14:41:01 -07:00
Kubernetes Prow Robot
25dc4c4f32
Merge pull request #112980 from swatisehgal/devicemanager-ga-graduation
node: devicemgr: Graduate Kubelet DeviceManager to GA
2022-11-02 13:17:01 -07:00
Francesco Romani
a6b928d90c kubelet: cpumgr: internal variable trivial rename
CPUManager is going GA, thus it makes little sense
to keep the names of the internal configuration
variables `Experimental*`.

Trivial rename only.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2022-11-02 18:41:42 +01:00
Francesco Romani
5e12338a22 node: cpumgr: address golint complains
Add docstrings and trivial fixes.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2022-11-02 18:41:42 +01:00
Francesco Romani
ff44dc1932 cpumanager: the FG is locked to default (ON)
hence we can remove the if() guards, the feature
is always available.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2022-11-02 18:41:41 +01:00
Jan Safranek
989e391d08 Move all volume reconstruction code into separate files
There is no code change, just moving code around and preparing for the
subsequent commit.
2022-11-02 15:58:21 +01:00
Antonio Ojea
9c2b333925 Revert "plumb context from CRI calls through kubelet"
This reverts commit f43b4f1b95.
2022-11-02 13:37:23 +00:00
astraw99
244598af80 Add back-off restarting failed container name 2022-11-02 20:46:32 +08:00
Swati Sehgal
40741681a2 node: devicemgr: Address warnings from golint
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2022-11-02 11:05:20 +00:00
Swati Sehgal
8b29eded52 node: devicemgr: Remove devicePluginEnabled field from container mgr
With graduation of device plugins to GA in 1.26, the feature gate is
enabled by default so `devicePluginEnabled` field no longer needs to
be passed at the time of Container Manager creation.

In addition to that, we remove the `ManagerStub` as it is no longer
needed.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2022-11-02 11:05:20 +00:00
Swati Sehgal
752fa093e0 node: devicemgr: GA graduation implies Feature Gate is ON by default
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2022-11-02 11:05:20 +00:00
Kubernetes Prow Robot
5899432f92
Merge pull request #113481 from rphillips/fixes/77063
kubelet: fix pod log line corruption when using timestamps and long lines
2022-11-01 19:59:50 -07:00
Kubernetes Prow Robot
9bbd0fbdb2
Merge pull request #113476 from marosset/hpc-to-stable
Promoting WindowsHostProcessContainers to stable
2022-11-01 19:59:43 -07:00
Kubernetes Prow Robot
7b84436168
Merge pull request #113408 from dashpole/kubelet_context
Plumb context to Kubelet CRI calls
2022-11-01 19:59:08 -07:00
Kubernetes Prow Robot
2452a95bd4
Merge pull request #112796 from SataQiu/clean-kubelet-20220930
kubelet: remove the unused constant AnnotationInvalidReason since sysctl annotations are deprecated and migrated to fields
2022-11-01 14:56:45 -07:00
Mark Rossetti
498d065cc5
Promoting WindowsHostProcessContainers to stable
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-11-01 14:06:25 -07:00
Kubernetes Prow Robot
9b72f20156
Merge pull request #112373 from loktev-d/k8s_109717
Add unit tests for active_deadline.go
2022-11-01 12:54:44 -07:00
Kubernetes Prow Robot
1a41cb8985
Merge pull request #113021 from rphillips/fixes/112936
kubelet: fix nil crash in allocateRemainingFrom
2022-11-01 10:46:45 -07:00
Kubernetes Prow Robot
e6060f2780
Merge pull request #111220 from giuseppe/drop-superfluous-function
kubelet: remove superfluous function
2022-11-01 09:34:45 -07:00
Ryan Phillips
ddae396ce3 kubelet: fix pod log line corruption when using timestamps and long lines 2022-11-01 09:22:30 -05:00
Kubernetes Prow Robot
2d14d50b31
Merge pull request #113406 from jsafrane/fix-selinux-check-of-mounted
Fix SELinux check of mounted volumes
2022-11-01 04:14:45 -07:00
Kubernetes Prow Robot
4c657e5014
Merge pull request #110403 from claudiubelu/unittests-3
unittests: Fixes unit tests for Windows (part 3)
2022-10-31 15:52:44 -07:00
Kubernetes Prow Robot
f892ab1bd7
Merge pull request #113405 from jsafrane/reduce-log-noise-on-selinux
Reduce log noise on SELinux mount mismatch
2022-10-31 13:14:56 -07:00
Jan Safranek
d37808faae Report error on a pod startup on SELinux mismatch
When a volume is already mounted with an unexpected SELinux label,
kubelet must unmount it first and then mount it back with the expected one.
Report an error to user, just in case the unmount takes too long.

In therory, this error should not happen too often, because two Pods with
different SELinux label will not enter Desired State of World, see
dsw.AddPodToVolume. It can happen when DSW and ASW SELinux labels only when
a volume has been deleted from DSW (= Pod was deleted) or a volume was
reconstructed after kubelet restart. In both cases, volume manager should
unmount the volume quickly.
2022-10-31 13:59:23 +01:00
Jan Safranek
805482413a Fix SELinux check of mounted volumes
In PodExistsInVolume with volumeObj.seLinuxMountContext != nil we know that
the volume has been previously mounted with a given SELinuxMountContext.

Either it has been mounted by this kubelet and we know it's correct or it
was by a previous instance of kubelet and the context has been
reconstructed from the filesystem. In both cases, the actual context is
correct, regardless if the volume plugin or PV access mode supports SELinux
mounts.
2022-10-31 13:39:48 +01:00
Kubernetes Prow Robot
d0e86111ef
Merge pull request #112855 from fromanirh/cpumanager-metrics
node: metrics: cpumanager: add metrics about pinning
2022-10-31 03:12:56 -07:00
Kubernetes Prow Robot
9702161caa
Merge pull request #112597 from mythi/grpc-authority
grpc: set localhost Authority to unix client calls
2022-10-31 03:12:45 -07:00
David Ashpole
f43b4f1b95
plumb context from CRI calls through kubelet 2022-10-28 02:55:28 +00:00
Jan Safranek
a910d83070 Reduce log noise on SELinux mount mismatch
The Desired State of World can require a different SELinux mount context than
is in the Actual State of World and it's perfectly OK. For example when
user changes SELinux context of Pods or when the context is reconstructed
after kubelet restart.

Don't spam log and don't report errors to the user as event - reconciler
will do the right thing and unmount the old volume (with wrong context) and
mount a new one in the next reconciliation. It's not an error, it's
expected workflow.
2022-10-27 18:00:42 +02:00
Kubernetes Prow Robot
ab4907d2f4
Merge pull request #112913 from Garrybest/pr_cpumanager
fix GetAllocatableCPUs in cpumanager
2022-10-27 07:20:33 -07:00
Francesco Romani
47d3299781 node: metrics: cpumanager: add pinning metrics
In order to improve the observability of the cpumanager,
add and populate metrics to track if the combination of
the kubelet configuration and podspec would trigger
exclusive core allocation and pinning.

We should avoid leaking any node/machine specific information
(e.g. core ids, even though this is admittedly an extreme example);
tracking these metrics seems to be a good first step, because
it allows us to get feedback without exposing details.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2022-10-27 14:40:40 +02:00
Garrybest
95eb5670cf add GetAllocatableCPUs test in cpumanager
Signed-off-by: Garrybest <garrybest@foxmail.com>
2022-10-27 19:57:12 +08:00
Garrybest
d446f5f90e fix GetAllocatableCPUs in cpumanager
Signed-off-by: Garrybest <garrybest@foxmail.com>
2022-10-27 19:57:06 +08:00
Artur Żyliński
8a5fbce96e Fix cond: Check if pod started 2022-10-26 16:05:19 +02:00
Artur Żyliński
492f5fa82c Regenerate mocks 2022-10-26 11:31:50 +02:00
Artur Żyliński
b0fac15cd6 Make the interface local to each package 2022-10-26 11:28:18 +02:00
Artur Żyliński
9f31669a53 New histogram: Pod start SLI duration 2022-10-26 11:28:17 +02:00
Kubernetes Prow Robot
244c035b87
Merge pull request #110263 from claudiubelu/unittests
unittests: Fixes unit tests for Windows
2022-10-25 14:50:34 -07:00
Claudiu Belu
6f2eeed2e8 unittests: Fixes unit tests for Windows
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- config options not supported on Windows.
- files not closed, which means that they cannot be removed / renamed.
- paths not properly joined (filepath.Join should be used).
- time.Now() is not as precise on Windows, which means that 2
  consecutive calls may return the same timestamp.
- different error messages on Windows.
- files have \r\n line endings on Windows.
- /tmp directory being used, which might not exist on Windows. Instead,
  the OS-specific Temp directory should be used.
- the default value for Kubelet's EvictionHard field was containing
  OS-specific fields. This is now moved, the field is now set during
  Kubelet's initialization, after the config file is read.
2022-10-25 23:46:56 +03:00
Kubernetes Prow Robot
6a709cf07b
Merge pull request #113194 from saltbo/refa-replace-ioutil
Replace the ioutil by the os and io for the pkg/util
2022-10-23 18:08:24 -07:00
saltbo
6f878d92fb
fix: update the fsstore_test.go
Signed-off-by: saltbo <saltbo@foxmail.com>
2022-10-23 21:51:48 +08:00
Kubernetes Prow Robot
a497c56c33
Merge pull request #113030 from Richabanker/kubelet-metrics-slis
add metrics/slis to kubelet health checks
2022-10-21 10:35:52 -07:00
Claudiu Belu
9f95b7b18c unittests: Fixes unit tests for Windows (part 3)
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- paths not properly joined (filepath.Join should be used).
- Proxy Mode IPVS not supported on Windows.
- DeadlineExceeded can occur when trying to read data from an UDP
  socket. This can be used to detect whether the port was closed or not.
- In Windows, with long file name support enabled, file names can have
  up to 32,767 characters. In this case, the error
  windows.ERROR_FILENAME_EXCED_RANGE will be encountered instead.
- files not closed, which means that they cannot be removed / renamed.
- time.Now() is not as precise on Windows, which means that 2
  consecutive calls may return the same timestamp.
- path.Base() will return the same path. filepath.Base() should be used
  instead.
- path.Join() will always join the paths with a / instead of the OS
  specific separator. filepath.Join() should be used instead.
2022-10-21 19:25:48 +03:00
Kubernetes Prow Robot
9bcb81e13f
Merge pull request #113175 from liggitt/pr_normalize_probes_lifecycle_handlers
Record event and metric for lifecycle fallback to http
2022-10-20 02:31:08 -07:00
Kubernetes Prow Robot
ad26b315f2
Merge pull request #86139 from jasimmons/pr_normalize_probes_lifecycle_handlers
Normalize HTTP  lifecycle handlers with HTTP probers
2022-10-19 17:44:56 -07:00
Kubernetes Prow Robot
45636684a4
Merge pull request #112897 from fromanirh/podresources-metrics-e2e-tests
register podresources metrics
2022-10-19 13:57:18 -07:00
Jordan Liggitt
a5d785fae8
Record metric for lifecycle fallback to http 2022-10-19 14:45:25 -04:00
Jordan Liggitt
122b43037e
Record event for lifecycle fallback to http 2022-10-19 14:11:36 -04:00
Kubernetes Prow Robot
bf14677914
Merge pull request #112546 from oscr/the-the
grammar: replace all occurrences of "the the" with "the"
2022-10-19 10:03:02 -07:00
Billie Cleek
dfaaa144ab fallback to http when lifecycle handler request should have been https 2022-10-19 09:51:52 -07:00
Jason Simmons
5a6acf85fa Align lifecycle handlers and probes
Align the behavior of HTTP-based lifecycle handlers and HTTP-based
probers, converging on the probers implementation. This fixes multiple
deficiencies in the current implementation of lifecycle handlers
surrounding what functionality is available.

The functionality is gated by the features.ConsistentHTTPGetHandlers feature gate.
2022-10-19 09:51:52 -07:00
Richa Banker
047f6a736b add metrics/slis to kubelet health checks 2022-10-18 14:06:20 -07:00
Kubernetes Prow Robot
2522420937
Merge pull request #111601 from claudiubelu/skip-unittests
unit tests: Skip Windows-unrelated tests on Windows
2022-10-18 11:29:30 -07:00
Kubernetes Prow Robot
23721935d3
Merge pull request #113129 from chaunceyjiang/pr_remove_redundant_conversion
Remove redundant type conversion
2022-10-18 10:23:19 -07:00
Kubernetes Prow Robot
843ad71cac
Merge pull request #113041 from saschagrunert/kubelet-pods-creation-time
Sort kubelet pods by their creation time
2022-10-18 09:17:19 -07:00
Claudiu Belu
af77381e01 unit tests: Skip Windows-unrelated tests on Windows
Some of the unit tests cannot pass on Windows due to various reasons:

- fsnotify does not have a Windows implementation.
- Proxy Mode IPVS not supported on Windows.
- Seccomp not supported on Windows.
- VolumeMode=Block is not supported on Windows.
- iSCSI volumes are mounted differently on Windows, and iscsiadm is a
  Linux utility.
2022-10-18 12:43:07 +03:00
chaunceyjiang
d2b372e029 Remove redundant type conversion
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
2022-10-18 14:37:40 +08:00
Kubernetes Prow Robot
6f579d3ceb
Merge pull request #111616 from ndixita/credential-api-ga
Move the Kubelet Credential Provider feature to GA and Update the Credential Provider API to GA
2022-10-15 07:53:09 -07:00
Oscar Utbult
e4f776f230 grammar: replace all occurrences of "the the" with "the" 2022-10-14 09:03:14 +02:00
Sascha Grunert
b296f82c69
Sort kubelet pods by their creation time
There is a corner case when blocking Pod termination via a lifecycle
preStop hook, for example by using this StateFulSet:

```yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: web
spec:
  selector:
    matchLabels:
      app: ubi
  serviceName: "ubi"
  replicas: 1
  template:
    metadata:
      labels:
        app: ubi
    spec:
      terminationGracePeriodSeconds: 1000
      containers:
      - name: ubi
        image: ubuntu:22.04
        command: ['sh', '-c', 'echo The app is running! && sleep 360000']
        ports:
        - containerPort: 80
          name: web
        lifecycle:
          preStop:
            exec:
              command:
              - /bin/sh
              - -c
              - 'echo aaa; trap : TERM INT; sleep infinity & wait'
```

After creation, downscaling, forced deletion and upscaling of the
replica like this:

```
> kubectl apply -f sts.yml
> kubectl scale sts web --replicas=0
> kubectl delete pod web-0 --grace-period=0 --force
> kubectl scale sts web --replicas=1
```

We will end up having two pods running by the container runtime, while
the API only reports one:

```
> kubectl get pods
NAME    READY   STATUS    RESTARTS   AGE
web-0   1/1     Running   0          92s
```

```
> sudo crictl pods
POD ID              CREATED              STATE     NAME     NAMESPACE     ATTEMPT     RUNTIME
e05bb7dbb7e44       12 minutes ago       Ready     web-0    default       0           (default)
d90088614c73b       12 minutes ago       Ready     web-0    default       0           (default)
```

When now running `kubectl exec -it web-0 -- ps -ef`, there is a random chance that we hit the wrong
container reporting the lifecycle command `/bin/sh -c echo aaa; trap : TERM INT; sleep infinity & wait`.

This is caused by the container lookup via its name (and no podUID) at:
02109414e8/pkg/kubelet/kubelet_pods.go (L1905-L1914)

And more specifiy by the conversion of the pod result map to a slice in `GetPods`:
02109414e8/pkg/kubelet/kuberuntime/kuberuntime_manager.go (L407-L411)

We now solve that unexpected behavior by tracking the creation time of
the pod and sorting the result based on that. This will cause to always
match the most recently created pod.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-10-13 16:32:44 +02:00
Paco Xu
2ce7a81169 fsnotify: use event.Has instead of "event.Op&h == h" 2022-10-13 13:42:26 +08:00
weizhichen
5d514601a8 gofmt 2022-10-13 01:47:08 +00:00
Ryan Phillips
2514486d80 kubelet: fix nil crash in allocateRemainingFrom 2022-10-12 12:51:17 -05:00
arkbriar
42808c8343 Support cancelable SPDY executor stream
Mark remotecommand.Executor as deprecated and related modifications.

Handle crash when streamer.stream panics

Add a test to verify if stream is closed after connection being closed

Remove blank line and update waiting time to 1s to avoid test flakes in CI.

Refine the tests of StreamExecutor according to comments.

Remove the comment of context controlling the negotiation progress and misc.

Signed-off-by: arkbriar <arkbriar@gmail.com>
2022-10-09 15:24:00 +08:00
Daniil Loktev
e954eeb255 Add comment for 0th case 2022-10-08 12:06:42 +03:00
Francesco Romani
ba6b468982 node: metrics: register podresources metrics
Because of a bug in the commit 1e7bb20c52,
podresources metrics were added, they are updated in the right
places, but they are never exported, so they cannot be consumed.
Fix trivially registering the metrics.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2022-10-06 15:14:56 +02:00
Kubernetes Prow Robot
98233be715
Merge pull request #112709 from swagatbora90/kubelet-tracing
Support otel tracing in cri remote image service
2022-10-04 14:12:00 -07:00
Andrew Sy Kim
4e2a2b6053
Revert "Avoid tainting with NoSchedule when DisableCloudProviders feature is on" 2022-10-03 15:13:43 -04:00
Davanum Srinivas
8b9a5b2dff
Avoid tainting with NoSchedule when DisableCloudProviders feature is on
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-10-02 13:00:58 -04:00
Kubernetes Prow Robot
02109414e8
Merge pull request #112542 from astraw99/fix-runtime-validate
Add validation for runtime endpoint flag
2022-09-30 18:04:24 -07:00
Kubernetes Prow Robot
be22f605cf
Merge pull request #112097 from wongearl/cleanup_loop
use copy() instead of a loop
2022-09-30 18:04:12 -07:00
Kubernetes Prow Robot
ad64f9c4dc
Merge pull request #112631 from tzneal/reword-image-gc-failure-log
reword image gc failure log
2022-09-30 16:56:35 -07:00
jesse.tang
759e043136
Optimize: file /cpuset slice make cap (#112270) 2022-09-30 16:56:25 -07:00
Kubernetes Prow Robot
5bcdc82911
Merge pull request #112184 from danwinship/kubelet-node-ip-annotation-cleanup
Delete the cloud node IP annotation if it is stale
2022-09-30 16:56:13 -07:00
SataQiu
7308b83a99 remove the unused constant AnnotationInvalidReason since sysctl annotations are deprecated and migrated to fields 2022-09-30 14:53:46 +08:00
Kubernetes Prow Robot
4276ed3628
Merge pull request #112414 from pacoxu/kubelet-multi-options
kubelet: append options to pod if there are multi options in /etc/resolv.conf
2022-09-29 21:10:28 -07:00
Swagat Bora
caa83c25ae Support otel tracing in cri remote image service
Signed-off-by: Swagat Bora <sbora@amazon.com>
2022-09-29 22:15:07 +00:00
Kubernetes Prow Robot
3af1e5fdf6
Merge pull request #112707 from enj/enj/i/https_links
Use https links for k8s KEPs, issues, PRs, etc
2022-09-29 12:34:40 -07:00
Dixita Narang
ff1f525511 Setting LockToDefault as true for KubeletCredentialProviders feature, and removing conditions that check if the feature is enabled since now the feature is enabled by default 2022-09-29 16:42:48 +00:00
astraw99
805be30745 Add validation for runtime endpoint 2022-09-28 10:33:35 +08:00
Kubernetes Prow Robot
00532e305a
Merge pull request #107896 from smarterclayton/track_pod_sync_latency
kubelet: Record a metric for latency of pod status update
2022-09-27 14:25:50 -07:00
Kubernetes Prow Robot
5579ddea8a
Merge pull request #112644 from vitorfhc/issue-112605
Improves message for pod status in rejectPod
2022-09-27 11:32:02 -07:00
Kubernetes Prow Robot
efc306a12d
Merge pull request #112316 from dengyufeng2206/0908test
fix test order in pkg/kubelet/sysctl/util_test.go
2022-09-27 11:31:50 -07:00
Monis Khan
b738be9b46
Use https links for k8s KEPs, issues, PRs, etc
Signed-off-by: Monis Khan <mok@microsoft.com>
2022-09-23 23:36:24 +00:00
Kubernetes Prow Robot
4e105c4814
Merge pull request #111343 from niulechuan/add_unit_test_for_asw
Add unit test in kubelet volumemanager ASW: Detach a volume that had been mounted by pod should be skipped
2022-09-23 07:04:25 -07:00
Vitor Falcao
0beafd1a5a Improved message for pod status in rejectPod
Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2022-09-21 21:46:52 +00:00
Ryan Phillips
205adec698 kubelet: increase log level for Path does not exist message 2022-09-21 14:16:44 -05:00
Todd Neal
9e83c2d7eb reword image gc failure log
Reword the log so that it sounds less like a failure of kubelet and points
towards the root cause of not enough data being eligible to free.
2022-09-20 21:57:59 -05:00
Mikko Ylinen
fbcdf48bb8 grpc: set localhost Authority to unix client calls
Several reports exist (both with device plugins and CSI) that
kubelet w/ grpc-go sends invalid Authority header and some non
grpc-go servers reject these unix domain socket client connections.

grpc-go sets the Authority header correct when the dial address
is in a format where the its address scheme can be determined.

Instead of making changes to get the all server addresses to unix://
prefixed format, set grpc.WithAuthority("localhost") client connection
override to get the same result.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-09-20 13:15:36 +03:00
Paco Xu
3bbd025982 ut: compare dns options without order 2022-09-20 11:45:43 +08:00
Paco Xu
468b2a2297 kubelet: append options to pod if there are multi options in /etc/resolv.conf 2022-09-20 10:40:54 +08:00
Kubernetes Prow Robot
127f33f63d
Merge pull request #111221 from inosato/remove-ioutil-from-kubelet
Remove ioutil in kubelet/kubeadm and its tests
2022-09-17 21:56:28 -07:00
inosato
7dc1f5e30b Fix comments 2022-09-18 12:51:03 +09:00
Dixita Narang
9c3cb6e66d Fixing boilerplate header 2022-09-16 21:20:30 +00:00
Kubernetes Prow Robot
c45ca46cdb
Merge pull request #112387 from mythi/kubelet-devicemanager-topologyinfo
devicemanager: do not leak empty TopologyInfo to TopologyManager
2022-09-14 07:17:00 -07:00
Mikko Ylinen
68bb0935bd devicemanager: do not leak empty TopologyInfo to TopologyManager
Device Plugins that wish to leverage the Topology Manager can send back a populated
TopologyInfo struct as part of the device registration, along with the device IDs
and the health of the device. TopologyInfo is converted to TopologyHints and
used by TopologyManager to find the optimal/desired resource allocation for a Pod.

If a plugin sends an empty but non-nil instance of TopologyInfo for a resource,
devicemanager passes it on as an empty instance of TopologyHint which is
currently interpreted as "Hint Provider has no possible NUMA affinities
for resource" which further means that pods requesting that resource will fail.

To not block device resources that pass TopologyInfo{Nodes:[]*NUMANode{}} from being
used, interprete that as nil set of hints and not a []TopologyHint{}.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-09-14 16:13:31 +03:00
Kubernetes Prow Robot
74469ca4c5
Merge pull request #112123 from paskal/paskal/cfs_clarification
clarify CPUCFSQuotaPeriod values, set the minimum to 1ms
2022-09-12 07:01:25 -07:00
Daniil Loktev
229ce27ae4 Add unit tests for active_deadline.go 2022-09-10 11:02:36 +03:00
Dixita Narang
4cc741955c Adding default values for v1 credential provider config 2022-09-09 06:11:15 +00:00
Dixita Narang
977a8ebb3a Renaming usage of v1beta1 to v1, and adding API violation exceptions and
vendor module for v1
2022-09-09 06:11:06 +00:00
Dmitry Verkhoturov
d0f9e6dc36 clarify CPUCFSQuotaPeriod values, set the minimum to 1ms
cpu.cfs_period_us is measured in microseconds in the kernel but
provided in time.Duration by the user, that change clarifies the code
to make this evident to the reader.

Also, the minimum value for that feature is 1ms and not 1μs, and this
change alters the validation to reject values smaller than 1ms.
2022-09-08 23:29:13 +02:00
Clayton Coleman
e9a5fb7372
kubelet: Record a metric for latency of pod status update
Track how long it takes for pod updates to propagate from detection
to successful change on API server. Will guide future improvements
in pod start and shutdown latency.

Metric is `kubelet_pod_status_sync_duration_seconds` and is ALPHA
stability. Histogram buckets are chosen based on distribution of
observed status delays in practice.
2022-09-08 12:17:44 -04:00
dengyufeng2206
e20071792f fix test order in pkg/kubelet/sysctl/util_test.go
Signed-off-by: dengyufeng2206 <deng.yufeng@zte.com.cn>
2022-09-08 17:20:22 +08:00
Kubernetes Prow Robot
6d1e9150d0
Merge pull request #108855 from haircommander/podStatsFix
kubelet/stats: deduplicate makePodStorageStats
2022-09-06 12:58:22 -07:00
Kubernetes Prow Robot
780fe01858
Merge pull request #111935 from giuseppe/userns-manager-use-bitmask-pkg-registry
kubelet: drop bitArray implementation
2022-09-06 10:27:51 -07:00
Dan Winship
e23f1a68af Delete the cloud node IP annotation if it is stale
If you run "kubelet --cloud-provider X --node-ip Y", kubelet will set
an annotation on the node, but previously, if you then ran just
"kubelet --cloud-provider X" (or just "kubelet --node-ip Y"), it
wouldn't delete the stale annotation. Fix that.
2022-09-01 16:43:18 -04:00
Dalton Hubble
7850097fd0 Avoid propagating search . into containers /etc/resolv.conf
* Adapt https://github.com/kubernetes/kubernetes/pull/109441 but
ensures that `search .` does not get propagated into containers'
/etc/resolv.conf. There is no reason to put `.` in a container's
search field and it causes issues for musl
2022-09-01 12:07:18 -07:00
Kubernetes Prow Robot
67d75db890
Merge pull request #111932 from azylinski/rm-lastContainerStartedTime-lru
Cleanup: Remove unused lastContainerStartedTime time.Cache lru
2022-08-29 09:54:37 -07:00
wongearl
47bd712b81 use copy() instead of a loop 2022-08-29 17:55:16 +08:00
Antonio Ojea
d434c588d7 Revert "change CPUCFSQuotaPeriod default value to 100us to match Linux default"
This reverts commit f2d591fae6.
2022-08-26 23:51:04 +02:00
sivchari
c62a7cdb32 fix: test 2022-08-26 01:25:44 +09:00
sivchari
12d49b6bfb fix: rename 2022-08-26 00:44:31 +09:00
Kubernetes Prow Robot
bc9f48b841
Merge pull request #112024 from cndoit18/remove-redundant-judgment
style: remove redundant judgment
2022-08-25 07:28:18 -07:00
Kubernetes Prow Robot
2b5475b3fa
Merge pull request #111554 from paskal/paskal/clarify_default_cfs_period
Clarify cpu.cfs_period_us default value
2022-08-25 07:28:07 -07:00
cndoit18
ec43037d0f style: remove redundant judgment
Signed-off-by: cndoit18 <cndoit18@outlook.com>
2022-08-25 12:07:36 +08:00
Mrunal Patel
65e693eccb Set correct SELinux label for host paths volumes created by host path provisioner
These host paths have a well known location under /tmp/hostpath_pv
and are therefore safe to be labeled with the shared SELinux label.

Without this label, the mounted volumes cannot be accessed by the
container processes.

Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2022-08-24 17:57:47 -07:00
Kubernetes Prow Robot
70254065ea
Merge pull request #109966 from zhangxyjlu/config_validation_test
Add validation test for features.GracefulNodeShutdownBasedOnPodPriority
2022-08-24 00:02:24 -07:00
Kubernetes Prow Robot
08aac4f0ac
Merge pull request #111520 from paskal/paskal/clarify_cfs_period_us
Change CPUCFSQuotaPeriod default value from 100ms to 100us to match Linux default
2022-08-23 20:07:48 -07:00