kubectl 컨테이너 netstat 정보알기 :: 에버노트

ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 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

    댓글

Designed by Tistory.