-
Notifications
You must be signed in to change notification settings - Fork 1.1k
kata: support confidential container's api for pulling image in the guest #7471
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
kata: support confidential container's api for pulling image in the guest #7471
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7471 +/- ##
==========================================
- Coverage 48.38% 48.29% -0.10%
==========================================
Files 145 145
Lines 16055 16087 +32
==========================================
+ Hits 7768 7769 +1
- Misses 7350 7381 +31
Partials 937 937 |
83b084d to
cf2ddc1
Compare
|
/retest |
cf2ddc1 to
73af464
Compare
|
/retest |
sohankunkerkar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Looks sane to me!
|
is the content in https://github.com/kata-containers/kata-containers/tree/CCv0 going to be merged into the main branch? If we implement this feature here, is there any risk to kata that is unpatched? |
This content is in the process of being merged to main (there are several ongoing PRs for that). Additional features will be added to that - sharing container images in a volume from the host typically. But what I have in this PR will stay: Both pull-in-guest and volume sharing need to be supported in the end. |
73af464 to
3d1e31b
Compare
|
/retest |
|
I chatted with @littlejawa at today's cri-o meeting, and we agreed to unset the milestone for this. We will still aim to backport it to 1.28, but will wait to do so until the CCv0 changes are merged into upstream kata |
…uest For confidential container, we want to have the ability to pull the image on the guest side, and not rely on the host's repository. To achieve this, an extension to the kata shim's options for CreateContainer was added. Provided the right information through these options, the kata agent in the remote VM will proceed with the PullImage before handling the actual CreateContainer. This commit adds support for this method. Signed-off-by: Julien Ropé <[email protected]>
3d1e31b to
fff6493
Compare
|
Modified the vendoring to point to kata/main branch. The only thing this PR requires is the code for the KataVirtualVolume object. The vendoring is not done on a tag, because that code was not released in kata yet. |
|
/retest |
|
/approve LGTM, @cri-o/cri-o-maintainers PTAL |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, littlejawa, saschagrunert, sohankunkerkar The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
1 similar comment
|
/retest |
|
/cherry-pick release-1.28 |
|
@haircommander: #7471 failed to apply on top of branch "release-1.28": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
For confidential container, we want to have the ability to pull the image on the guest side, and not rely on the host's repository.
To achieve this, an extension to the kata shim's mount options for CreateContainer was added. Provided the right information through these options, the kata agent in the remote VM will proceed with the PullImage before handling the actual CreateContainer.
This commit adds support for this method.
As part of this, I am adding an option to the runtime configuration, making it possible to select whether or not the additional data should be sent.
We need it to be configurable, because there are use cases for confidential containers where pull-in-guest is not desired (like: sharing a volume from the host to the VM, containing the container images).
Additionally: with this feature enabled, cri-o will still comply with kubernetes' "PullImageRequest", even though the resulting container image is not used.
This can be an issue, not only in terms of resource usage: if the workload is encrypted and cri-o can't access it, cri-o will fail the PullImageRequest, and kubernetes will never send CreateContainer.
I'm looking for a way to avoid this situation, maybe making cri-o skip PullImage for a specific runtime. This will be a separate PR - suggestions are welcome.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Here is how I've been testing it:
Prerequisite: build/install kata from the CCv0 branch (https://github.com/kata-containers/kata-containers/tree/CCv0).
Build/install cloud-api-adaptor and related podvm image, using libvirt as the cloud provider (and have a libvirt server available that you can talk to).
(https://github.com/confidential-containers/cloud-api-adaptor/)
Add the following configuration to crio, to define new runtime classes:
/etc/crio/crio.conf.d/50-kata-runtimes
The kata configuration files
configuration.tomlandconfiguration-remote.tomlare the default, built and installed as part of kata-container../cloud-api-adaptor libvirt -uri="qemu+ssh://[libvirt server address]/system?no_verify=1"Then try to load the same container, using the different runtime classes.
I'm using the following script:
runtest.sh
The logs from cloud-api-adaptor show the difference of behaviour.
In addition, logging into the pod VM, I can check the kata-agent's logs in journalctl and confirm that it actually pulled the image on its own, without receiving the PullImage request
Does this PR introduce a user-facing change?