-
kubectl 컨테이너 netstat 정보알기카테고리 없음 2019. 1. 9. 17:50
#!/bin/bash
kubectl get pods -o wide |awk '{ print $1 }' | grep -w "단어" | head -n 55 > w.out
kubectl get pods -o wide |awk '{ print $1 }' | grep -w "단어" | head -n 55 | wc -l
cDate=`date '+%Y-%m-%d %T'`
echo "$cDate"
for B in $(cat ./w.out)
do
echo ${B}
kubectl exec -it ${B} -- netstat -tan | grep -i 'SYN_SENT'
done