Commit Graph

19 Commits

Author SHA1 Message Date
Fabiano Fidêncio
f7ccf92dc8 kata-deploy: Rely on the configured config path
Instead of passing a `KATA_CONF_FILE` environament variable, let's rely
on the configured (in the container engine) config path, as both
containerd and CRI-O support it, and we're using this for both of them.

Fixes: #4608

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-07-08 15:02:26 +02:00
Fabiano Fidêncio
386a523a05 kata-deploy: Pass the config path to CRI-O
As we're already doing for containerd, let's also pass the configuration
path to CRI-O, as all the supported CRI-O versions do support this
configuration option.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-07-08 12:36:47 +02:00
Fabiano Fidêncio
ccb0183934 kata-deploy: Add support to RKE2
"RKE2 - Rancher's Next Generation Kuberentes Distribution" can easily be
supported by kata-deploy with some simple adjustments to what we've been
relying on for "k3s".

The main differences between k3s and RKE2 are, basically:
1. The location where the containerd configuration is stored
   - k3s: /var/lib/rancher/k3s/agent/etc/containerd/
   - rke2: /var/lib/rancher/rke2/agent/etc/containerd/
2. The name of the systemd services used:
   - k3s: k3s.service or k3s-agent.service
   - rke2: rke2-server.service or rke2-agent.service

Knowing this, let's add a new overlay for RKE2, adapt the kata-deploy
and the kata-cleanup scripts, and that's it.

Fixes: #4160

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-04-27 19:05:36 +02:00
James O. D. Hunt
5d6d39be48 scripts: Change here document delimiters
Fix the outstanding scripts using non standard shell here document delimiters.

This should have been caught by
https://github.com/kata-containers/tests/pull/3937, but there is a bug
in the checker which is fixed on
https://github.com/kata-containers/tests/pull/4569.

Fixes: #3864.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-03-10 09:23:37 +00:00
Fabiano Fidêncio
11220f052f kata-deploy: Use (kata with) qemu as the default shim-v2 binary
When using kata-deploy, no `containerd-shim-kata-v2` binary is deployed,
but we do deploy a `kata` runtime class, which seems very much
incosistent.

As the default configuration for kata-containers points to QEMU, let's
also use kata with QEMU as the default shim-v2 binary.

Fixes: #3228, #3734

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-21 10:03:47 +01:00
Sebastian Hasler
adffd3f8b6 scripts: Use shebang /usr/bin/env bash
Not all distros have `/bin/bash`, e.g. NixOS.

Fixes: #3450

Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
2022-01-13 22:53:28 +01:00
Snir Sheriber
ac7acbf87b kata-deploy: validate conf file can be created
As containerd doesn't exist at cleanup

Fixes: #3429
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-01-12 10:12:46 +02:00
Fabiano Fidêncio
8457150684 kata-deploy: Deal with empty containerd conf file
As containerd can properly run without having a existent
`/etc/containerd/config.toml` file (it'd run using the default
cobnfiguration), let's explicitly create the file in those cases.

This will avoid issues on ammending runtime classes to a non-existent
file.

Fixes: #3229

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Tested-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-13 11:20:22 +01:00
Fabiano Fidêncio
2047f26fa3 kata-deploy: Adapt CRI-O config to use drop-in files
By using drop-in file it simplifies the deployment and maintenance of
the CRI-O configurations by a lot, and all versions of CRI-O that should
be used together with the currently supported versions of kubenertes
support the drop-in configuration file.

Depends-on: github.com/kata-containers/kata-containers#1689
Fixes #1781

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-04-30 23:14:19 +02:00
Fabiano Fidêncio
8de2f914ab kata-deploy: Rely on CRIO default's values for manage_ns_lifecycle
manage_ns_lifecycle (previously known as manage_network_ns_lifecycle)
has its default value as `true` for all CRI-O versions that should be
used with the kubernetes versions that are still supported / didn't
reach their EOL.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-04-30 23:14:19 +02:00
Fabiano Fidêncio
01481d6ac0 kata-deploy: Ensure CRI-O uses the VM runtime type
For Kata Containers 2.x, CRI-O should always be using the
`containerd-shim-kata-v2` binary, and always be configured to use the
"vm" runtime type, developed specifically for the shimv2, instead of the
default "oci" runtime type.

I've taken the liberty to try to simplify the CRI-O script and make it
less error prone.  In the future, we can start dropping a configuration
file to /etc/crio/crio.conf.d and just removing it as part of the
cleanup, but that's for the future.

Fixes: #1357

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-20 09:27:33 +01:00
Fabiano Fidêncio
d1c717363d kata-deploy: Move the containerd workarounds to their own functions
Factoring those pieces of code to their own functions allows us to
easily re-use them when creating & cleaning up the CRI-O configuration
files, as CRI-O is also affected by the issues that are still opened.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-20 09:27:24 +01:00
Fabiano Fidêncio
62cbaf4de4 kata-deploy: Remove kata-deploy-docker.sh
Kata Containers 2.x is not supported outside of the kubernetes world.
With this in mind, let's remove leftovers from the 1.x deployments &
documentation.

Fixes: #1356

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-05 15:18:43 +01:00
Peng Tao
9a351509d2 package: drop qemu-virtiofs shim
We have enabled qemu-virtiofs by default.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-17 11:42:56 +08:00
Julio Montes
c422d061cb
Merge pull request #629 from gvancuts/add-kata-acrn-runtime-docker
kata-deploy: add ACRN runtime to Docker configuration
2020-09-01 07:27:04 -05:00
Geoffroy Van Cutsem
5b0e6f375b kata-deploy: add ACRN runtime to Docker configuration
Add an ACRN runtime ('kata-acrn') to the Docker configuration
('/etc/docker/daemon.json').

Fixes: #579
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-08-27 15:45:30 +02:00
Archana Shinde
bee17d1c8f kata-deploy: Add containerd configuration to support kata annotations.
In case of containerd, not all annotations are passed down to the OCI
layer. We need to configure "pod_annotations" field for a runtime class.
This field is a list of annotations that can be passed by Kata as OCI
annotations. Add this as default configuration with kata-deploy.

Fixes: #594

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-08-26 15:06:06 -07:00
Archana Shinde
219f93ffad kata-deploy: Add default privileged_without_host_devices
For privieleged containers, all host devices are passed to
container. We have done work in crio and containerd to define a
scope of privileged in Kata to prevent this from happening.
Add this as the default as this falls under a best practice to follow
with Kata.
Note that if this flag has been already defined, then this change
does not override it.

Fixes #582

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-08-26 15:06:06 -07:00
Peng Tao
782cd2ed10 packaging: merge packaging repository
git-subtree-dir: tools/packaging
git-subtree-mainline: f818b46a41
git-subtree-split: 1f22d72d5d

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-06-23 22:58:18 -07:00