批量查询k8s 所有pod的ip和端口
kubectl get pods --all-namespaces -o jsonpath='{range .items[*]}{"\n"}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{range .spec.containers[*]}{"\t"}{.name}{"\t"}{range .ports[*]}{"\t"}{.containerPort}{"/"}{.protocol}{"\n"}{end}{"\n"}{end}'

2万+

被折叠的 条评论
为什么被折叠?



