Loading... #### kubectl作为客户端CLI工具,可以让用户通过命令行对Kubernetes集群进行操作。 #### kubectl命令行的语法: ##### kubectl [command] [TYPE] [NAME] [flags] #### 1.command:子命令,用于操作Kubernetes集群资源对象的命令,例如:create、delete、describe、get、apply等。 #### 2.TYPE:资源对象的类型,区分大小写,能以单数、复数或者简写形式表示。 #### 3.NAME:资源对象的名称,区分大小写,如果不指定名称,系统则将返回属于TYPE的全部对象列表,例如 kubectl get pods 将返回默认名称空间的Pod列表。 #### 4.flags:kubectl子命令的可选参数,例如使用"-s"指定API Server的URL地址而不用默认值。 | 资源对象类型 | 缩写 | | - | - | | clusters | | | componentstatuses | cs | | configmaps | cm | | daemonsets | ds | | deployments | deploy | | endpoints | ep | | events | ev | | horizontalpodautosalers | hpa | | ingresses | ing | | Jobs | | | limitranges | limits | | nodes | no | | namespace | ns | | networkpolicies | | | statefulsets | | | persistentvolumeclaims | pvc | | persistentvolumes | pv | | pods | po | | podsecuritypolicies | psp | | podtemplates | | | replicasets | rs | | replicationcontrollers | rc | | resourcequotas | quota | | cronjob | | | secrets | | | serviceaccounts | sa | | services | svc | | storageclasses | sc | | thirdpartyresources | | Last modification:August 5th, 2020 at 10:19 pm © 允许规范转载