본문 바로가기
쿠버네티스 기타

Ingress Controller kubernetes Installation on AWS EKS | Ingress kubernetes Service - 인그레스 컨트롤러 설정하기

by SAMSUNG CLOUD-OKY 2020. 11. 2.
반응형

github.com/stacksimplify/aws-eks-kubernetes-masterclass/tree/master/08-ELB-Application-LoadBalancers/08-01-ALB-Ingress-Install

 

stacksimplify/aws-eks-kubernetes-masterclass

AWS EKS Kubernetes - Masterclass | DevOps, Microservices - stacksimplify/aws-eks-kubernetes-masterclass

github.com

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

# Create ClusterRole, ClusterRoleBinding & ServiceAccount

kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/master/docs/examples/rbac-role.yaml

 

 

# List Service Accounts

kubectl get sa -n kube-system

 

 

 

 

# Describe Service Account alb-ingress-controller

kubectl describe sa alb-ingress-controller -n kube-system

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

# Create IAM Policy

aws iam create-policy \ --policy-name ALBIngressControllerIAMPolicy \ --policy-document https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/master/docs/examples/iam-policy.json

- 수동 작업시 활용

- 233개 서비스인지 확인 할것

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

# 이 명령은 AWS IAM 역할을 생성하고 이를 Kubernetes 서비스 계정에 바인딩합니다.

# Replaced region, name, cluster and policy arn (Policy arn we took note in step-03)

eksctl create iamserviceaccount \ --region us-east-1 \ --name alb-ingress-controller \ --namespace kube-system \ --cluster eksdemo1 \ --attach-policy-arn arn:aws:iam::180789647333:policy/ALBIngressControllerIAMPolicy \ --override-existing-serviceaccounts \ --approve

 

 

 

 

 

 

 

# Get IAM Service Account

eksctl get iamserviceaccount --cluster eksdemo1

 

# 생성 된 CloudFormation 템플릿 eksctl 및 IAM 역할 확인

 

 

 

 

 

 

 

 

k8s 서비스 계정 확인

# Describe Service Account alb-ingress-controller

kubectl describe sa alb-ingress-controller -n kube-system

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

## 5단계 ALB Ingress Controller 배포

# Deploy ALB Ingress Controller

kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/master/docs/examples/alb-ingress-controller.yaml

 

 

 

# Verify Deployment

kubectl get deploy -n kube-system

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

## 6 단계 : ALB 수신 컨트롤러 매니페스트 편집

# Edit Deployment

kubectl edit deployment.apps/alb-ingress-controller -n kube-system

 

# Replaced cluster-name with our cluster-name eksdemo1

spec: containers: - args: - --ingress-class=alb - --cluster-name=eksdemo1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

## 7 단계 : ALB Ingress Controller가 실행 중인지 확인합니다.

 

 

 

 

# Verify if alb-ingress-controller pod is running

kubectl get pods -n kube-system

 

 

# Verify logs

kubectl logs -f $(kubectl get po -n kube-system | egrep -o 'alb-ingress-controller-[A-Za-z0-9-]+') -n kube-system

 

 

 

 

 

 

 

 

 

 

 

반응형

댓글