Kubernetes REST API [英] Kubernetes REST API

查看:85
本文介绍了Kubernetes REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以通过REST API访问kubernetes吗?我正在查看 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