Kubernetes REST API [英] Kubernetes REST API
问题描述
kubernetes 是否可以通过 REST API 访问?我正在查看 Kubernetes API 页面,它看起来非常神秘/不完整.他们谈论新版本,但没有在任何地方公开 API 用法或文档.我只是想知道除了使用 kubectl
命令之外,是否还有其他方法可以访问集群信息.
Does kubernetes accessible via a REST API? I was looking over at the Kubernetes API page and it all looks very cryptic / incomplete. They talk about new versions but have not disclosed the API usage or docs anywhere. I just wanted to know if there is a way to access the cluster information in any other way other than using the kubectl
command.
示例用法:
我现在在做什么:
kubectl get pod --context='my-prod-cluster'
我想做什么:
curl GET/some/parameters/to/get/info
推荐答案
您可以通过将 --v=8
传递给任何 kubectl 命令来查看 kubectl 正在进行的所有 API 调用
You can see all the API calls kubectl is making by passing --v=8
to any kubectl command
这篇关于Kubernetes REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!