kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

How to list nodes?

Open TheElectronWill opened this issue 2 years ago • 2 comments

Hello!

Thanks for the scala library. How can I list the nodes of the cluster? There's KubernetesClient.pods but no KubernetesClient.nodes.

With the java kubernetes client I can call api.listNode(null, false, null, null, null, 10, null, null, null, false), which is really ugly but gets the nodes.

TheElectronWill avatar Jun 09 '22 07:06 TheElectronWill

I'm newbie to the library and to Cats, and I don't even know how to list pods. There is no doc.

DavidPerezIngeniero avatar Aug 26 '22 11:08 DavidPerezIngeniero

It doesn't seem possible :( There are other Scala libraries Kubernetes like skuber

TheElectronWill avatar Aug 26 '22 20:08 TheElectronWill

Hi @TheElectronWill, It is indeed not supported (contribution welcome 🙂).

@DavidPerezIngeniero More doc would be nice but I personally don't have much time for it. I believe code and tests should somewhat give documentation. Cats has top notch documentation to me. For this project what people do is they create a KubernetesClient and then from the client write a dot . and let your IDE drive you. For example listing pods is as easy as:

kubernetesClient.pods.list()

Use Idea between . offer the possibilities and choose the one that suits you. If any operations like listing nodes was offered, as @TheElectronWill mentioned it would be under kubernetesClient.nodes.list().

Thanks

joan38 avatar May 22 '23 12:05 joan38