cnrancher / autok3s

Run K3s Everywhere
https://www.suse.com
Apache License 2.0
753 stars 76 forks source link

[Feature Request] Reduce autok3s binary size by using plugin mode for providers #596

Closed orangedeng closed 10 months ago

orangedeng commented 1 year ago

Is your feature request related to a problem? Please describe. For now, the autok3s binary size is very huge for a k3s cli tools. The cause of the problem is from the SDK of aliyun/aws/google and etc.

Describe the solution you'd like We should try to build those providers as a plugin of autok3s and download/load it when needed. Following is the goweight file for the v0.8.0-rc1 version of autok3s: size.txt

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

orangedeng commented 1 year ago

I test to remove all public cloud provider, the size of Darwin binary goes down ~40MB. And I test to remove kubectl, the size goes down ~15MB.

With the native and k3d provider embedded, the binary goes to 50 - 57 MB, reduced 50% before binary compress. Also tested after compress, it would be 15-16 MB after compress. reduced ~40%.

orangedeng commented 10 months ago

No need to make fancy improvement. The binary size is acceptable for now. Will re-open this issue when the binary size gets unacceptable.