본문 바로가기
kubernetes

Kubernetes LoadBalancer(MetalLB)

by aws-evan 2024. 4. 23.
728x90

 

 

 

MetalLB를 통한 kubernetes Service 로드밸런싱

온프레미스 경우 kubernetes L4를 사용하기 위해서는 MetalLB를 사용해야하며, 사용방법은 간단하나,

적용 이후 IP 내역에 대해서는 내부 IP 설정

 

  • 깃허브
    • version : 0.10 ## 버전은 상위 버전으로 해도 무방하나 설치 방법이 약간은 다를 수 있습니다.

https://github.com/metallb/metallb

 

GitHub - metallb/metallb: A network load-balancer implementation for Kubernetes using standard routing protocols

A network load-balancer implementation for Kubernetes using standard routing protocols - metallb/metallb

github.com

 

 

 

  • Manifest 정보

https://github.com/metallb/metallb/tree/v0.10/manifests

 

metallb/manifests at v0.10 · metallb/metallb

A network load-balancer implementation for Kubernetes using standard routing protocols - metallb/metallb

github.com

 

 

  • Namespace 생성하기
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.10/manifests/namespace.yaml

 

  • MetalLB 관련 리소스 설치
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.10/manifests/metallb.yaml

 

 

 

  • MetalLB 사용할 IP 대역 설정
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2  ##클러스터 내부의 노드 IP 주소
      addresses:
      - 192.168.0.170-192.168.0.171 #LB에 사용할 IP

 

  • Service : LoabBalancer 설정

 

  • LadBalancer IP 접속

 

728x90

'kubernetes' 카테고리의 다른 글

Kubernetes 모니터링 시스템(Promtail + Loki + Grafana) Helm  (0) 2024.05.01
Kubernetes PostgresSQL 설치  (0) 2024.04.25
CNI Flannel 설치 가이드  (0) 2024.04.22
kubespray 구축  (0) 2024.04.18
손쉬운 Kubernetes 설치 가이드  (0) 2024.04.16

댓글