Commit Graph

16946 Commits

Author SHA1 Message Date
Alex Lyn
4c386b51d9 runtime-rs: Add support for handling virtio-scsi devices
As virtio-scsi has been set the default block device driver, the
runtime also need to correctly handle the virtio-scsi info, specially
the SCSI address required within kata-agent handling logic.

And getting and assigning the scsi_addr to kata agent device id
will be enough. This commit just do such work.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2025-10-10 11:31:04 +08:00
Alex Lyn
a54d95966b runtime-rs: Support virtio-scsi for initdata within non-TEE
This commit introduces support for selecting `virtio-scsi` as the
block device driver for QEMU during initial setup.

The primary goal is to resolve a conflict in non-TEE environments:
1. The global block device configuration defaults to `virtio-scsi`.
2. The `initdata` device driver was previously designed and hardcoded
to `virtio-blk-pci`.
3. This conflict prevented unified block device usage.

By allowing `virtio-scsi` to be configured at cold boot, the `initdata`
device can now correctly adhere to the global setting, eliminating the
need for a hardcoded driver and ensuring consistent block device
configuration across all supported devices (excluding rootfs).

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2025-10-09 15:52:33 +08:00
Aurélien Bombo
d954932876 Merge pull request #11883 from kata-containers/sprt/zizmor-fixes3
ci: zizmor: Address all issues
2025-10-08 17:01:48 -05:00
Aurélien Bombo
07645cf58b ci: actionlint: Address issues and set as required
Address issues just introduced and set actionlint as a required by removing
the path filter.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-08 16:55:27 -05:00
Aurélien Bombo
b3a551d438 ci: zizmor: Reestablish as required test
We can re-require this now that we've addressed all the issues.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-08 16:55:27 -05:00
Aurélien Bombo
5a4ddb8c71 ci: zizmor: Fix all template-injection alerts
Fix all instances of template injection by using environment variables as
recommended by Zizmor, instead of directly injecting values into the
commands.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-08 16:55:26 -05:00
Aurélien Bombo
7b203d1b43 ci: zizmor: Ignore dangerous-triggers audit for known safe usage
The two ignored cases are strictly necessary for the CI to work today, and we
have various security mitigations in place.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-08 16:55:08 -05:00
Aurélien Bombo
7afdfc7388 ci: zizmor: Disable undocumented-permissions audit
There are 62 such warnings and addressing them would take quite a bit of
time so just disable them for now.

help[undocumented-permissions]: permissions without explanatory comments
  --> ./.github/workflows/release.yaml:71:7
   |
71 |       packages: write
   |       ^^^^^^^^^^^^^^^ needs an explanatory comment
72 |       id-token: write
   |       ^^^^^^^^^^^^^^^ needs an explanatory comment
73 |       attestations: write
   |       ^^^^^^^^^^^^^^^^^^^ needs an explanatory comment
   |
   = note: audit confidence → High

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-08 16:55:08 -05:00
Aurélien Bombo
889ba0d5db Merge pull request #11901 from kata-containers/sprt/remove-docs-url-check
gha: Fix `docs-url-alive-check` workflow
2025-10-08 14:42:58 -05:00
Aurélien Bombo
ec81ea95df gha: Add workflow_dispatch trigger to docs-url-alive-check
We can't test this PR because the workflow needs this trigger, so adding
this will allow testing future PRs.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-08 14:39:34 -05:00
Aurélien Bombo
4d760e64ae gha: Fix docs-url-alive-check workflow
The Go installation step was broken because the checkout action was
checking out the code in a subdirectory:

https://github.com/kata-containers/kata-containers/actions/runs/18265538456/job/51999316919

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-08 14:39:34 -05:00
Aurélien Bombo
476c827fca Merge pull request #11878 from kata-containers/sprt/privileged-docs
docs: Document `privileged_without_host_devices=false` as unsupported
2025-10-08 11:12:45 -05:00
Fabiano Fidêncio
dbb1eb959c kata-deploy: Allow users to set experimental_force_guest_pull
For those who are not willing to use the nydus-snapshotter for pulling
the image inside the guest, let's allow them setting the
experimetal_force_guest_pull, introduced by Edgeless, as part of our
helm-chart.

This option can be set as:
_experimentalForceGuestPull: "qemu-tdx,qemu-coco-dev"

Which would them ensure that the configuration for `qemu-tdx` and
`qemu-coco-dev` would have the option enabled.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-08 17:43:09 +02:00
Fabiano Fidêncio
8c4bad68a8 kata-deploy: Remove kustomize yamls, rely on helm-chart only
As the kata-deploy helm chart has been the only way we've been testing
kata-containers deployment as part of our CI, it's time to finally get
rid of the kustomize yamls and avoid us having to maintain two different
methods (with one of those not being tested).

Here I removed:
* kata-deploy yamls and kustomize yamls
* kata-cleanup yamls and kustomize yamls
* kata-rbac yals and kustomize yamls
* README.md for the kustomize yamls was removed

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-08 16:54:19 +02:00
Fabiano Fidêncio
3418cedacc ci: Add tests for erofs-snapshotter (for coco-qemu-dev)
erofs-snapshotter can be used to leverage sharing the image from the
host to the guest without the need of a shared filesystem (such as
virtio-fs or virtio-9p).

This case is ideal for Confidential Computing enabled on Kata
Containers, and we can immensely benefit from this snapshotter, thus
let's test it as soon as possible so we can find issues, report bugs,
and ask for enhancement requests.

There are at least a few things that we know for sure to be problematic
now:
* Policy has to be adjusted to the erofs-snapshotter
* There is no support for signed nor encrypted images
* Tests that use the KBS are disabled for now

Even with the limitations, I do believe we should be testing the
snapshoitter, so we can team up and get those limitations addressed.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-08 10:34:09 +02:00
Fabiano Fidêncio
544f688104 tests: Add ability to deploy vanilla k8s with erofs
As done in the previous commit, let's expand the vanilla k8s deployment
to also allow the erofs host side configuration.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-08 10:34:09 +02:00
Fabiano Fidêncio
3ac6579ca6 tests: Add support for deploying vanilla k8s
We already have support for deploying a few flavours of k8s that are
required for different tests we perform.

Let's also add the ability to deploy vanilla k8s, as that will be very
useful in the next commits in this series.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-08 10:34:09 +02:00
Fabiano Fidêncio
aa9e3fc3d5 versions: Update containerd active / latest versions
The active version is 2.1.x, and the latest is 2.2.0-beta.0.

The latest is what we'll be using to test if the "to be released"
version of containerd works well for our use-cases.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-08 10:34:09 +02:00
Fabiano Fidêncio
287db1865f tests: Relax regex used to install containerd
Let's make sure that we can get non-official releases as well, otherwise
we won't be able to test a coming release of containerd, to know whether
it solves issues that we face or not, before it's actually released.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-08 10:34:09 +02:00
Zvonko Kaiser
59b4e3d3f8 gpu: Add CONFIG_FW_LOADER to the kernel
We need it for the newer CC kernel

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-10-08 10:01:27 +02:00
Zvonko Kaiser
7061f64db5 gpu: Fix confidential build
NVRC introduced the confidential feature flag and we
haven't updated the rootfs build to accomodate.
If rootfs_type==confidential user --feature=confidential

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-10-08 10:01:27 +02:00
Zvonko Kaiser
2260f66339 gpu: Some fixes regarding the rootfs v580
With the 580 driver version we need new dependencies
in the rootfs.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-10-08 10:01:27 +02:00
Dan Mihai
08272ab673 Merge pull request #11884 from kata-containers/sprt/priv-test
tests/k8s: Add test for privileged containers
2025-10-07 19:18:06 -07:00
Szymon Klimek
8dc6b24e7d kata-deploy: accept 25.10 as supported distro for TDX
Canonical TDX release is not needed for vanilla Ubuntu 25.10 but
GRUB_CMDLINE_LINUX_DEFAULT needs to contain `nohibernate` and
`kvm_intel.tdx=1`

Signed-off-by: Szymon Klimek <szymon.klimek@intel.com>
2025-10-07 23:41:52 +02:00
Dan Mihai
650863039b tests: k8s-volume: auto-generate policy
Auto-generate the agent policy, instead of using the insecure
"allow all" policy.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-10-07 23:35:06 +02:00
Dan Mihai
5ed76b3c91 tests: k8s-volume: retry failed exec
Use grep_pod_exec_output to retry possible failing "kubectl exec"
commands. Other tests have been hitting such errors during CI in
the past.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-10-07 23:35:06 +02:00
Dan Mihai
6ab59453ff genpolicy: better parsing of mount path
Mount paths ending in '/' were not parsed correctly.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-10-07 23:35:06 +02:00
Dan Mihai
ba792945ef genpolicy: additional mount_source_allows logging
Make debugging policy errors related to storage mount sources easier to
debug.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-10-07 23:35:06 +02:00
Aurélien Bombo
6e451e3da0 tests/k8s: Add test for privileged containers
This adds an integration test to verify that privileged containers work
properly when deploying Kata with kata-deploy.

This is a follow-up to #11878.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-07 09:59:05 -05:00
Fabiano Fidêncio
f994bacf6c tests: coco: Use the new way to set up nydus snapshotter
Let's rely on kata-deploy setting up the nydus snapshotter for us,
instead of doing this with external code.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Fabiano Fidêncio
6f17125ea4 tests: Allow using the new way to deploy nydus-snapshotter
This allows us to stop setting up the snapshotter ourselves, and just
rely con kata-deploy to do so.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Fabiano Fidêncio
000c9cce23 kata-deploy: chart: Add _experimentalSetupSnapshotter
Let's expose the EXPERIMENTAL_SETUP_SNAPSHOTTER script environment
variable to our chart, allowing then users of our helm chart to take
advantage of this experimental feature.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Fabiano Fidêncio
d6a1881b8b kata-deploy: scripts: Allow setting up multiple snapshotters
We may deploy in scenarios where we want to have both snapshotters set
up, sometimes even for simple test on which one behaves better.

With this in mind, let's allow EXTERNAL_SETUP_SNAPSHOTTER to receive a
comma separated list of snapshotters, such as:
```
EXPERIMENTAL_SETUP_SNAPSHOTTER="erofs,nydus"
```

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Fabiano Fidêncio
445af6c09b kata-deploy: scripts: Allow deploying erofs-snapshotters
Similarly to what's been done for the nydus-snapshotter, let's allow
users to have erofs-snapshotter set up by simply passing:
```
EXPERIMENTAL_SETUP_SNAPSHOTTER="erofs".
```

Mind that erofs, although a built-in containerd snapshotter, has system
depdencies that we will *NOT* install and it's up to the admin to do so.
These dependencies are:
* erofs-utils
* fsverity
* erofs module loaded

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Fabiano Fidêncio
4359c7b15d tests: Ensure the nydus-snapshotter versions are aligned
In the previous commit we added the assumption that the
nydus-snapshotter version should be the same in two different places.

Now, with this test, we ensure those will always be in sync.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Fabiano Fidêncio
2e0ce2f39f kata-deploy: scripts: Allow deploying nydus-snapshotter
Let's introduce a new EXPERIMENTAL_SETUP_SNAPSHOTTER environemnt
variable that, when set, allows kata-deploy to put the nydus snapshotter
in the correct place, and configure containerd accordingly.

Mind, this is a stop gap till the nydus-snapshotter helm chart is ready
to be used and behaving well enough to become a weak dependency of our
helm chart.  When that happens this code can be deleted entirely.

Users can have nydus-snapshotter deployed and configured for the
guest-pull use case by simply passing:
```
EXPERIMENTAL_SETUP_SNAPSHOTTER="nydus"
```

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Fabiano Fidêncio
1e2c86c068 kata-deploy: scripts: Only add conf file to the imports once
Otherwise we'd end up adding a the file several times, which could lead
to problems when removing the entry, leading to containerd not being
able to start due to an import file not being present.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Fabiano Fidêncio
e1269afe8a tests: Only use Authorization when GH_TOKEN is available
The code, how it was, would lead to the following broke command:
`--header "Authorization: Bearer: "`

