kubectl
是控制k8s clustet manager
的命令行工具:
$ kubectl
kubectl controls the Kubernetes cluster manager.
Find more information at https://github.com/kubernetes/kubernetes.
Usage:
kubectl [flags]
kubectl [command]
Available Commands:
get Display one or many resources
describe Show details of a specific resource or group of resources
......
kubectl
使用了cobra这个项目作为构建命令行的工具,它包含commands
,args
和flags
的概念:
Commands represent actions, Args are things and Flags are modifiers for those actions.
The pattern to follow is APPNAME VERB NOUN --ADJECTIVE. or APPNAME COMMAND ARG --FLAG
举个例子:
$ kubectl get node --v=10
kubectl
是appname
,get
是command
,node
是arg
,--v=10
是flag
。