Commit Graph

811 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
68a47053d1
Merge pull request #123508 from saschagrunert/image-id-container
Add `image_id` to CRI `Container` message
2024-02-28 11:01:35 -08:00
Sascha Grunert
e663285ccf
Add image_id to CRI Container message
This new field allows fixing the kubelet image garbage collection in
container runtimes. The `image_ref` has been historically used by
container runtimes to reference images by digest.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-02-28 10:05:07 +01:00
Giuseppe Scrivano
b2a92406ef
KEP-127: check for runtime handler userns support
block the creation of a pod that requires a user namespace, unless the
runtime handler has support for it.

If the pod requested for a user namespace, and the handler does not
support it then return an error regardless of the feature gate.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-02-27 12:01:00 +01:00
Giuseppe Scrivano
024146f705
KEP-127: the kubelet stores runtime helpers
as they are received from the ResponseStatus request to the runtime.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-02-27 11:07:35 +01:00
Kubernetes Prow Robot
5b2c919583
Merge pull request #114301 from harshanarayana/kubelet/log-rotate-improvements
kubelet: enable configurable rotation duration and parallel rotate
2024-02-14 15:56:38 -08:00
Kubernetes Prow Robot
14f8f5519d
Merge pull request #121719 from ruiwen-zhao/metric-size
Add image pull duration metric with bucketed image size
2024-02-13 16:23:50 -08:00
Harsha Narayana
ab8c784ee9
kubelet: enable configurable rotation duration and parallel rotate 2024-02-09 16:49:11 +05:30
ruiwen-zhao
0f5cf6c1cd Add image pull duration metric with bucketed image size
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2024-02-08 00:30:31 +00:00
Kubernetes Prow Robot
ce28021839
Merge pull request #121923 from saschagrunert/resources-windows
Enable pod container resources tests on Windows
2024-02-05 08:45:08 -08:00
Kubernetes Prow Robot
6427e2c9c8
Merge pull request #122578 from carlory/lock-default-ConsistentHTTPGetHandlers
lock GA feature-gate ConsistentHTTPGetHandlers to default
2024-01-04 18:00:52 +01:00
Kubernetes Prow Robot
014149d66e
Merge pull request #121565 from srivastav-abhishek/logs_test_datarace
[FLAKE] Fixed UT pkg/kubelet/kuberuntime/logs/TestReadRotatedLog caused due to data race
2024-01-04 16:49:23 +01:00
carlory
55c5db172e lock GA feature-gate ConsistentHTTPGetHandlers to default 2024-01-04 15:12:08 +08:00
Sascha Grunert
2076429e43
Enable pod container resources tests on Windows
PR https://github.com/kubernetes/kubernetes/pull/112599 merged so it
seems that we can now enable the tests on Windows.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-11-16 14:13:06 +01:00
Kevin Hannon
26923b91e8 implementation of split disk kep 2023-11-01 14:46:33 -04:00
kiashok
252e1d2dfe Imagepull per runtime class alpha release changes
This commit does the following:
1. Add RuntimeClassInImageCriApi feature gate
2. Extend pkg/kubelet/container Image struct
3. Adds runtimeHandler string in the following CRI calls
   i.   ImageStatus
   ii.  PullImageRequest
   iii.  RemoveImage

