Skip to content
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 etcdctl defrag Functionality to k0s etcd Subcommand #4970

Open
Skaronator opened this issue Sep 13, 2024 · 1 comment
Open

Add etcdctl defrag Functionality to k0s etcd Subcommand #4970

Skaronator opened this issue Sep 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Skaronator
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The k0s cluster we use at work has already become significantly fragmented, despite being only 111 days old.

etcd database size is 40.25% of the allocated disk space. Please run defragmentation (e.g., etcdctl defrag) to reclaim unused fragmented disk space.

Currently, running etcdctl defrag is cumbersome, as it requires manually installing the tool, shutting down the k0s control plane, performing the defrag, and then restarting it—this has to be repeated for all 5 control plane nodes.

It would be fantastic if the k0s etcd subcommand could integrate this functionality, as defragmentation seems to be a common maintenance task when using etcd.

Describe the solution you would like

The k0s etcd subcommand should provide access to the etcdctl defrag functionality. When running this command, it should first verify that the k0s control plane is stopped on the node before proceeding with the defragmentation. This would automate the process and ensure that the defrag is safely executed on each node.

Additionally, this could be integrated with k0sctl to run k0s etcd defrag across all nodes in the cluster, further simplifying cluster-wide defragmentation.

Describe alternatives you've considered

If integrating this functionality into k0s is not feasible or adds unnecessary complexity, a suitable alternative would be to provide detailed documentation on how to perform defragmentation with k0s manually.

Additional context

No response

@Skaronator Skaronator added the enhancement New feature or request label Sep 13, 2024
@jnummelin
Copy link
Member

running etcdctl defrag is cumbersome, as it requires manually installing the tool, shutting down the k0s control plane, performing the defrag, and then restarting it—this has to be repeated for all 5 control plane nodes.

This means that just bundling the k0s etcd defrag command does not actually help much. Instead there should be something to coordinate this whole thing.

So instead of bundling the single command, I think we should try if we can figure out how k0s could actually do all this in coordinated manner, maybe controlled/triggered via a CRD.

a suitable alternative would be to provide detailed documentation on how to perform defragmentation with k0s manually

That's definitely something that should be done. @Skaronator Any chance you could write that up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants