What is command to find detailed information about Kubernetes master(s) using kubectl?

烂漫一生 提交于 2020-04-07 14:00:32

问题


Let say I want to find the kubelet and apiserver version of my k8s master(s), what's the best way to do it?

I am aware of the following commands:

kubectl cluster-info

which only shows the endpoints.

kubectl get nodes; kubectl describe node <node>;

which shows very detail information but only the nodes and not master.

There's also

kubectl version

but that only shows the kubectl version and not the kubelet or apiserver version.

What other commands can I use to identify the properties of my cluster?


回答1:


kubectl version also shows the apiserver version. For example, this is the output when I run it:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"}

The second line ("Server Version") contains the apiserver version. There isn't a way to get the master's kubelet version if it isn't registered as one of the nodes (which it isn't if it isn't showing up in kubectl get nodes), but in most deployments it'll be the same version as the apiserver.



来源:https://stackoverflow.com/questions/38230452/what-is-command-to-find-detailed-information-about-kubernetes-masters-using-ku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!