Skip to content

add support for nested virt #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: v1
Choose a base branch
from
Open

Conversation

sirdarckcat
Copy link
Member

No description provided.

@sirdarckcat sirdarckcat requested a review from Copilot June 5, 2025 13:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@sroettger
Copy link
Collaborator

Nice! Do you want to add a sample challenge (which would also give this test coverage)?
But in any case LGTM

@sirdarckcat
Copy link
Member Author

sirdarckcat commented Jun 6, 2025

I ran the instructions here:
https://github.com/kata-containers/kata-containers/blob/main/tools/packaging/kata-deploy/README.md

and then added this to challenge.yaml

 podTemplate:
    template:
      spec:
        runtimeClassName: kata-qemu
        containers:
          - name: challenge

and now the challenge runs in a vm.


for reference, here is the complete challenge.yaml:

apiVersion: kctf.dev/v1
kind: Challenge
metadata:
  name: demo-challenge
spec:
  deployed: true
  powDifficultySeconds: 0
  network:
    public: true
  healthcheck:
    # TIP: disable the healthcheck during development
    enabled: true
    image: eu.gcr.io/kctf-testing/demo-challenge-healthcheck:09f66401a712a419ef0b4987d9d3ed93194213c792ff80adff7abbb6d5490fa5
  image: eu.gcr.io/kctf-testing/demo-challenge-challenge:df97c62f3d784b05125c44ab310aeca054041831b5d65a05ac31f5f61703ff5f
  podTemplate:
    template:
      spec:
        runtimeClassName: kata-qemu
        containers:
          - name: challenge

@sirdarckcat
Copy link
Member Author

@sroettger wdyt should we make kctf always run the challenge container on a kata container (a vm)?

@sroettger
Copy link
Collaborator

Is there anything that would break with this? Does it change the performance significantly, maybe startup time?

@sirdarckcat
Copy link
Member Author

hmm yea, I think it adds some time for kata to be installed on the node (not a lot), and there's ofc some overhead with having another virtualization layer for every vmcall/interrupt/etc but that'll depend on the workload. there will also be more RAM needed per challenge instance as now every challenge instance will need to run a kernel and all that.

maybe let's leave it as opt-in, but maybe a feature on the CRD? so you dont have to modify the podTemplate but just say vm: true or something like that?

@sroettger
Copy link
Collaborator

Yeah, I think it's cool and we should add a toggle for it in the challenge.yaml.
I think it would also be fine to make it on by default, with the option to disable, since it brings much stronger isolation guarantees.

@sirdarckcat
Copy link
Member Author

lets see if we can see the cost it would have on gctf. @implr wdyt

@sirdarckcat
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants