kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
146 stars 46 forks source link

About metric API #23

Closed clearday4 closed 3 years ago

clearday4 commented 4 years ago

Do you have a plan to support "apis/metrics.k8s.io/v1beta1" APIs for gathering resources?

ityuhui commented 4 years ago

Hi @clearday4

I think the metrics API support depends on CRD (CustomResourceDefinition) support. So we will not start to support it before CRD is supported.

Thank you for your proposal for the feature. I will append here if there is any further progress.

brendandburns commented 4 years ago

The other option is to implement the generic API similar to what the Java code does here:

https://github.com/kubernetes-client/java/blob/master/util/src/main/java/io/kubernetes/client/util/generic/GenericKubernetesApi.java

I'll see if I have cycles to add that.

brendandburns commented 4 years ago

I've started working on the generic client.

brendandburns commented 4 years ago

The generic client has now merged.

There is an example here:

https://github.com/kubernetes-client/c/blob/master/examples/generic/main.c

You can use apiGroup: "metrics.k8s.io" version: "v1beta1", resourcePlural: "nodes" or "pods"

and the generic client to access metrics.

clearday4 commented 4 years ago

Thank you for kind answer It will be very helpful for us.

clearday4 commented 3 years ago

closed