Skip to content

Instantly share code, notes, and snippets.

@oxr463
Created July 29, 2021 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxr463/6c1f29ae98b79767d08de8231f1e1110 to your computer and use it in GitHub Desktop.
Save oxr463/6c1f29ae98b79767d08de8231f1e1110 to your computer and use it in GitHub Desktop.
# Check Open Sockets
# See: https://github.com/rancher/rancher/issues/31324
NAME=$(docker ps --format='{{.Names}}' |grep k8s_cluster-register_cattle-cluster-agent)
PID=$(docker inspect -f '{{.State.Pid}}' "$NAME")
[ ! -d /var/run/netns ] && mkdir /var/run/netns
ln -sf /proc/$PID/ns/net "/var/run/netns/$NAME"
ip netns exec ${NAME} lsof -i -n -P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment