You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kubernetes中deployments的kubectl缩写是什么?资源缩写列表在哪查?

Kubernetes kubectl资源类型缩写查询方法

获取全量资源缩写列表

执行以下命令即可输出当前集群支持的所有资源类型及对应可用缩写:

kubectl api-resources

返回结果中SHORTNAMES列就是对应资源支持的缩写,各列含义:

  • NAME:资源类型全称
  • SHORTNAMES:资源可使用的短写形式
  • APIVERSION:资源归属的API版本
  • NAMESPACED:标记资源是否为命名空间级资源
  • KIND:资源对应的Kind字段值

如果不需要看无缩写的资源,直接执行过滤命令即可筛出所有带短名的资源:

kubectl api-resources | awk 'NR==1 || $2 != ""'

deployments对应的缩写

deployments的kubectl资源缩写为deploy,使用时和全称效果完全一致,以下两种操作写法完全等价:

kubectl describe deployments/nginx-demo
kubectl describe deploy/nginx-demo

高频使用的资源缩写参考

日常操作中常用的内置资源缩写对应关系如下:

  • po -> pods
  • rs -> replicasets
  • deploy -> deployments
  • svc -> services
  • cm -> configmaps
  • ing -> ingresses
  • ns -> namespaces
  • no -> nodes
  • pv -> persistentvolumes
  • pvc -> persistentvolumeclaims
  • sa -> serviceaccounts
  • ds -> daemonsets
  • sts -> statefulsets
  • hpa -> horizontalpodautoscalers

不同Kubernetes版本、集群安装的CRD资源不同,支持的缩写列表会存在差异,最准确的结果请以当前集群执行kubectl api-resources的返回内容为准。

内容的提问来源于stack exchange,提问作者gabriel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.02 23:45:54