brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Jun 19. 2021

EKS 1탄-5. 콘솔에서 EKS Nodes 정보 보기

실습 1탄 = 5/7

목표

콘솔에서 ESK  Nodes정보 보자

Cloud9에서 CLI로 EKS 클러스터를 만들었다면, 웹 콘솔에서 node정보를 볼수 있도록 권한을 주어야한다.



참고 자료

https://aws-eks-web-application.workshop.aws/ko/50-eks-cluster/200-option-console.html



<1> 콘솔에서 EKS 클러스터 보기

<2>  Cloud9에서 생성한 EKS에 대해 웹 콘솔에서 Node정보 보이도록 설정법

<3>  다른 계정에서도  보이도록 하기

<4> 개인 정리

<5> 다음은 POD Autoscaling

<10> AWS EKS 실습1




<1> 콘솔에서 EKS 클러스터 보기


AWS EKS에서는 Cli로 EKS 클러스터를 만들면, 디폴트로는 콘솔에서 Workloads정보가 보이지 않는다.

권한을 주어 콘솔에서 workloads를  볼수 있도록 하자~




<2>  Cloud9에서 생성한 EKS에 대해 웹 콘솔에서 Node정보 보이도록 설정법


1

role arn 확인

rolearn=$(aws cloud9 describe-environment-memberships --environment-id=$C9_PID | jq -r '.memberships[].userArn')


echo ${rolearn}



2

값을 불렀을 때, assumed-role이 있다면 아래의 작업을 추가적으로 수행

assumedrolename=$(echo ${rolearn} | awk -F/ '{print $(NF-1)}')


rolearn=$(aws iam get-role --role-name ${assumedrolename} --query Role.Arn --output text)

echo ${rolearn}



3

매핑

eksctl create iamidentitymapping --cluster eks-demo --arn ${rolearn} --group system:masters --username admin



4

확인

kubectl describe configmap -n kube-system aws-auth


정상

$ eksctl create iamidentitymapping --cluster eks-demo --arn ${rolearn} --group system:masters --username admin

2021-06-19 09:10:16 [ℹ]  eksctl version 0.53.0

2021-06-19 09:10:16 [ℹ]  using region us-west-2

2021-06-19 09:10:16 [ℹ]  adding identity "arn:aws:iam::xxxxxxxx:role/seo-administrator-role" to auth ConfigMap



5

AWS 콘솔에서 확인하자  > EKS




6

비정상

$ eksctl create iamidentitymapping --cluster eks-demo --arn ${rolearn} --group system:masters --username admin

2021-06-19 09:07:30 [ℹ]  eksctl version 0.54.0

2021-06-19 09:07:30 [ℹ]  using region us-west-2

Error: getting auth ConfigMap: Unauthorized

=> 위 오류가 나오면, 해당 리전의 cloud9 에서 실행하면 정상적으로 동작한다.



7

확인

kubectl describe configmap -n kube-system aws-auth


- groups:

  - system:masters

  rolearn: arn:aws:iam::xxxxxxxxxx:role/seo-administrator-role

  username: admin


위 내용이 있으면 정상적인것이다.



8

상세



9

AWS 콘솔로 로그인해 확인하기 ?

Overview  와 Workloads 보기


1)

Overview 에서 node 확인


2)

Workload에서 coredns 등 확인하기




<3>  다른 계정에서도  보이도록 하기


https://docs.aws.amazon.com/ko_kr/eks/latest/userguide/add-user-role.html


https://aws.amazon.com/ko/premiumsupport/knowledge-center/amazon-eks-cluster-access/



<4> 개인 정리


실습 - CLI로 EKS 클러스터를 만들었다면, EKS 콘솔에서 node정보를 볼수 있도록 권한을 주기


1

우선  EKS  콘솔에서 worker node  정보가 보이는지 보자. 안보인다.

기본적으로 콘솔에서는 정보를 확인할수 없다.

추가로 작업을 해줘야 한다.


2

ACCOUNT_ID=`aws sts get-caller-identity --query 'Account' --output text`

echo $ACCOUNT_ID



3

iam role arn확인한다.

arn xxxxxxxxxxxxxxxxxxxxx



4

1줄 요약

eksctl create iamidentitymapping --cluster first-eks --arn arn:aws:iam::$ACCOUNT_ID:role/seo-administrator-role --group system:masters --username admin


// 리전 , 클러스터 이름 first-eks ,   account id ,  role이름   4개를 맞추어 준다.

리전이 틀리면 aws configure로 리전을 맞춰주자.

// --arn은  iam > 역할 > seo-administrator-role 의 역할 ARN을 입력하면 된다.

// EC2에 연결한 역할 이름의 arn이다.


https://brunch.co.kr/@topasvga/1654



5

참고

kubectl describe configmap -n kube-system aws-auth


kubectl edit configmap -n kube-system aws-auth


kubectl delete configmap -n kube-system aws-auth




<5> 다음은 POD Autoscaling


https://brunch.co.kr/@topasvga/1655




<10> AWS EKS 실습1



https://brunch.co.kr/@topasvga/1883



https://brunch.co.kr/@topasvga/1679


감사합니다.

매거진의 이전글 EKS 1탄-4. Container Insights

작품 선택

키워드 선택 0 / 3 0

댓글여부

afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari