目录
1. kubectl定制显示栏位
新建一个文件:custom-columns-depolyment-requests.txt
NAMESPACE NAME Request_CPU
metadata.namespace metadata.name spec.template.spec.containers[0].resources.requests.cpu
然后使用参数-o custom-columns-file=custom-columns-depolyment-requests.txt来查看:
[root@sh-saas-k8scs2-master-online-01 ~]# kubectl get deployments --all-namespaces -o custom-columns-file=custom-columns-depolyment-requests.txt | grep -v -E "00m" | grep -v "none"
NAMESPACE NAME Request_CPU
public-oa-node-online public-oa-weekly-service-node-online 250m
saas-caiwu-tomcat-online saas-caiwu-wmpay-adapter-tomcat-online 1
saas-caiwu-tomcat-online saas-caiwu-wmpay-service-tomcat-online 1
saas-ec-tomcat-online saas-ec-coupon-management-tomcat-online 1
saas-ec-tomcat-online saas-ec-discount-service-tomcat-online 1
saas-ec-tomcat-online saas-ec-guide-management-tomcat-online 1
saas-ec-tomcat-online saas-ec-merchant-management-tomcat-online 1
saas-ec-tomcat-online saas-ec-openapi-tomcat-online 4
saas-ec-tomcat-online saas-ec-platform-web-tomcat-online 2
saas-ec-tomcat-online saas-ec-promotion-service-tomcat-online 1
saas-inter-tomcat-ol saas-interactive-address-service-tomcat-online 1
saas-inter-tomcat-ol saas-interactive-address-web-tomcat-online 1
saas-inter-tomcat-ol saas-interactive-logistics-service-tomcat-online 1
saas-inter-tomcat-ol saas-interactive-logistics-web-tomcat-online 1
saas-jcpt-tomcat-online saas-jcpt-uc-base-core-tomcat-online 1
saas-jcpt-tomcat-online saas-mc-base-core-service-tomcat-online 1
saas-kf-tomcat-online saas-kf-aal-tomcat-online 1
saas-kf-tomcat-online saas-kf-base-tomcat-online 1