gpt4 book ai didi

kubernetes - 是否有任何API或Go编程逻辑来获取kubernetes集群中节点的容量?

转载 作者:行者123 更新时间:2023-12-02 12:28:55 25 4
gpt4 key购买 nike

使用kubectl描述节点,我能够获得节点资源(内存,cpu)的容量。我想通过go client或kube API(如果有)获得相同的结果。谁能帮我吗?
我正在使用minikube版本:v1.7.2
kubectl版本:
客户端:GitVersion:“v1.16.3”
服务器:GitVersion:“v1.16.2”
我正在使用metric-server访问kubernetes资源。
预期结果:
资源容量应通过go程序或kube API访问

最佳答案

Kubernetes客户端库是您需要查看https://kubernetes.io/docs/reference/using-api/client-libraries/#officially-supported-kubernetes-client-libraries的库

The following client libraries are officially maintained by Kubernetes SIG API Machinery.

Language Client Library
Go github.com/kubernetes/client-go/
Python github.com/kubernetes-client/python/
Java github.com/kubernetes-client/java
dotnet github.com/kubernetes-client/csharp
JavaScript github.com/kubernetes-client/javascript
Haskell github.com/kubernetes-client/haskell


Community-maintained client libraries
The following Kubernetes API client libraries are provided and maintained by their authors, not the Kubernetes team.

Language Client Library
Clojure github.com/yanatan16/clj-kubernetes-api
Go github.com/ericchiang/k8s
Java (OSGi) bitbucket.org/amdatulabs/amdatu-kubernetes
Java (Fabric8, OSGi) github.com/fabric8io/kubernetes-client
Lisp github.com/brendandburns/cl-k8s
Lisp github.com/xh4/cube
Node.js (TypeScript) github.com/Goyoo/node-k8s-client
Node.js github.com/tenxcloud/node-kubernetes-client
Node.js github.com/godaddy/kubernetes-client
Node.js github.com/ajpauwels/easy-k8s
Perl metacpan.org/pod/Net::Kubernetes
PHP github.com/maclof/kubernetes-client
PHP github.com/allansun/kubernetes-php-client
PHP github.com/travisghansen/kubernetes-client-php
Python github.com/eldarion-gondor/pykube
Python github.com/mnubo/kubernetes-py
Python github.com/tomplus/kubernetes_asyncio
Ruby github.com/Ch00k/kuber
Ruby github.com/abonas/kubeclient
Ruby github.com/kontena/k8s-client
Rust github.com/clux/kube-rs
Rust github.com/ynqa/kubernetes-rust
Scala github.com/doriordan/skuber
dotNet github.com/tonnyeremin/kubernetes_gen
DotNet (RestSharp) github.com/masroorhasan/Kubernetes.DotNet
Elixir github.com/obmarg/kazan
Elixir github.com/coryodaniel/k8s
Haskell github.com/kubernetes-client/haskell

关于kubernetes - 是否有任何API或Go编程逻辑来获取kubernetes集群中节点的容量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60562256/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com