Commit Graph

13066 Commits

Author SHA1 Message Date
Dan Mihai
58fbb9f6ec
Merge pull request #9073 from microsoft/danmihai1/test-genpolicy3
tests: k8s: generated policy for additional tests
2024-02-21 14:11:51 -08:00
Dan Mihai
b3c3f992ab tests: k8s: common clean-up on teardown
teardown() gets executed after each test case, so there is no need to
clean-up before teardown.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
9c164698d3 tests: k8s: k8s-optional-empty-configmap policy
Auto-generate policy for k8s-optional-empty-configmap.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
74a52c6d25 tests: k8s: k8s-oom.bats auto-generated policy
Auto-generate policy for k8s-oom.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
26a77d67f4 tests: k8s: k8s-number-cpus auto-generated policy
Auto-generate policy for k8s-number-cpus.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
9cbdce15fd tests: k8s: k8s-memory.bats auto-generated policy
Auto-generate policy for k8s-memory.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
40209cc0b7 tests: k8s: k8s-limit-range auto-generated policy
Auto-generate policy for k8s-limit-range.bats.

Also, fix teardown() namespace.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
df3c0318c6 tests: k8s: add set_namespace_to_policy_settings
Add set_namespace_to_policy_settings() for changing the pod namespace
in genpolicy settings.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
6e14ce93c9 tests: k8s-kill-all-process-in-container policy
Auto-generate policy for k8s-kill-all-process-in-container.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
fad7ba0aea tests: k8s: k8s-job.bats auto-generated policy
Auto-generate policy for 8s-job.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
41c2bcbdc5 tests: k8s: k8s-file-volume auto-generated policy
Auto-generate policy for k8s-file-volume.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
d84f50db5b genpolicy: fix typo in policy logging
Improve logging, for easier debugging.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
81e641814f tests: k8s: k8s-cpu-ns auto-generated policy
Auto-generate policy for k8s-cpu-ns.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
bc6d3fc238 tests: k8s: k8s-env.bats auto-generated policy
Auto-generate policy for k8s-env.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
0a4fc071ac tests: k8s: k8s-custom-dns auto-generated policy
Auto-generate policy for k8s-custom-dns.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
f693f49e92 tests: k8s: k8s-credentials-secrets policy
Auto-generate policy for k8s-credentials-secrets.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
d3d27bbb5b tests: k8s: k8s-configmap auto-generated policy
Auto-generate policy for k8s-configmap.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
b318535536 tests: k8s: auto-generate k8s-caps.bats policy
Auto-generated policy for k8s-caps.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Greg Kurz
600b951afd agent: Run container workload in its own cgroup namespace
When cgroup v2 is in use, a container should only see its part of the
unified hierarchy in `/sys/fs/cgroup`, not the full hierarchy created
at the OS level. Similarly, `/proc/self/cgroup` inside the container
should display `0::/`, rather than a full path such as :

0::/kubepods.slice/kubepods-besteffort.slice/kubepods-besteffort-podde291f58_8f20_4d44_aa89_c9e538613d85.slice/crio-9e1823d09627f3c2d42f30d76f0d2933abdbc033a630aab732339c90334fbc5f.scope

What is needed here is isolation from the OS. Do that by running the
container in its own cgroup namespace. This matches what runc and
other non VM based runtimes do.

Fixes #9124

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-02-21 13:14:13 +01:00
Greg Kurz
14886c7b32 agent: lint code
Run cargo-clippy to reduce noise in actual functional changes.

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-02-21 13:14:13 +01:00
ChengyuZhu6
cddaf2ce97 kata-deploy: Remove specific kernel/initrd/image leftovers in Makefile
Remove specific kernel/initrd/image leftovers in Makefile of
local-build, which is the part of #9026.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-21 18:24:10 +08:00
Chelsea Mafrica
241a56989a
Merge pull request #9090 from GabyCT/topic/pulldockerimage
gha: docker: Pull docker image as part of the dependencies
2024-02-20 14:28:53 -08:00
GabyCT
ea78013c7e
Merge pull request #9079 from GabyCT/topic/removecilink
docs: Update CI link into the README
2024-02-20 14:11:13 -06:00
GabyCT
64c09fe6c5
Merge pull request #9088 from GabyCT/topic/fixnydus
gha: nydus: Fix indentation in gha run script
2024-02-20 14:09:54 -06:00
Gabriela Cervantes
ff8a6fa9ef scripts: Add error script
This PR adds the error script to display the error message with
much more information to help debugging.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-20 18:30:03 +00:00
Gabriela Cervantes
43a46d5a6b scripts: Add an enhanced die function
This PR adds an enhanced die function in order to dump more information
in a yaml format that will help with the debugging.

Fixes #9105

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-20 18:27:44 +00:00
Archana Shinde
6d84fe3a37
Merge pull request #8647 from amshinde/cleanup-network
Cleanup network to make sure physical interfaces are restores back to original host driver.
2024-02-20 08:59:53 -08:00
Archana Shinde
6d38fa1530 network: Try removing as many changes as possible during network cleanup
In case an error is encountered while removing a network endpoint during
network cleanup, we cuurently return immediately with the error.
With this change, in case of error we simply log the error and proceed
towards removing the next endpoint. With this, we can cleanup the
network changes made by the shim as much as possible.
This is especially important when multiple interfaces are passed to the
network namespace using a network plugin like multus.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-02-20 06:08:05 -08:00
Archana Shinde
b005cda689 network: Move up defer block tp cleanup network
Move the defer for cleaning up network before the call to add network.
This way if any change made by add network is reverted by in case of
failure. This is particulary important for physical network interfaces
as with this step we make sure that driver for the physical interface is
reverted back to the original host driver. Without this the physical
network iterface will remain bound to vfio.

Fixes: #8646

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-02-20 06:06:42 -08:00
Ryan Savino
61ce7455c5
Merge pull request #9086 from niteeshkd/nd_snp_upm
packaging: qemu-snp-experimental: support host kernel with gmem
2024-02-19 10:50:13 -06:00
Fabiano Fidêncio
79dc6e95d1
Merge pull request #9108 from fidencio/topic/ci-k8s-fix-wrong-logic-on-confidential-tests
ci: k8s: Fix checks used to skip confidential tests
2024-02-19 12:49:57 +01:00
Xuewei Niu
f9307f6852
Merge pull request #9112 from ChengyuZhu6/vendor
runtime: fix checksum mismatch error in `make vendor`
2024-02-19 10:54:38 +08:00
ChengyuZhu6
96c297cb37 runtime: fix checksum mismatch error in make vendor
Fix checksum mismatch error in `make vendor`.

Fixes: #9111

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-18 22:22:38 +08:00
Fabiano Fidêncio
3468ac3b6e
ci: k8s: Fix checks used to skip confidential tests
This has been introduced by 53bc4a432b,
where the condition was changed.

The correct condition is:
* If the list of supported tees does not contain the kata hypervisor
  and the list of supported non tees does not contain the kata
  hypervisor.

The error is that we were checking whether kata-hypervisor would contain
the list of supported tees, and that would almost always be false
(unless in the case where the list had an one and only one element).

Fixes: #9055 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-18 10:10:45 +01:00
Niteesh Dubey
0538bbfc49 packaging: qemu-snp-experimental: support host kernel with gmem
This is required to allow creation of SNP coco on host kernel
(e.g. https://github.com/AMDESE/linux ,branch:snp-host-latest)
supporting guest private memory for SNP using gmem.

Note: This qemu does not work if the host kernel does not support
gmem/UPM.

Fixes: #9092

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-02-15 16:33:46 +00:00
Wainer Moschetta
db744aa8d2
Merge pull request #9023 from ldoktor/webhook-path
tools.kata-webhook: Fix lib path
2024-02-15 12:34:01 -03:00
Fabiano Fidêncio
28b4e5ce51
Merge pull request #9099 from BbolroC/skip-k8s-sandbox-vcpus-allocation-s390x
CI|k8s: Skip vcpu allocation test for s390x
2024-02-15 16:05:18 +01:00
James O. D. Hunt
d1513b2030
Merge pull request #9091 from jodh-intel/packaging-add-kata-manager-script
packaging: Add the kata manager script
2024-02-15 13:08:36 +00:00
Hyounggyu Choi
8b3f7f353d CI|k8s: Skip vcpu allocation test for s390x
A test `vcpu allocation k8s test` exhibits different behavior on s390x
For more details, please refer to issue #9093.
This commit is to make the test skipped until the issue is resolved on
the platform.

Fixes: #9093

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-02-15 12:26:35 +01:00
Fabiano Fidêncio
9178541dfb
Merge pull request #9098 from fidencio/topic/runtime-update-runc-to-v1.1.12
runtime: Update runc to v1.1.12
2024-02-15 09:29:10 +01:00
Fabiano Fidêncio
eea4277fbf
runtime: Update runc to v1.1.12
Although we don't seem to be affected by
https://nvd.nist.gov/vuln/detail/CVE-2024-21626, we vendor and use the
runc package in a few different places of our code, and we better update
the package to its latest release.

Fixes: #9097

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-14 23:13:39 +01:00
James O. D. Hunt
8c51e02f55 packaging: Add the kata manager script
Add `kata-manager.sh` to the release packages.

Fixes: #9066.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-02-14 17:44:42 +00:00
James O. D. Hunt
e49aeec97f packaging: Use variable for default binary permissions
Create a variable for the default binary permissions.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-02-14 17:44:35 +00:00
James O. D. Hunt
cc2d96671f packaging: Remove extraneous whitespace
Remove some unnecessary whitespace from a couple of `kata-deploy` files.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>

whitespace

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-02-14 17:44:08 +00:00
Fabiano Fidêncio
c95c37d2ab
Merge pull request #9026 from fidencio/topic/packaging-remove-tee-specific-leftovers
packaging: Remove leftovers from the transition from TEE specific kernel / initrd / image to the "confidential" ones
2024-02-13 22:14:26 +01:00
GabyCT
9cf343779f
Merge pull request #9062 from GabyCT/topic/nonteet
tests: Add ability to run non-TEE environments
2024-02-13 14:28:07 -06:00
Fabiano Fidêncio
74c8d243ea
versions: Remove TEE specific kernels
We've switched to using the confidential one, instead.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-13 19:07:33 +01:00
Fabiano Fidêncio
adbe24c283
versions: Remove non-used tdx / sev image and initrd entries
We've switched to using the confidential ones, instead.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-13 19:07:33 +01:00
Fabiano Fidêncio
6c3338271b
packaging: kernel: Remove sev/snp/tdx specific stuff
Now we're using a "confidential" image that has support for all of
those.

Fixes: #9010 -- part II
       #8982 -- part II
       #8978 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-13 19:07:33 +01:00
Gabriela Cervantes
598c77409a gha: docker: Pull docker image as part of the dependencies
This PR pulls the docker image needed for the test as part of the dependencies
in order to avoid failures of timeouts mainly because the image was not
properly download it and it is unable to find it.

Fixes #9089

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-13 17:48:31 +00:00