<aside> 🧑🏻‍🏫 쿠버네티스 사용 확대에 따라서 파드에 복수개의 NIC 제공 환경이 요구되고 있습니다. 다수의 NIC 제공으로 트래픽 경로 분리하여, 보안성을 강화하고, 특정 NIC 은 성능 최적화를 위해서 하드웨어 가속(SR-IOV 등)을 설정할 수 있습니다.

</aside>

Multus 소개

Multus 소개 : 파드에 다수의 네트워크 인터페이스 연결, NIC 하드웨어 가속 기능(DPDK, SR-IOV) 적용 가능

Untitled

Multi-Homed pod : 아래 그림 처럼, eth0 이외에 net0, net1 추가 인터페이스(다른 CNI plugin)를 사용

https://github.com/k8snetworkplumbingwg/multus-cni

https://github.com/k8snetworkplumbingwg/multus-cni

Multus Plugin 구성 예시

Untitled

지원되는 CNI Plugin - 링크

IPAM Plugin (파드에 IP 주소 할당 관리) - 링크

→ 3rd party IPAM 사용 가능 : Whereabout IPAM 등

(Other) Meta Plugin - 링크

Multus 실습 환경

실습 구성 : 쿠버네티스 클러스터(k8s-m, k8s-w1, k8s-w2) , 리눅스 라우터(k8s-rtr)

Untitled

# 배포
curl -O <https://raw.githubusercontent.com/gasida/KANS/main/multus/Vagrantfile>
vagrant up
vagrant status

# 접속
vagrant ssh k8s-m
vagrant ssh k8s-w1
vagrant ssh k8s-w2
vagrant ssh k8s-rtr

Multus CNI 설치

설치 전 확인

# cni 바이러니 파일 확인
**ls -ltrh /opt/cni/bin**
total 70M
-rwxr-xr-x 1 root root 4.0M May 13  2020 bandwidth
-rwxr-xr-x 1 root root 5.7M May 13  2020 firewall
-rwxr-xr-x 1 root root 3.3M May 13  2020 sbr
-rwxr-xr-x 1 root root 3.8M May 13  2020 portmap
-rwxr-xr-x 1 root root 3.3M May 13  2020 tuning
-rwxr-xr-x 1 root root 4.5M May 13  2020 bridge
-rwxr-xr-x 1 root root 4.0M May 13  2020 host-device
-rwxr-xr-x 1 root root 4.2M May 13  2020 ipvlan
-rwxr-xr-x 1 root root 3.1M May 13  2020 loopback
-rwxr-xr-x 1 root root 4.2M May 13  2020 macvlan
-rwxr-xr-x 1 root root 4.4M May 13  2020 ptp
-rwxr-xr-x 1 root root 4.2M May 13  2020 vlan
-rwxr-xr-x 1 root root  12M May 13  2020 dhcp
-rwxr-xr-x 1 root root 2.8M May 13  2020 static
-rwxr-xr-x 1 root root 3.5M May 13  2020 host-local
-rwxr-xr-x 1 root root 3.3M Jan  8 03:57 **flannel**

# cni 정보 확인
**ls -ltrh /etc/cni/net.d/**
total 4.0K
-rw-r--r-- 1 root root 292 Jan  8 03:57 **10-flannel.conflist**

**cat /etc/cni/net.d/10-flannel.conflist**
{
  "name": "**cbr0**",
  "**cniVersion**": "**0.3.1**",
  "**plugins**": [
    {
      "**type**": "**flannel**",
      "delegate": {
        "hairpinMode": true,
        "isDefaultGateway": true
      }
    },
    {
      "type": "portmap",
      "capabilities": {
        "portMappings": true
      }
    }
  ]
}