Cloud/k8s

[k8s] calico - multiple nic + metallb 사용법

jinkwon.kim 2023. 12. 8. 14:35
728x90
반응형

개요

calio + metallb에서 multple nic 사용법을 정리 합니다. 

NIC 환경

controlplane

nic1(ens33) : 1.1.0.0/16

nic2(ens35) : 172.10.1.1/16

woker node1

nic1(ens33) : 1.1.0.1/16

woker node2

nic1(ens33) : 1.1.0.2/16

woker node3

nic1(ens33) : 1.1.0.3/16

Calico 배포

위 NIC 환경에서 calico를 배포하면 controplane쪽이 정상 동작을 하지 않습니다. 

로그를 보면 BGP 통신이 cluster IP가 아닌 다른 IP를 사용해서 그런것으로 판단이 됩니다. 

 

W1208 05:14:22.290398     240 feature_gate.go:241] Setting GA feature gate ServiceInternalTrafficPolicy=true. It will be removed in a future release.
  Warning  Unhealthy  3m28s  kubelet  Readiness probe failed: 2023-12-08 05:14:32.300 [INFO][273] confd/health.go 180: Number of node(s) with BGP peering established = 2
calico/node is not ready: BIRD is not ready: BGP not established with 172.10.1.1
W1208 05:14:32.290465     273 feature_gate.go:241] Setting GA feature gate ServiceInternalTrafficPolicy=true. It will be removed in a future release.

 

이렇게 되는 이유는 IP_AUTODETECTION_METHOD 때문에 cluster 로 사용하지 안는 ens35도 잡히기 때문입니다

그래서 이를 해결할려면 caclico 가 네트워크를 구성 할때 kubernetes에서의 internal-ip만 사용하게 해주면됩니다.

 

아래 명령을 사용하여 kubernetes에서의 internal-ip만 사용하게 해주면됩니다.

 

kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=kubernetes-internal-ip

 

https://docs.tigera.io/calico/latest/networking/ipam/ip-autodetection#ip-autodetection

 

Configure IP autodetection | Calico Documentation

Calico IP autodetection ensures the correct IP address is used for routing. Learn how to customize it.

docs.tigera.io

 

metallb 배포

ippool에 ens35에 할당된 IP를 설정해주어 배포 합니다. 

 

728x90
반응형

'Cloud > k8s' 카테고리의 다른 글

[k8s] Prometheus  (1) 2023.12.06
[k8s-deep dive] OCI 란?  (0) 2023.11.21
[k8s] container runtime별 관리 tools  (0) 2023.03.06
[급한 k8s] 4. 외부 서비스  (0) 2023.01.01
[k8s] k8s 관련 지식  (0) 2022.11.26