k0sproject / k0s

k0s - The Zero Friction Kubernetes
https://docs.k0sproject.io
Other
3.42k stars 353 forks source link

Improvements to Kubernetes related code generation #2909

Open twz123 opened 1 year ago

twz123 commented 1 year ago

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

K0s uses Kubebuilder's controller-tools to generate the CRD manifests and deepcopy code, as well as the standard Kubernetes code-generator to auto-generate the typed go clients for its Custom Resource types.

The way k0s does it right now is a bit different than other projects, including Kubernetes itself do it. That makes it a bit challenging to work with k0s's CRDs, as things don't work the way they work elsewhere.

Describe the solution you would like

Use the code generation tools in a more standard way. Moreover, there are even more code generation features available in the aforementioned libraries which might have a positive impact on the k0s codebase.

Some fixes/improvements that may be worthwhile to implement:

Describe alternatives you've considered

No response

Additional context

There's also conversion-gen, which allows for evolving API versions by generating boilerplate to convert between multiple external versioned representations of a CRD and the internal unversioned representation of a CRD. Maybe that might help in sorting out the "node config vs. cluster config" difficulty.

twz123 commented 5 months ago

This is still relevant, as this might also unlock the possibility to evolve k0s's API versions in the future.

github-actions[bot] commented 1 month ago

The issue is marked as stale since no activity has been recorded in 30 days

github-actions[bot] commented 2 weeks ago

The issue is marked as stale since no activity has been recorded in 30 days