-
Notifications
You must be signed in to change notification settings - Fork 7
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
automatically remove user registry secrets #333
Comments
@ableuler after our brief discussion today, here are our options to tackle this: A. Add a preStop hook on the pod that runs the jupyterhub server to delete the token once the pod is shut down
B. Add a cronjob that will look through the secrets and delete old ones that are not tied to a pod that runs jupyterhub
Let me know what you think. Hopefully I did not miss any major considerations in writing this up. I tried to access the k8s api from a running pod and the requests would time out as long as the egress networkPolicy from #430 is active. When I delete this egress policy then I can successfully reach the k8s API. I am not sure if this warrants a further/wider discussion about how much access to the k8s API we give to users and how we control/restrict this. |
Thanks @olevski for laying out the options. I think option B is better. I don't mind secrets being around a bit longer than needed as long as they are eventually cleaned up. |
Under Option A there is also the possibility to have the secret around way longer than necessary - it's only needed at launch time, and the time between launch and the preStop hook being executed could be days or even weeks. The cron job running in ~30 minute intervals on the other hand means there is always a clear worst-case scenario. |
@rokroskar We actually discussed this: I guess we definitely need the secret until the pod has been assigned to a node (which can take a while in the case of insufficient resources). Do you know if currently k8s will reschedule a user pod on a different node in case of a node failure? |
Right, so the secret culling process has to check whether the pod that might need the secret is actually up and running already or not, to avoid the situation where the secret would be removed before the credentials are actually used. AFAIK if the node fails the pod is gone. |
True - I actually hope so because all the ephemeral disk space would be gone anyway... |
In #327 we introduced a mechanism to use the user's own authentication token for pulling images from private repositories. We want to minimize the amount of time these credentials are left around so we need some mechanism for removing them.
Some ideas:
The text was updated successfully, but these errors were encountered: