-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add fsfreeze example to documentation #245
Comments
It would be cool if this was written as an operator service, and run as a daemonSet. The service could watch for events to freeze/unfreeze the volumes. |
A daemonset might be challenging (it would need access to all the volumes for all the pods it wants to freeze, and it would be difficult to signal easily), but we are thinking that it would be nice to use an annotation+initializer+controller to make this happen automagically. For example:
What do you think about something like that? |
That seems simpler from an implementation- but if I'm understanding it all correctly, that might be a bit fragile and prone to race conditions. Here's why: if ark patches the pod resource directly, what's keeping the replica set from editing the pod while the fs is frozen? If ark patches the RS, what happens if a deployment is updated during the fs freeze? Also, if ark patches the deployment, it causes noise in my audit stream. I think the even simpler & less magical way is to require users to manually add a sidecar controller to pods that need this feature. |
There's not a race that I can foresee. When a Kubernetes object has an initializer, it means that it's not visible to most of the system. Only components that ask for uninitialized objects (such as initializer controllers) will see them. So when the RS controller submits a pod for creation, our initializer controller would intercept it, mutate it to add the annotations & sidecar container, and then once there were no more pending initializers, the pod would be "created" and visible to everyone. Does that make more sense? |
Yes it does make sense- I didn't realize that was possible. Is this k8s feature by design? Could this behavior change in the future? My recommendation from an end-user's perspective is for this to be designed as two features:
|
Initializers is an alpha feature in Kubernetes. The behavior could change in the future given that it's alpha. This issue is focused on documenting how to fsfreeze using pre/post hooks and a sidecar container. In the future (v0.8.0 or later), we hope to make it easier to do this. Making it easier to install is part of #52, and will ultimately probably be done with an |
Fixed by #795 |
Makefile.prow `GOFLAGS=` when `go install`
Note that fsfreeze requires a privileged container.
Suggest that 1 option is to run a sidecar pause container that contains fsfreeze and has the appropriate volumeMount(s).
Show using pre/post hooks once #244 is resolved.
The text was updated successfully, but these errors were encountered: