Commit Graph

42 Commits

Author SHA1 Message Date
Akihiro Suda
c27bcdc564
cri: introspectRuntimeFeatures: fix nil panic
Fix issue 10062

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-04-25 08:36:38 +09:00
Derek McGowan
1412a255ec
Merge pull request #10068 from kiashok/portForwardingWindows-ipv6
Account for ipv6 localhost in windows port forwarding
2024-04-22 21:14:18 +00:00
Kirtana Ashok
7e60d5a074 Account for ipv4 vs ipv6 localhost
in windows port forwarding

Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2024-04-19 11:30:49 -07:00
Maksim An
c7ea06a69b fix default working directory hostProcess
Per https://github.com/kubernetes/enhancements/tree/master/keps/sig-windows/1981-windows-privileged-container-support#container-mounts
the default working directory for `hostProcess` containers should
be `C:\hpc`, however the current default is set to windows default
which is `C:\`.

Signed-off-by: Maksim An <maksiman@microsoft.com>
2024-04-11 23:35:55 -07:00
Phil Estes
99693a32c2
Merge pull request #10041 from elezar/bump-container-device-interface-v0.7.1
Bump tags.cncf.io/container-device-interface to v0.7.1
2024-04-11 15:33:21 +00:00
Evan Lezar
1b62224181 Bump tags.cncf.io/container-device-interface to v0.7.1
This includes migrating from cdi.GetRegistry() to cdi.Configure() and
using top-level cdi Refresh and InjectDevices functions as applicable.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2024-04-10 15:25:11 +02:00
ChengyuZhu6
b6e3616949 cri: add pause image name to annotations
We are currently in the process of developing a feature to facilitate guest image pulling
on confidential-containers, and we would be grateful for containerd's support in this endeavor.
It would greatly assist our efforts if containerd could provide the pause image name and
add it into the annotations.

Fixes: #9418

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-04-09 22:33:58 +08:00
Danny Canter
2474a99c30 Add IsNotFound case to ListPodSandboxStats
Fixes #10013. It seems we can end up in a spot where the sandbox store still
has a listing for a pod, whereas containerds underlying store has removed it.
It might be better to shield the caller (k8s) from these transient errors.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2024-03-30 21:20:22 -07:00
Kirtana Ashok
b97ef91fb7 Change port forwarding on windows
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2024-03-26 10:19:24 -07:00
Fu Wei
74938f6a06
Merge pull request #9885 from Iceber/fix_pin_loaded_pause_image
cri: ensure the pause image loaded in older versions is pinned
2024-03-26 13:40:56 +00:00
Sebastiaan van Stijn
26158609b5
pkg/seutil: move to internal/cri
This pacakge is only used internally in the cri package, which is an internal
packages, so we can make the utility internal as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-03-20 11:11:24 +01:00
Sebastiaan van Stijn
33732bc13e
pkg/systemd: move to internal/cri
This pacakge is only used internally in the cri package, which is an internal
packages, so we can make the utility internal as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-03-20 11:05:25 +01:00
zhanluxianshen
df26c189af
Clean cri options and useless parms
Signed-off-by: zhanluxianshen <zhanluxianshen@163.com>
2024-03-14 01:53:33 +00:00
Derek McGowan
88421068f7
Fix invalid event filter in podsandbox
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-03-12 18:52:44 -07:00
Adrian Reber
f25770e48d Wire through CRI ContainerCheckpoint RPC
This connects the new CRI ContainerCheckpoint RPC to the existing
internal checkpoint functions. With this commit it is possible
to checkpoint a container in Kubernetes using the Forensic Container
Checkpointing KEP (#2008):

 # curl X POST "https://localhost:10250/checkpoint/namespace/podId/container"

Which will result in containerd creating a checkpoint in the location
specified by Kubernetes (usually /var/lib/kubelet/checkpoints).

This is a Linux only feature because CRIU only exists on Linux.

Rewritten with the help of Phil Estes.

Signed-off-by: Phil Estes <estesp@gmail.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
2024-03-07 17:34:07 +00:00
Fu Wei
de6a094a28
Merge pull request #9598 from abel-von/sandbox-plugin-0103
sandbox: add event monitor for podsandbox controller
2024-03-05 08:23:31 +00:00
Derek McGowan
1bf781d8eb
Cleanup introspection interface
Split service proxy from service plugin.
Make introspection service easier for clients to use.
Update service proxy to support grpc and ttrpc.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-03-01 23:07:42 -08:00
Abel Feng
d0da3d1caf sandbox: make event monitor in CRI independent
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-03-01 10:30:52 +08:00
Fu Wei
6333db7701
Merge pull request #9891 from dmcgowan/move-events-plugin
Move events to plugins and core
2024-02-29 12:45:25 +00:00
Derek McGowan
72f21833b1
Move events to plugins and core
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-02-27 22:09:20 -08:00
Iceber Gu
6d1dfe55fb cri: ensure the pause image loaded in older versions is pinned
Signed-off-by: Iceber Gu <caiwei95@hotmail.com>
2024-02-27 16:40:43 +08:00
Abel Feng
a0b73ae114 sandbox: optimize the lock in PodSandbox
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-02-26 10:15:18 +08:00
Abel Feng
0f1d27412f sandbox: add methods to sandboxService
so that we cri service don't have to get sandbox controller everytime it
needs to call sandbox controller api.

Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-02-26 10:10:11 +08:00
Rodrigo Campos
2cd08156ed cri: Expose runtimeHandler support for userns
Since kubernetes 1.30, the kubelet will query the runtime handlers
features and only start pods with userns if the runtime handler used for
that pod supports it.

Let's expose the user namespace support to the kubelet.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-02-22 11:42:18 -03:00
Phil Estes
8ce402c24c
Merge pull request #9787 from AkihiroSuda/cri-rro-kep-3857
KEP-3857: Recursive Read-only (RRO) mounts
2024-02-21 18:52:43 +00:00
Zhang Tianyang
5611db5309 cri: Make sure host sandbox files exist before adding them to mounts
As `setupSandboxFiles` was done in sandbox controller, it is difficult
here to know if the sandbox controller has done and where the host path
in. Make sure the host path exists before adding them to linux container
mounts, otherwise, the container would generate some unnecessary mounts.

Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2024-02-19 20:40:24 +08:00
Akihiro Suda
9077d13728
KEP-3857: Recursive Read-only (RRO) mounts
See kubernetes/enhancements issue 3857 (PR 3858).

Replaces PR 9713 `cri: make read-only mounts recursively read-only`

Unlike PR 9713, this PR does not automatically upgrade RO mounts to RRO.

Test depends on:
- kubernetes-sigs/cri-tools PR 1344

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-19 00:42:50 +09:00
Mike Brown
f1a3c3705f
Merge pull request #9815 from kiashok/updateCRIServicePull
Pass runtimehandler from CRI to pull image request
2024-02-15 00:38:40 +00:00
Mike Brown
97f86f18ae
Merge pull request #9788 from kiashok/criRemoveImage
Add CRIImageService.RemoveImage()
2024-02-14 23:49:07 +00:00
Kirtana Ashok
b9dfba5b80 Add CRIImageService.RemoveImage()
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2024-02-14 13:49:39 -08:00
Kirtana Ashok
4c775fcfbf Pass runtimehandler from CRI pull image request
Starting with k8s cri-api v0.29.1, CRI supports new runtime handler flag

Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2024-02-14 13:31:23 -08:00
Akihiro Suda
1b3a96da6c
cri: propagate deprecation list to runtime status
Propagate the deprecation list to CRI runtime conditions.

The propagated conditions are visible via `crictl info`,
but not visible via `kubectl get nodes -o yaml` yet, although
the CRI API says "These conditions will be exposed to users to help
them understand the status of the system".

https://github.com/kubernetes/cri-api/blob/v0.29.1/pkg/apis/runtime/v1/api.proto#L1505-L1509

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-14 03:59:49 +09:00
Phil Estes
9b2313711b
Merge pull request #9782 from kinvolk/rata/userns-update-podSandboxStatus
Include userns info in cri/server PodSandboxStatus
2024-02-09 17:40:23 +00:00
Akihiro Suda
b466b7ef85
Merge pull request #9747 from AkihiroSuda/revert-9713
Revert "cri: make read-only mounts recursively read-only"
2024-02-08 10:29:03 +00:00
Rodrigo Campos
06ed897b22 cri/server: Add userns tests in PodSandboxStatus
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-02-07 17:06:01 +01:00
Rodrigo Campos
6c356a5c75 cri: Expose userns in PodSandboxStatus rpc
We added support for userns but we weren't showing it in the
podSandboxStatus.

Let's just show the whole nsOpts, so we don't forget in the future
either if something else inside there changes.

Please note that this will expose the content of nsOpts.TargetId that we
weren't exposing before. But that seemed like a bug to me.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>

Maybe this is better?
2024-02-07 17:06:01 +01:00
Henry Wang
1eaf0c1f04 bug fix: make sure cri image is pinned when it is pulled outside cri
Signed-off-by: Henry Wang <henwang@amazon.com>
2024-02-07 16:03:40 +00:00
Derek McGowan
86530c0afb
Move image event publishing to metadata store
The metadata store is in the best place to handle events directly after
the database has been updated. This prevents every user of the image
store interface from having to know whether or not they are responsible
for publishing events and avoid double events if the grpc local service
is used.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-02-06 21:24:55 -08:00
Abel Feng
e230ed939c sandbox: add sandbox recover ut and e2e test
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-02-04 11:55:46 +08:00
Abel Feng
3124964743 sandbox: fix recover status set issue
We can't set the status to Ready before task.Wait succeed.

Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-02-04 11:52:37 +08:00
Akihiro Suda
6670695836
Revert "cri: make read-only mounts recursively read-only"
Revert PR 9713, as it appeared to break the compatibility too much
https://github.com/kubernetes/enhancements/pull/3858#issuecomment-1925441072

This reverts commit b2f254fff0.

> Conflicts:
>	internal/cri/opts/spec_linux_opts.go

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-04 01:17:14 +09:00
Maksym Pavlenko
bbac058cf3 Move CRI from pkg/ to internal/
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-02 10:12:08 -08:00