namespace 생성
kubectl create namespace metallb-system
helm 등록
helm repo add bitnami https://charts.bitnami.com/bitnami
metallb 적용
helm install -n metallb-system my-metallb bitnami/metallb --version 4.10.1
address pool 파일 작성
# IPAddressPool.yaml
# The address-pools lists the IP addresses that MetalLB is
# allowed to allocate. You can have as many
# address pools as you want.
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
# A name for the address pool. Services can request allocation
# from a specific address pool using this name.
name: first-pool
namespace: metallb-system
spec:
# A list of IP address ranges over which MetalLB has
# authority. You can list multiple ranges in a single pool, they
# will all share the same settings. Each range can be either a
# CIDR prefix, or an explicit start-end range of IPs.
addresses:
- 192.168.10.0/24
- 192.168.9.1-192.168.9.5
- fc00:f853:0ccd:e799::/124
IP address pool 적용
kubectl apply -f ./IPAddressPool.yaml -n metallb-system
서비스에 자동으로 할당된 external ip 확인
root@master1:~/template# kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3h16m
my-service LoadBalancer 10.98.29.240 192.168.0.240 8080:32061/TCP 29m
'기타정보' 카테고리의 다른 글
[정보] 쿠버네티스 pod Evicted - 하드디스크 부족 (0) | 2024.01.23 |
---|---|
[정보] ingress-nginx argocd 설정 파일(redirection loop) (0) | 2024.01.23 |
[정보] kubernetes 관리도구 k9s 설치 (0) | 2024.01.18 |
[정보] kubernetes etcd 상태확인 (0) | 2024.01.18 |
[정보] kubernetes 사용에 도움되는 ansible playbook (0) | 2024.01.18 |