-
Notifications
You must be signed in to change notification settings - Fork 1.2k
agent: alternative implementation for sealed_secret as volume #10674
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
Conversation
@stevenhorsman @fitzthum @Xynnn007 @ChengyuZhu6 @sprt I made an attempt to remove the mount path prefix restriction for sealed_secret as volume. Raising a draft PR to get your feedback on the approach and if is a better alternative to try out. |
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.
Thx @bpradipt I just have an idea that about introducing a method to handle this checking logic. but It almost looks good to me.
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.
Thanks @bpradipt ! I think this approach is likely to improve usability and looks good to me. Just two minor comments:
- The unrelated file to be unsealed may lead to confusion in logging.
- We may need to update the test case of sealedsecret in ci at the same time.
The example test pods uses the following mountpath and I don't think we need to change this. Let me know if you think otherwise and I'll change it to some other path..
|
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.
I think this approach is fine. It's a little weird to check each file to see if it is sealed, but I guess it only scales with the total number of mounts.
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
The sealed secret CI tests for both env and file are failing.
This error comes from I checked the sealed secret input in the CI and it's proper.
Looking for ideas where to look at next to root cause this issue.. @stevenhorsman @fitzthum @ChengyuZhu6 or anyone .. |
The earlier implementation relied on using a specific mount-path prefix - `/sealed` to determine that the referenced secret is a sealed secret. However that was restrictive for certain use cases as it forced the user to always use a specific mountpath naming convention. This commit introduces an alternative implementation to relax the restriction. A sealed secret can be mounted in any mount-path. However it comes with a potential performance penality. The implementation loops through all volume mounts and reads the file to determine if it's a sealed secret or not. Fixes: kata-containers#10398 Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
Sorry for the stupid question here, but just thinking about the env test that is failing first:
But your new debug code is in the unseal_file path, not the For the sealed file test, we seem to get the same response:
From the limited debug info we have here it looks like it's failing in the CDH:
but if it's using the secret we'd expect, then the 3rd section (
So I guess my conclusion is that we must be acting on a different secret then? I'm not sure how to get further with debug though - debugging in the guest-components has always been difficult/impossible :( |
@stevenhorsman from the logs - https://github.com/kata-containers/kata-containers/actions/runs/12726288825/job/35508106381?pr=10674 both the unsealed_env and unsealed_file tests are failing
They both are failing. From the logs at least it looks like the pod is using the correct secrets. But I can't be sure :-( |
Yeah my point was - should the unseal_file code be running on the env test? |
@bpradipt I think this issue might stem from the patch applied from CDH, as seen in this commit: confidential-containers/guest-components@8749486? |
I think we can resolve the issue by updating the encoded string of sealed secret in the ci. |
Great find @ChengyuZhu6 .. Let me try updating the encoded string values in ci |
Thanks for the help @ChengyuZhu6 - I'm still not clear why Pradipta's code changes would be the first thing to hit it? Any ideas why the nightly isn't failing as soon as we bumped the guest-components to pick up that patch? |
any likelihood of cached artefacts being used for the test cluster? |
The existing encoding was base64 and it fails due to confidential-containers/guest-components@8749486 Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
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 thanks @bpradipt
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.
I would still like to understand why we weren't getting failures with the guest-components bump PR (or nightly) if the encoding was the problem, but I don't think that should block this PR now the tests are passing
The earlier implementation relied on using a specific mount-path prefix -
/sealed
to determine that the referenced secret is a sealed secret. However that was restrictive for certain use cases as it forced the user to always use a specific mountpath naming convention.This commit introduces an alternative implementation to relax the restriction. A sealed secret can be mounted in any mount-path. However it comes with a potential performance penality. The implementation loops through all volume mounts and reads the file to determine if it's a sealed secret or not.
Fixes: #10398