kubectl get pods -n kube-system -o=jsonpath='{range .items[*]}[{.metadata.name},{.status.containerStatuses[0].image}]{"\n"}{end}'
kubectl get deployments -n kube-system -o=jsonpath='{range .items[*]}[{.metadata.name},{.spec.template.spec.containers[0].image}]{"\n"}{end}'
kubectl get deployments. -n compute -o=jsonpath='{range.items[*]}{.metadata.name}{"\n"}{end}'
#输出格式为:
xxx-front
xxx-service
kubectl -n XXX get lcr -o=jsonpath='{range.items[*]}{.spec.data.release}{":"}{.spec.data.source.reference}{"\n"}{end}'
webshell:XXX
websocket-service:XXX
参考大佬博客:https://blog.51cto.com/u_11555417/5521927