반응형
AWS Load Balancer Controller 란?
Ingress를 AWS ALB 또는 NLB로 사용할때 필요한 컨트롤러 입니다. 이전에(20년10월 이전) "AWS ALB Ingress Controller"로 알려졌으며 "AWS Load Balancer Controller"로 브랜드를 변경했습니다. [참고]alb load balancer controller 공식 github 주소
AWS Load Balancer Controller image releases 정보
https://github.com/kubernetes-sigs/aws-load-balancer-controller/releases/
AWS Load Balancer Controller 설치
oidc install
eksctl utils associate-iam-oidc-provider \
--region ap-northeast-2 \
--cluster test-eksctl2 \
--approve
iam policy crate
curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/install/iam_policy.json
aws iam create-policy \
--policy-name AWSLoadBalancerControllerIAMPolicy \
--policy-document file://iam-policy.json
service account
eksctl create iamserviceaccount \
--cluster=test-eksctl2 \
--namespace=kube-system \
--name=aws-load-balancer-controller \
--attach-policy-arn=arn:aws:iam::058475846659:policy/AWSLoadBalancerControllerIAMPolicy \
--approve
crds apply
kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller//crds?ref=master"
kubectl get crd
install aws loadbalancer ingress
- helm chart add
helm repo add eks https://aws.github.io/eks-charts
- using service account
위에서eksctl create iamserviceaccount
를 하였으므로kubectl get sa aws-load-balancer-controller -n kube-system
로 잘 생성이 되었는지 확인하고 아래 명령어 입력
helm install aws-load-balancer-controller eks/aws-load-balancer-controller --set clusterName=test-eksctl2 -n kube-system --set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller
- not using service account
helm upgrade -i aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=test-eksctl2
delete helm
helm delete aws-load-balancer-controller -n kube-system
ingress test sample(deployment/service/ingress)
export EKS_CLUSTER_VERSION=$(aws eks describe-cluster --name test-eksctl2 --query cluster.version --output text)
if [ "`echo "${EKS_CLUSTER_VERSION} < 1.19" | bc`" -eq 1 ]; then
curl -s https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/examples/2048/2048_full.yaml \
| sed 's=alb.ingress.kubernetes.io/target-type: ip=alb.ingress.kubernetes.io/target-type: instance=g' \
| kubectl apply -f -
fi
if [ "`echo "${EKS_CLUSTER_VERSION} >= 1.19" | bc`" -eq 1 ]; then
curl -s https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/examples/2048/2048_full_latest.yaml \
| sed 's=alb.ingress.kubernetes.io/target-type: ip=alb.ingress.kubernetes.io/target-type: instance=g' \
| kubectl apply -f -
fi
반응형
'IT > AWS' 카테고리의 다른 글
[AWS] EKS 클러스터에서 kubernetes coredns 통신 제어 (3) | 2021.09.05 |
---|---|
[AWS] NLB의 주요 특징과 기능(NLB를 사용하기 전에 꼭 확인) (0) | 2021.08.30 |
[AWS] SSM(session manager)를 통하여 EC2 접근하기 (0) | 2021.08.12 |
[AWS] amazonlinux2의 로그(/var/log)를 AWS cloudwatch logs로 백업하기 (0) | 2021.08.11 |
[AWS] Amazonlinux2 OS 초기 설정 쉘스크립트 (0) | 2021.08.04 |