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

Better documentation on how to create Custom Resources #87

Open
evilhamsterman opened this issue Jan 2, 2025 · 0 comments
Open

Better documentation on how to create Custom Resources #87

evilhamsterman opened this issue Jan 2, 2025 · 0 comments

Comments

@evilhamsterman
Copy link

The documentation about using and creating Custom Resources isn't that great. The documentation about loading Generic Resources is lacking in description and/or example of how to get from loading a generic resource from the cluster/yaml/crdspec to actually getting or creating an object of that resource. Also some of the example don't appear to work anymore, for example this is no longer valid

from lightkube.generic_resource import _created_resources

Plus the resources loaded from this method a lacking the type hinting for anything except the common fields like metadata and status. But often the spec field is the field you work with the most often and that lacks any hinting which is supposed to be a big part of Lightkube and throws errors in type checkers unless you use dict methods to access them. This may be ok for small things but it really sucks if you are say writing an operator.

Looking through the code and finding #54 in the issues list it is kind of possible to deduce how to create full proper models similar to the ones in the lightkube-models package but it would be nice if there were proper documentation on how to create full models

This appears to be a weakness of all the Python libraries for Kubernetes but I think Lightkube may be closest to being able to at least work with a project's models. Perhaps even document how to use your generator to generate models from an existing spec?

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

No branches or pull requests

1 participant