Signed-off-by: kiashok <kiashok@microsoft.com>
2023-10-31 15:52:46 -07:00
Kubernetes Prow Robot
ac6f707155
Merge pull request #120620 from tzneal/sidecar-termination-ordering
sidecars: terminate sidecars after main containers
2023-10-31 19:16:11 +01:00
Kubernetes Prow Robot
2c300ef6b0
Merge pull request #120269 from gjkim42/fix-restart-containers-in-right-order-after-podsandbox-changed
Restart containers in right order with SidecarContainers enabled
2023-10-31 19:15:35 +01:00
Kubernetes Prow Robot
dea3f1a119
Merge pull request #112599 from fabi200123/Adding-Windows-Support-for-InPlaceVerticalScaling
Adding Windows support for InPlace Pod Vertical Scaling
2023-10-31 19:15:12 +01:00
Abhishek Kr Srivastav
81bf3a59d1 Added mutex locks when accessing file object : addressed review comments 2023-10-28 17:32:13 +05:30
Abhishek Kr Srivastav
0e76e2c2bb Added mutex locks when accessing file object : lint check fix 2023-10-27 19:12:01 +05:30
Abhishek Kumar Srivastav
9ed4c58a1f Added mutex locks when accessing file object 2023-10-27 15:39:33 +05:30
Kubernetes Prow Robot
413b15a8d9
Merge pull request #120914 from kannon92/kubelet-disk-api-cri-update
Kubelet disk api cri update
2023-10-24 21:00:40 +02:00
Kubernetes Prow Robot
441d4b54ae
Merge pull request #120397 from ty-dc/StaticCheck
cleanup: omit comparison with bool constants
2023-10-24 05:25:52 +02:00
Kevin Hannon
8ae0d390d7 add container filesystem to CRI api
Co-authored-by: Mike Brown <brownwm@us.ibm.com>
2023-10-23 15:04:30 -04:00
Todd Neal
7bcc98c46b sidecars: terminate sidecars after main containers
Sidecars should terminate:
- after all main containers have exited
- serialized and in reverse order
2023-10-17 19:07:21 -05:00
Gunju Kim
ca6fda05ce
Restart containers in right order after the podSandboxChanged
This is a workaround for the issue that the kubelet cannot differentiate
the container statuses of the previous podSandbox from the current one.

If the node is rebooted, all containers will be in the exited state and
the kubelet will try to recreate a new podSandbox. In this case, the
kubelet should not mistakenly think that the newly created podSandbox
has been initialized.
2023-10-17 22:11:31 +09:00
Kubernetes Prow Robot
4911aad463
Merge pull request #115702 from xyz-li/master
Fix:  kubelet will not output logs after log file is rotated
2023-10-14 22:42:04 +02:00
Evan Lezar
394bcaf182 Only configure swap if available on node
This change bypasses all logic to set swap in the linux container
resources if a swap controller is not available on node. Failing
to do so may cause errors in runc when starting a container with
a swap configuration -- even if this is set to 0.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2023-09-26 21:32:58 +02:00
Evan Lezar
d3d1827c05 Use local isCgroup2UnifiedMode consistently
This change switches to using isCgroup2UnifiedMode locally to ensure
that any mocked function is also used when checking the swap controller
availability.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2023-09-21 16:09:04 +02:00
Kubernetes Prow Robot
b27670dfbd
Merge pull request #118740 from saschagrunert/kubelet-label-types
Make kubelet label types public
2023-09-06 23:46:57 -07:00
Fabian Fulga
2ad4304e8f Add Windows support for IPPVS
Added Windows support for InPlacePodVerticalScaling
2023-09-06 10:01:53 +03:00
tao.yang
b35357b6c0 cleanup: omit comparison with bool constants
Signed-off-by: tao.yang <tao.yang@daocloud.io>
2023-09-05 10:24:38 +08:00
Gunju Kim
696f84aeb0
Feature-gate SidecarContainers code in pkg/kubelet/kuberuntime 2023-09-01 00:13:47 +09:00
ruiwen-zhao
5bbc4f7605 Pass Pinned field to kubecontainer.Image
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2023-08-17 00:32:59 +00:00
Antonio Ojea
f355b22f5f implement Stringer for podActions
klog prints an internal error when trying to log the podActions struct.

> I0505 14:12:12.827065  190662 kuberuntime_manager.go:1014] "computePodActions got for pod" podActions="<internal error: json: unsupported type: map[container.ContainerID]kuberuntime.containerToKillInfo>" pod="kube-system/coredns-8f5847b64-mzw46"

Implement the stringer interface on the struct to avoid the json error.

Change-Id: I22444524a78a0ecec9490b9240def371a4129434
2023-08-07 22:48:28 +00:00
Paco Xu
c4bf42199a do not touch swap for cgroup v1 if swap not enabled 2023-07-21 13:27:50 +08:00
Kubernetes Prow Robot
da2fdf8cc3
Merge pull request #118764 from iholder101/Swap/burstableQoS-impl
Add full cgroup v2 swap support with automatically calculated swap limit for LimitedSwap and Burstable QoS Pods
2023-07-17 19:49:07 -07:00
Kubernetes Prow Robot
d17f3ba2cf
Merge pull request #119168 from gjkim42/sidecar-allow-probes-and-lifecycle-hooks
Allow all probes and lifecycle for restartable init containers
2023-07-17 18:11:07 -07:00
Gunju Kim
3bf282652f
Allow restartable init containers to have lifecycle 2023-07-18 08:12:24 +09:00
Gunju Kim
7ef2d674e2
Allow restartable init containers to have livenessProbe 2023-07-18 07:54:33 +09:00
Kubernetes Prow Robot
1fef8fd51d
Merge pull request #118770 from marquiz/devel/cgroup-driver-autoconfig
kubelet: get cgroup driver config from CRI
2023-07-17 15:53:18 -07:00
Markus Lehtonen
d2d5e2e27d Add CRI fake runtimes for RuntimeConfig rpc
Also update the CRI RuntimeService inteface to include the new
RuntimeConfig rpc.
2023-07-17 12:27:04 -04:00
Ed Bartosh
229eb93a83 DRA: report NodePrepareResource errors
Log an error and submit an event when NodePrepareResource fails.
2023-07-17 12:56:28 +03:00
Itamar Holder
4b6314f815 Unit test: Swap - Limited/Unlimited Swap, cgroups v1/v2, etc
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-14 14:52:28 +03:00
Itamar Holder
a30410d9ce LimitedSwap: Automatically configure swap limit for Burstable QoS Pods
After this commit, when LimitedSwap is enabled,
containers would get swap acess limited with respect
the container memory request, total physical memory
on the node, and the swap size on the node.

Pods of Best-Effort / Guaranteed QoS classes don't get
to swap. In addition, container with memory requests
that are equal to their memory limits also don't get to
swap.

The swap limitation is calculated in the following way:
1. Calculate the container's memory proportionate to the node's memory:
- Divide the container's memory request by the total node's physical memory.
  Let's call this value ContainerMemoryProportion.

2. Multiply the container memory proportion by the available
swap memory for Pods:
Meaning: ContainerMemoryProportion * TotalPodsSwapAvailable.

Fore more information:
https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md

Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-14 14:52:28 +03:00
Itamar Holder
e4da568f33 Make kuberuntime unit tests environment independent + support cgroup v2
Before this commit, to find out the current node's
cgroup version, a libcontainers function was used
directly. This way, cgroup version is hard to mock
and is dependant on the environment in which the unit
tests are being run.

After this commit, libcontainer's function is wrapped
within a variable function that can be re-assigned by
the tests. This way the test can easily mock the cgroup
version and become environment independant.

After this commit both cgroup versions v1 and v2
are being tested, no matter in which environment
it runs.

Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-14 14:52:27 +03:00
Sascha Grunert
a6554b9d5d
Make kubelet label types public
We use the label definitions in CRI-O, means we now make them public to
stop vendoring/copying this part of Kubernetes.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-07-10 10:58:44 +02:00
Gunju Kim
b94fa250c2
Sidecar: Implement lifecycle of the restartable init container
- Implement `computeInitContainerActions` to sets the actions for the
  init containers, including those with `RestartPolicyAlways`.
- Allow StartupProbe on the restartable init containers.
- Update PodPhase considering the restartable init containers.
- Update PodInitialized status and status manager considering the
  restartable init containers.

Co-authored-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-07-08 07:26:12 +09:00
Sascha Grunert
20a25cbfcf
Add user specified image to CRI ContainerConfig
The container config image references either an image ID or a digest,
but not the original image from the container config. We require the
image for signature verification to ensure that we actually verify the
correct image.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-07-06 08:40:09 +02:00
Giuseppe Scrivano
531d38e323
features: rename UserNamespacesStatelessPodsSupport
now it is called UserNamespacesSupport since all kind of volumes are
supported.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-22 15:19:50 +02:00