根据 PID 查找 Pod 信息
编辑 ~/.bashrc,粘贴以下函数,并执行 source ~/.bashrc 使其生效,使用时执行 podinfo $pid通过 PID 获取 Pod 名称12345podinfo() { CID=$(cat /proc/$1/cgroup | awk -F '/' '{print $5}') CID=$(echo ${CID:0:8}) crictl inspect -o go-template --template='{{index .status.labels "io.kubernetes.pod.name"}}' $CID} 通过 PID 获取 Pod UID123podUid() { cat /proc/$1/mountinfo | grep "etc-hosts" | awk -F / {'print $6'}...
