Commit Graph

2158 Commits

Author SHA1 Message Date
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
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
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
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
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
Antonio Ojea
9c2b333925 Revert "plumb context from CRI calls through kubelet"
This reverts commit f43b4f1b95.
2022-11-02 13:37:23 +00:00
David Ashpole
f43b4f1b95
plumb context from CRI calls through kubelet 2022-10-28 02:55:28 +00: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
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
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
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
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
Artur Żyliński
15566d3d89 Cleanup: Remove unused lastContainerStartedTime time.Cache lru 2022-08-19 14:57:29 +02:00
Kubernetes Prow Robot
442574f3a7
Merge pull request #111513 from jingxu97/july/localstorage
Promote Local storage capacity isolation feature to GA
2022-08-03 13:05:59 -07:00
Giuseppe Scrivano
63462285d5 kubelet: add userns manager
it is used to allocate and keep track of the unique users ranges
assigned to each pod that runs in a user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
Co-authored-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-08-03 19:53:22 +02:00
jinxu
0064010cdd Promote Local storage capacity isolation feature to GA
This change is to promote local storage capacity isolation feature to GA

At the same time, to allow rootless system disable this feature due to
unable to get root fs, this change introduced a new kubelet config
"localStorageCapacityIsolation". By default it is set to true. For
rootless systems, they can set this configuration to false to disable
the feature. Once it is set, user cannot set ephemeral-storage
request/limit because capacity and allocatable will not be set.

Change-Id: I48a52e737c6a09e9131454db6ad31247b56c000a
2022-08-02 23:45:48 -07:00
Sally O'Malley
47e7d8034f
kubelet tracing
Signed-off-by: Sally O'Malley <somalley@redhat.com>
Co-authored-by: David Ashpole <dashpole@google.com>
2022-08-01 12:55:02 -04:00
Paco Xu
e073b0fd65 Disable AcceleratorUsage Metrics: ga 2022-07-30 12:31:43 +08:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Adrian Reber
fc37a7a990
kubelet: wire checkpoint container support through
This adds the last pieces to wire through the container checkpoint
support in the kubelet.

Signed-off-by: Adrian Reber <areber@redhat.com>
2022-07-14 10:27:41 +00:00
Adrian Reber
564f0e9a25
kubelet: add checkpoint/restore infrastructure
This adds the first infrastructure code parts to the kubelet
to support checkpoint/restore.

Signed-off-by: Adrian Reber <areber@redhat.com>
2022-07-14 10:27:40 +00:00
Harsha Narayana
c3cbc443ef
structured-logging: replace KObjs with KObjSlice for logging 2022-07-01 09:52:07 +05:30
Patrick Ohly
65385fec20 kubelet: convert node shutdown manager to contextual logging
This will make output checking easier (done in a separate commit). kubelet
itself still uses the global logger.
2022-06-24 11:20:34 +02:00
Ryan Phillips
230124f3d4 kubelet: add e2e test to verify probe readiness 2022-06-06 17:00:55 -05:00
Clayton Coleman
1d518adb76 kubelet: Pod probes should be handled by pod worker
The pod worker is the owner of when a container is running or not,
and the start and stop of the probes for a given pod should be
handled during the pod sync loop. This ensures that probes do not
continue running even after eviction.

Because the pod semantics allow lifecycle probes to shorten grace
period, the probe is removed after the containers in a pod are
terminated successfully. As an optimization, if the pod will have
a very short grace period (0 or 1 seconds) we stop the probes
immediately to reduce resource usage during eviction slightly.

After this change, the probe manager is only called by the pod
worker or by the reconcile loop.
2022-06-06 17:00:54 -05:00
Jordan Liggitt
410ac59c0d Remove PodSecurityPolicy admission plugin 2022-05-04 16:00:56 -04:00
Kubernetes Prow Robot
a6e65a246c
Merge pull request #107986 from wzshiming/promote/shutdown-based-on-pod-priority
Promote graceful shutdown based on pod priority to beta
2022-03-23 08:06:09 -07:00
Clayton Coleman
69a3820214
kubelet: Delay writing a terminal phase until the pod is terminated
Other components must know when the Kubelet has released critical
resources for terminal pods. Do not set the phase in the apiserver
to terminal until all containers are stopped and cannot restart.

