kubernetes-client / c

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

Is there an api to get node status? #136

Closed yess1987 closed 1 year ago

yess1987 commented 1 year ago

We need to use the c library to get the node status, is there a solution?

ityuhui commented 1 year ago

Is this OK ?

https://github.com/kubernetes-client/c/blob/master/kubernetes/docs/CoreV1API.md#CoreV1API_readNodeStatus

yess1987 commented 1 year ago

let me try and wait for my good news

yess1987 commented 1 year ago

We need to use the c library to get the role of etcd , is there a solution?

ityuhui commented 1 year ago

Can you describe in detail about "the role of etcd" ?

e.g. Is the etcd a built-in component of Kubernetes (for API Server to save cluster information) or something you deploy it for your workload ?

And is this what you want ? kubectl exec etcd-kind-control-plane -n kube-system -- etcdctl role list

yess1987 commented 1 year ago

I need to know which node is the leader in k8s, so consider using the leader in etcd

ityuhui commented 1 year ago

Can you find a solution for your requirement via kubectl?

The C client library only communicates with the Kubernetes API server, which behaves like client-go/kubectl.

brendandburns commented 1 year ago

You shouldn't need to look at etcd, you can look at the labels on the node to determine where the api server is, specifically the node-role.kubernetes.io/control-plane should be present on any nodes that contain the Kubernetes control plane.

k8s-triage-robot commented 1 year ago

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

This bot triages issues and PRs according to the following rules:

You can:

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

/lifecycle stale

k8s-triage-robot commented 1 year ago

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

This bot triages issues and PRs according to the following rules:

You can:

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

/lifecycle rotten

k8s-triage-robot commented 1 year ago

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

This bot triages issues according to the following rules:

You can:

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

/close not-planned

k8s-ci-robot commented 1 year ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-client/c/issues/136#issuecomment-1399056809): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.