美文网首页
kubectl 自定义输出列

kubectl 自定义输出列

作者: myonlyzzy | 来源:发表于2019-10-24 11:27 被阅读0次

kubectl 获取资源信息时有默认的资源信息列,除此之外kubectl也支持自定义资源信息列.

example

获取自定义的deployment信息,自定义 namespace,name
,replicas,nodeSelector.

kubectl get deployment   -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,REPLICAS:.spec.replicas,NODE-SELECTOR:.spec.template.spec.nodeSelector --all-namespaces=true  >/tmp/deploy-all.txt

上面通过参数-o custom-columns定义了自动输出的列,自定义了列头和输出内容.

相关文章

网友评论

      本文标题:kubectl 自定义输出列

      本文链接:https://www.haomeiwen.com/subject/vcscdxtx.html