As a consequence of this change, the Kubelet must explicitly transition
a terminal pod to the terminating state in the pod worker which is
handled by returning a new isTerminal boolean from syncPod.

Finally, if a pod with init containers hasn't been initialized yet,
don't default container statuses or not yet attempted init containers
to the unknown failure state.
2022-03-16 13:15:00 -04:00
Shiming Zhang
5eb3e88f6b Support metrics for node shutdown 2022-03-11 17:31:10 +08:00
Kubernetes Prow Robot
06e107081e
Merge pull request #104732 from mengjiao-liu/remove-flag-experimental-check-node-capabilities-before-mount
kubelet: Remove the deprecated flag `--experimental-check-node-capabilities-before-mount`
2022-02-24 07:56:30 -08:00
Kubernetes Prow Robot
1659924a97
Merge pull request #108070 from jsafrane/remove-selinux
Remove util/selinux package
2022-02-11 18:19:47 -08:00
Jan Safranek
77aa06d0c8 Remove util/selinux package
The package says:

> the libcontainer SELinux package is only built for Linux, so it is
> necessary to have a NOP wrapper which is built for non-Linux platforms

This is not true, Kubernetes now imports
github.com/opencontainers/selinux/go-selinux and it has proper
multiplatform support (i.e. NOOP on non-Linux platforms).

Removing the whole package and calling go-selinux directly.
2022-02-11 15:20:35 +01:00
Ciprian Hacman
0819451ea6 Clean up logic for deprecated flag --container-runtime in kubelet
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-02-10 13:26:59 +02:00
Kubernetes Prow Robot
8d01b02c60
Merge pull request #107096 from hakman/remove_non-masquerade-cidr
Remove deprecated flag --non-masquerade-cidr in kubelet
2022-02-08 12:42:50 -08:00
Kubernetes Prow Robot
4dba52cdf4
Merge pull request #107821 from liggitt/kubelet-secret-manager
Move kubelet secret and configmap manager calls to sync_Pod functions
2022-01-27 08:26:58 -08:00
Jordan Liggitt
085693eff2 Move kubelet secret and configmap manager calls to sync_Pod functions 2022-01-27 10:09:13 -05:00
Marcel Zięba
b4b4b8fd6d Use FakeProber in kubemark clusters 2022-01-26 09:29:04 +00:00
Sergey Kanzhelev
7e7bc6d53b remove DynamicKubeletConfig logic from kubelet 2022-01-19 22:38:04 +00:00
Ciprian Hacman
21809043b5 Remove deprecated flag --non-masquerade-cidr in kubelet
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-01-19 09:17:26 +02:00
cyclinder
07999dac70 Clean up dockershim flags in the kubelet
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
Co-authored-by: Ciprian Hacman <ciprian@hakman.dev>
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-01-14 16:02:50 +02:00
Patrick Ohly
9eaa2dc554 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.
2022-01-12 07:48:36 +01:00
Kubernetes Prow Robot
b5103f6117
Merge pull request #107426 from yanghesong/remove_validate_runtime
Remove runtime in validate
2022-01-11 20:50:36 -08:00
Kubernetes Prow Robot
7eb5046064
Merge pull request #106470 from qmloong/qmloong/fix
fix: some typos and syncPod outdated workflow annotation
2022-01-11 10:48:38 -08:00
Kubernetes Prow Robot
a0dfd958d5
Merge pull request #107163 from cyclinder/fix_leak_goroutine
fix goroutine leaks in TestConfigurationChannels
2022-01-10 17:23:16 -08:00
cyclinder
928e686877 fix goroutine leaks in TestConfigurationChannels
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
2022-01-10 19:51:16 +08:00
yanghesong
6905fef761 Remove runtime in validate
Validate is useless as dockershim is removed

Signed-off-by: yanghesong <hesong.yang@foxmail.com>
2022-01-09 09:11:49 +08:00
Mengjiao Liu
beda4cafb6 kubelet: Remove the deprecated flag --experimental-check-node-capabilities-before-mount 2022-01-06 11:47:11 +08:00
Kubernetes Prow Robot
73b68f5233
Merge pull request #106979 from a2ush/fix_typo
Fix comment out typo (from resolve.conf to resolv.conf) and change the content name (from maxResolveConfLength to maxResolvConfLength)
2022-01-05 16:08:26 -08:00