# values.yaml 예시
clusterName: my-cluster
serviceAccount:
create: false
name: aws-load-balancer-controller
region: ap-northeast-2
vpcId: vpc-xxxxxxxxx
# 리소스 설정
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 200m
memory: 256Mi
# 복제본 수
replicaCount: 2
# Pod 분산 배치
podDisruptionBudget:
minAvailable: 1
# 고가용성을 위한 Anti-Affinity
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- aws-load-balancer-controller
topologyKey: kubernetes.io/hostname
# Webhook 인증서
enableCertManager: false
# 로그 레벨
logLevel: info
# IngressClass 설정
ingressClass: alb
createIngressClassResource: true
# 추가 설정
enableShield: false
enableWaf: false
enableWafv2: true
# Deployment 상태 확인
kubectl get deployment -n kube-system aws-load-balancer-controller
# Pod 상태 확인
kubectl get pods -n kube-system -l app.kubernetes.io/name=aws-load-balancer-controller
# 로그 확인
kubectl logs -n kube-system -l app.kubernetes.io/name=aws-load-balancer-controller
# IngressClass 확인
kubectl get ingressclass
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
namespace: default
annotations:
# ALB 스키마 (internet-facing 또는 internal)
alb.ingress.kubernetes.io/scheme: internet-facing
# Target Type (ip 또는 instance)
alb.ingress.kubernetes.io/target-type: ip
# 리스너 포트
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
# SSL 리다이렉트
alb.ingress.kubernetes.io/ssl-redirect: "443"
# ACM 인증서
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:ap-northeast-2:ACCOUNT:certificate/CERT_ID
# 서브넷 지정
alb.ingress.kubernetes.io/subnets: subnet-xxx,subnet-yyy,subnet-zzz
# 보안 그룹
alb.ingress.kubernetes.io/security-groups: sg-xxxxxxxxx
# 헬스체크 설정
alb.ingress.kubernetes.io/healthcheck-path: /health
alb.ingress.kubernetes.io/healthcheck-interval-seconds: "15"
alb.ingress.kubernetes.io/healthcheck-timeout-seconds: "5"
alb.ingress.kubernetes.io/healthy-threshold-count: "2"
alb.ingress.kubernetes.io/unhealthy-threshold-count: "2"
spec:
ingressClassName: alb
rules:
- host: api.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: api-service
port:
number: 80
# 컨트롤러 로그 확인
kubectl logs -n kube-system -l app.kubernetes.io/name=aws-load-balancer-controller
# Ingress 이벤트 확인
kubectl describe ingress <ingress-name>
# 일반적인 원인:
# - IAM 권한 부족
# - 서브넷 태그 누락
# - IngressClass 미지정
# Target Group 상태 확인
aws elbv2 describe-target-health \
--target-group-arn arn:aws:elasticloadbalancing:...
# Pod 로그 확인
kubectl logs <pod-name>
# 헬스체크 엔드포인트 테스트
kubectl exec -it <pod-name> -- curl localhost:8080/health
# 보안 그룹 확인
aws ec2 describe-security-groups --group-ids sg-xxx
# 원인 분석:
# 1. Pod가 준비되지 않음
kubectl get pods -l app=my-app
# 2. Target Group 드레이닝 중
aws elbv2 describe-target-health --target-group-arn ...
# 3. 헬스체크 실패
# - 헬스체크 경로 확인
# - 헬스체크 타임아웃 조정
# 4. 보안 그룹 규칙
# - ALB -> Pod 통신 허용 확인
# ACM 인증서 상태 확인
aws acm describe-certificate --certificate-arn arn:aws:acm:...
# 인증서가 ISSUED 상태인지 확인
# 도메인 검증 완료 여부 확인
# 리전 확인 (ALB와 같은 리전이어야 함)
# 컨트롤러 상세 로그
kubectl logs -n kube-system deployment/aws-load-balancer-controller -f
# Ingress 상태 확인
kubectl get ingress -o wide
kubectl describe ingress <name>
# Service 상태 확인
kubectl get svc -o wide
kubectl describe svc <name>
# TargetGroupBinding 상태 확인
kubectl get targetgroupbindings -A
kubectl describe targetgroupbinding <name>
# AWS 리소스 확인
aws elbv2 describe-load-balancers --query 'LoadBalancers[?contains(LoadBalancerName, `k8s`)]'
aws elbv2 describe-target-groups --query 'TargetGroups[?contains(TargetGroupName, `k8s`)]'