kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
141 stars 45 forks source link

How can I use Node Proxy Api? #159

Closed minerba closed 1 year ago

minerba commented 1 year ago

Hi, I m using kubernetes/c-client.

I need to result of below command.

"curl -g --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -X GET https://[${KUBERNETES_SERVICE_HOST}]:${KUBERNETES_SERVICE_PORT}/api/v1/nodes/${NODE_NAME}/proxy/summary"

But I can't find api in the CoreV1API, Related Node Api.

How can I use this api?

brendandburns commented 1 year ago

I believe that this function will get you what you need:

https://github.com/kubernetes-client/c/blob/master/kubernetes/api/CoreV1API.h#L131

minerba commented 1 year ago

Hi @brendandburns I found a API , But there is no Parser , related to uppon api . I need to develop the parser?

brendandburns commented 1 year ago

As far as I know there is no structure for the proxy API. What are you trying to do? It might help to have more context.

minerba commented 1 year ago

I need rootfs from node Api. because rootfs include data of Disk usage.

brendandburns commented 1 year ago

Anything below /proxy isn't a Kubernetes API, it's some other API that happens to be running on the node. So you will need to write your own code to interpret the char* that is returned.

brendandburns commented 1 year ago

Note that you should be able to get the DiskPressure state from the node's conditions array, but that may not be sufficient for what you are looking for.

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale