-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Use kube-score as library #419
Comments
Hey @baez90, thanks for your nice words! Yes! I definitely think that it makes sense to improve the API to make kube-score easier to use by other projects. I think that I've seen kube-score used as a library a few times actually, or at least wrapped in one way or another. I'll do some searching to see if I can find the project again, to see how they used it / what it was used for. It might be good input for the API design. I have no clear ideas yet for what the API could look like, but it sounds like you do. 😄 Let's collaborate on the API either here in the issue or in PRs if that's easier for you. Totally agree on the point of extensibility for custom CRDs or custom checks for built in objects too, but I agree that it’s more of a long term thing. We can start improving the API for embedding first. |
I think I sense some enthusiasm here and I'm very glad to hear that! 😄 The only think I had to change was this which allows me to pass new checks defined out of tree already. Apart from that I'm actually already done with the integration and I'm already generating reports based on your impressive rule set 😊 The biggest...problem I encountered was that I had to re-implement all your interfaces like And that is actually where I 'feel' the hardest limitation...I was wondering why not e.g. using the controller-runtime's fake client to store all either parsed or retrieved objects and pass this fake client (probably as Spontaneous idea for keeping the file relations: type FileSourcedPod struct {
*corev1.Pod
ks.FileLocationer
} That way you could still use a I'm thinking about how to...open up the API a bit already for quite some time but I'm not yet sure what might be the best approach...for instance with this approach there's no easy way to migrate the meta checks. But probably an exception for this very special kind of checks wouldn't be that hard? Any ideas? What do you think about the fake client approach? |
First of all: kube-score is an awesome project! Thanks for all your efforts!
I would like to use kube-score more in a library/'framework' way as part of an internal project to provide best practice reports to our Kubernetes teams.
Therefore some additional features would come in handy:
Score
function only takes a configuration struct. To be able to use kube-score as library it would be nice to be able to pass the*checks.Checks
as parameter to be able to add custom checks that only apply to our environment.I'd have a rough idea how to achieve all this but I figured it would be better to first ask you what you think, is this something you'd be interested in? Shall I just create a PR(s) and we discuss further details directly in these?
The text was updated successfully, but these errors were encountered: