greguz/fastify-kubernetes

create the client

Closed this issue · 2 comments

I think this library would benefit of creating the client internally, rather than leaving that to the user. Making the user add a dependency that is already a dependency of this module is going to cause alignment problems in the future. I recommend that you create the client internally, so that an user gets app.kubernetes.client instead of calling makeClient.

Hehe, the problem with @kubernetes/client-node is that there are a lot of clients 😅

I've managed to dynamically load all of them, so you can just read a simple variable from the fastify's decorator.

Check out the updated README and tell me what you think.

All possible k8s clients are typed, created and cached internally now.