-
Notifications
You must be signed in to change notification settings - Fork 559
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
[k8s] Fix mounting when launching from a service account #3532
Conversation
…o k8s_sa_namespace_permissions_2
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 for the fix @romilbhardwaj! Mostly looks good to me : )
sky/provision/kubernetes/config.py
Outdated
kubernetes.core_api().patch_namespaced_service_account( | ||
name, namespace, account) |
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.
Is it possible to check the config of the account first and only patch the service account if it does not have all the config?
Reason: previously, we only required read permission for the user's account, but now we require write permission as well. This is to make sure the following works: the admin create the service account for all users and create restrictive user accounts with only read permission (this is what we made sure for the other clouds). Wdyt?
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.
Good point! I've updated checks to patch only if the existing role does not match the required permissions.
Thanks @Michaelvll! Running smoke tests now:
|
Tests pass, merging now! |
Closes #3530.
Adds the appropriate permissions to create the skypilot-system namespace and create resources in it.
Tested (run the relevant ones):
bash format.sh
test_managed_jobs_storage
for kubernetespytest -v tests/test_smoke.py::test_managed_jobs_storage --kubernetes