CKA

Networking

백셀건전지 2022. 2. 14. 13:29
  • https://kubernetes.io/ko/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/
  • master node에 연결되어 있는 network configure 확인하는 명령어. 입력 후 master node의 IP 찾으면 됨
  • ip a
    ip link
  • 연결하려는 시스템의 MAC 주소 확인하는 명령어
  • arp node01
    arp -v
  • default gateway IP 확인하는 명령어
  • ip route show default
  • pod 포트번호 확인 명령어
  • netstat -nplt
  • Correct! That's because 2379 is the port of ETCD to which all control plane components connect to. 2380 is only for etcd peer-to-peer connectivity. When you have multiple master nodes. In this case we don't.
  • kubelet network plugin 확인하는 명령어. 명령어 결과에서 --network-plugin 옵션 확인
  • ps -aux | grep kubelet
  • CNI binaries 디렉토리 경로: /opt/cni/bin
  • kubernetes cluster에서 사용하는 CNI Plugin 확인 명령어
  • ls /etc/cni/net.d/
  • container와 연관된 namespace가 생성된 이후에 kubelet에 의하여 실행되는 binary 실행파일 확인하는 방법
    1. cat /etc/cni/net.d/10-flannel.conflist
    2. plugins.type 확인
  • weave-net network solution 설치 명령어. & 뒤는 환경변수 설정값
    https://www.weave.works/docs/net/latest/kubernetes/kube-addon/#-installation
  • $ kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')&env.WEAVE_MTU=1337"
  • node IP CIDR 확인: 아래 명령어 실행 후 eth0의 CIDR 확인 
  • ip addr
  • pod IP CIDR 확인 방법
  • kubectl logs -n kube-system weave-net-7jjz9 weave
  • cluster 내의 service IP Range 확인 명령어
  • cat /etc/kubernetes/manifests/kube-apiserver.yaml | grep cluster-ip-range
  • kube-proxy가 사용하는 proxy 확인은 kubectl logs 에서 확인 가능
    I0214 05:43:07.309494       1 server_others.go:185] Using iptables Proxier.