Let's only expand that part of the command if ${GH_TOKEN} is passed,
otherwise we don't even bother adding it.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-07 10:32:46 +02:00
Dan Mihai
5e46f814dd Merge pull request #11832 from kata-containers/sprt/dev-hostpath
runtime: Simplify mounting guest devices when using hostPath volumes
2025-10-06 12:36:36 -07:00
Steve Horsman
0d58bad0fd Merge pull request #11840 from kata-containers/dependabot/cargo/src/tools/agent-ctl/astral-tokio-tar-0.5.5
build(deps): bump astral-tokio-tar from 0.5.2 to 0.5.5 in /src/tools/agent-ctl
2025-10-06 09:35:56 +01:00
Aurélien Bombo
6ff78373cf docs: Document privileged_without_host_devices=false as unsupported
Document that privileged containers with
privileged_without_host_devices=false are not generally supported.

When you try the above, the runtime will pass all the host devices to Kata
in the OCI spec, and Kata will fail to create the container for various
reasons depending on the setup, e.g.:

 - Attempting to hotplug uninitialized loop devices.
 - Attempting to remount /dev devices on themselves when the agent had
   already created them as default devices (e.g. /dev/full).
 - "Conflicting device updates" errors.
 - And more...

privileged_without_host_devices was originally created to support
Kata [1][2] and lots of people are having issues when it's set to
false [3].

[1] https://github.com/kata-containers/runtime/issues/1568
[2] https://github.com/containerd/cri/pull/1225
[3] https://github.com/kata-containers/kata-containers/issues?q=is%3Aissue%20%20in%3Atitle%20privileged

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-02 15:21:19 -05:00
Fabiano Fidêncio
300f7e686e build: Fix initramfs build
We have noticed in the CI that the `gen_init_cpio ...` was returning 255
and breaking the build. Why? I am not sure.

When chatting with Steve, he suggested to split the command, so it'd be
easier to see what's actually breaking. But guess what? There's no
breakage when we split the command.

So, let's try it out and see whether the CI passes after it.

If someone is willing to educate us on this one, please, that would be
helpful! :-)

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-02 20:58:22 +02:00
Zvonko Kaiser
2693daf503 gpu: Install dcgm export from the CUDA repo
Do not use the repo to install the exporter,
we rely on the version tested with Ubuntu <version>

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-10-02 18:05:13 +02:00
Zvonko Kaiser
56c6512781 gpu: Bump to noble and rearrange repos
Moving the CUDA repo to the top for all essential packages
and adding a repo priority favouring NVIDIA based repos.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-10-02 18:05:13 +02:00
Aurélien Bombo
eeecd6d72b Merge pull request #11872 from kata-containers/sprt/rust-use-uninit
agent/rustjail: Fix potentially uninitialized memory read in unsafe code
2025-10-02 10:39:25 -05:00
Manuel Huber
4b7c1db064 ci: Add test case for openvpn
Introduce new test case which verifies that openvpn clients and servers
can run as Kata pods and can successfully establish a connection.
Volatile certificates and keys are generated by an initialization
container and injected into the client and server containers.
This scenario requires TUN/TAP support for the UVM kernel.

Signed-off-by: Manuel Huber <mahuber@microsoft.com>
Co-authored-by: Manuel Huber <manuelh@nvidia.com>
2025-10-02 11:40:49 +02:00
Manuel Huber
34ecb11b35 tests: ease add_allow_all_policy_to_yaml if case
No need to die when a Kind that does not require a policy annotation is
found in a pod manifest. Print an informational message instead.

Signed-off-by: Manuel Huber <mahuber@microsoft.com>
2025-10-02 11:40:49 +02:00
Manuel Huber
e36f788570 kernel: add required configs for openvpn support
Currently, use of openvpn clients/servers is not possible in Kata UVMs.
Following error message can be expected:
ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)

To support opevpn scenarios using bridging and TAP, we enable various
kernel networking config options.

Signed-off-by: Manuel Huber <mahuber@microsoft.com>
2025-10-02 11:40:49 +02:00
Aurélien Bombo
a9fc501c08 check-spelling: Add hostPath to dictionary
Manually added "hostPath" to main.txt then regenerated the dictionary
with `./kata-spell-check.sh make-dict`.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-01 15:32:21 -05:00
Aurélien Bombo
c7a478662f check-spelling: Run make-dict
This simply ran `./kata-spell-check.sh make-dict` as documented in [1].
Unclear why it leads to changes - maybe it hadn't been run in a while.

[1] https://github.com/kata-containers/kata-containers/tree/main/tests/cmd/check-spelling#create-the-master-dictionary-files

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-10-01 15:32:21 -05:00