以下是本人胡乱翻译的
一切错误,概不负责
kubectl get --help
Display one or many resources
Prints a table of the most important information about the specified resources. You can filter the
list using a label selector and the --selector flag. If the desired resource type is namespaced you
will only see results in your current namespace unless you pass --all-namespaces.
Uninitialized objects are not shown unless --include-uninitialized is passed.
By specifying the output as 'template' and providing a Go template as the value of the --template
flag, you can filter the attributes of the fetched resources.
Valid resource types include:
* all
* certificatesigningrequests (aka 'csr')
* clusterrolebindings
* clusterroles
* componentstatuses (aka 'cs')
* configmaps (aka 'cm')
* controllerrevisions
* cronjobs
* customresourcedefinition (aka 'crd')
* daemonsets (aka 'ds')
* deployments (aka 'deploy')
* endpoints (aka 'ep')
* events (aka 'ev')
* horizontalpodautoscalers (aka 'hpa')
* ingresses (aka 'ing')
* jobs
* limitranges (aka 'limits')
* namespaces (aka 'ns')
* networkpolicies (aka 'netpol')
* nodes (aka 'no')
* persistentvolumeclaims (aka 'pvc')
* persistentvolumes (aka 'pv')
* poddisruptionbudgets (aka 'pdb')
* podpreset
* pods (aka 'po')
* podsecuritypolicies (aka 'psp')
* podtemplates
* replicasets (aka 'rs')
* replicationcontrollers (aka 'rc')
* resourcequotas (aka 'quota')
* rolebindings
* roles
* secrets
* serviceaccounts (aka 'sa')
* services (aka 'svc')
* statefulsets (aka 'sts')
* storageclasses (aka 'sc')
显示一个或者多个资源
打印关于特别资源的重要信息的表。你通过标签选择器和 --selector 标志来过滤这些信息清单。你只能看到你当前命名空间的资源,除非你指定命名空间或者使用--all-namespaces.
未初始化的对象不显示,除非使用--include-uninitialized 参数。
通过将输出指定为‘模板’ 并且提供使用--templater 参数 自定义go 模板,你可以过滤一些获取的资源。
有效的资源类型:
* all 全部
* certificatesigningrequests (csr)证书请求
* clusterrolebinds 集群角色授权
* clusterroles 集群角色
* componentstatuses (cs) 组件状态
* configmaps (cm)配置
* controllerrevisions 修订控制器(存储了相应 DaemonSet 版本的注解和模板)
* cronjobs 定时任务
* customeresourcedefinition(crd)客户资源定义,是v1.7+新增的无需改变代码就可以扩展Kubernetes API的机制,用来管理自定义对象。它实际上是[ThirdPartyResources(TPR)](https://link.zhihu.com/?target=https%3A//kubernetes.feisky.xyz/concepts/thirdpartyresources.html)的升级版本,TPR将在v1.8中删除。
* daemonsets (ds)pod的一种使用模式
* deployments (deploy)pod 的一种使用模式
* endpoints (ep)终结点
* horizontalpodautoscalers (hps) Pod水平自动伸缩
* ingresses (ing) 集群负载均衡
* jobs 负责批量处理短暂的一次性任务
* limitranges (limits)限制范围
* namespaces (ns) 命名空间
* networkpolicies (netpol)网络规则
* nodes (no) 从节点
* persistentvolumeclaims (pvc) 持久化卷声明
* persistentvolume (pv) 持久化卷
* poddisruptionbudgets ( 'pdb') )pod分配预算,通过PodDisruptionBudget控制器可以设置应用POD集群处于运行状态最低个数,也可以设置应用POD集群处于运行状态的最低百分比,这样可以保证在主动销毁应用POD的时候,不会一次性销毁太多的应用POD,从而保证业务不中断或业务SLA不降级。
* podpreset Pod Preset是API资源,在Pod创建时可以使用它将额外的运行时需求注入到里面。可以使用标签选择器指定Pod Preset用户相应的Pod。
* pods ( 'po')
* podsecuritypolicies (aka 'psp') pod安全策略
* podtemplates pod模板
* replicasets ( 'rs')
* replicationcontrollers ( 'rc')
* resourcequotas ( 'quota')
* rolebindings 角色授权
* roles 角色
* secrets
* serviceaccounts ( 'sa') 服务账号
* services ( 'svc') 服务
* statefulsets ( 'sts') StatefulSet是一个给Pod提供唯一标志的控制器,它可以保证部署和扩展的顺序。
* storageclasses ( 'sc') 可以定义多个 StorageClass 对象,并可以分别指定存储插件、设置参数,用于提供不同的存储卷。
网友评论