SEOUL
쿠알못이
Amazon EKS로 안정적인
서비스 운영하기
최용호 / 넥슨 코리아
SEOUL
쿠버네티스를 알긴 아는데 잘 알지 못하는 사람이
Amazon EKS로 안정적인 서비스
운영하기
최용호 / 넥슨 코리아
발표자
• 최용호
• 넥슨 코리아 - 데브옵스개발팀
• 자바카페 운영진
• AWSKRUG 판교 소모임 운영진
목차
▪ 왜 Amazon EKS 인가?
▪ 인증 및 권한
▪ 네트워크
▪ 볼륨
▪ 모니터링
왜 Amazon EKS인가?
kubectl run nginx --image=nginx
nginx
Pod
Container
nginx
Po
d
Containe
r
ReplicaSet
nginx
Po
d
Containe
r
ReplicaSet
Deployment
nginx
Po
d
Containe
r
ReplicaSet
Deployment
Pod가 생성되는 순서는
nginx
Po
d
Containe
r
ReplicaSet
Deployment 먼저 Deployment가 만들어지고
nginx
Po
d
Containe
r
ReplicaSet
Deployment
Deployment로 인해 ReplicaSet
이 만들어지며
nginx
Po
d
Containe
r
ReplicaSet
Deployment
ReplicaSet에 의해 최종적으로
Pod가 만들어집니다.
kubectl get events
Kubernetes 클러스터 내부에서는 어떤 일
이 일어날까요?
먼저 Kubernetes 클러스터 구조를 살펴보
겠습니다.
Master Node
Master Node Worker Node
API 서버
Controller
Manager
Scheduler
etcd
Master Node Worker Node
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
etcd
Master Node Worker Node
Pod
Pod
Pod
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
etcd
Master Node Worker Node
Pod
Pod
Pod
각 컴포넌트들은 Watch 매커니즘을 가지
고 있습니다.
Components API 서버 etcd
Components API 서버 etcd
watch
Components API 서버 etcd
watch watch
Components API 서버 etcd
watch
변경사항 발생
watch
Components API 서버 etcd
watch
update
watch
Components API 서버 etcd
watch watch
변경사항 발생
Components API 서버 etcd
watch watch
notify
Components API 서버 etcd
watch watch
notifyresponse
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
kubectl run nginx --image=nginx
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
API 서버에
Watch 하고 있는
컴포넌트들
API 서버에
Watch 하고 있는
컴포넌트
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
실제로는 API 서버
를 통해 etcd에 저
장되는 리소스 정
보들
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
변경사항 발생
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
변경사항 발생
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
변경사항 발생
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
6. watch에 대한 응답
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
6. watch에 대한 응답
7. Worker Node에 Pod 할당
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
6. watch에 대한 응답
7. Worker Node에 Pod 할당
Scheduler는 어떻게 노드를 결
정 할까요?
API 서버
Scheduler
Kubelet
Master Node
Worker Node
Kubelet
Worker Node
Kubelet
Worker Node
API 서버
Scheduler
Kubelet
Master Node
Worker Node
cAdvisor
Kubelet
Worker Node
cAdvisor
Kubelet
Worker Node
cAdvisor
API 서버
Scheduler
Kubelet
Master Node
Worker Node
cAdvisor
Kubelet
Worker Node
cAdvisor
Kubelet
Worker Node
cAdvisor
Node/Container 지표 수집
(CPU, Memory 등)
API 서버
Scheduler
Kubelet
Master Node
Worker Node
cAdvisor
Kubelet
Worker Node
cAdvisor
Kubelet
Worker Node
cAdvisor
affinity taint etc
Node/Container 지표 수집
(CPU, Memory 등)
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
6. watch에 대한 응답
7. Worker Node에 Pod 할당
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
6. watch에 대한 응답
7. Worker Node에 Pod 할당
변경사항 발생
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
6. watch에 대한 응답
7. Worker Node에 Pod 할당
8. watch에 대한 응답
kubectl
API 서버
Controller
Manager
Kublet
Pod
Pod
Pod
Master Node Worker Node
Deployment
Controller
Replication
Controller
Scheduler
Deployment
resources
ReplicaSet
resources
Pod
resources
1. run 명령
2. watch에 대한 응답
3. ReplicaSet 생성
4. watch에 대한 응답
5. Pod 생성
6. watch에 대한 응답
7. Worker Node에 Pod 할당
8. watch에 대한 응답
9. Pod 생성
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
만약 API 서버에 장애가 발생한
다면?
VPC
AZ AZ AZ
API 서버
Master
Node
API 서버
Master
Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
만약 etcd에 장애가 발생한다면?
VPC
AZ AZ
API 서버
Master
Node
API 서버
Master
Node
etcd etcd
AZ
Master
Node
etcd
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
Amazon
EKS
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
Amazon
EKS
Amazon
EKS
Node groups
Amazon EKS 설치
설치 방법
AWS Console AWS CLI eksctl Terraform
설치 방법
AWS Console AWS CLI eksctl Terraform
설치 방법
AWS Console AWS CLI eksctl Terraform
가장 간단하게 EKS 클러스터 생성
설치 방법
AWS Console AWS CLI eksctl Terraform
가장 간단하게 EKS 클러스터 생성
설치 방법
AWS Console AWS CLI eksctl Terraform
인프라 코드화 가능 (IaC)
인증 및 권한
AW
S
AWS IAM User
Amazon
EKS
생성
AW
S
Amazon
EKS
생성
EKS 클러스터를 생성한
AWS IAM User가
Master 권한 획득
AWS IAM User
Kubernetes Admin Kubernetes
Master Node AWS IAM
1. kubectl 명령 (API 호출)
Kubernetes Admin Kubernetes
Master Node AWS IAM
1. kubectl 명령 (API 호출)
Kubernetes Admin Kubernetes
Master Node AWS IAM
Kubeconfig 파일에 인증 정보
포함
➢ Kubernetes API 서버 인증
토큰
➢ IAM 인증 토큰
1. kubectl 명령 (API 호출) 2. AWS IAM 인증
Kubernetes Admin Kubernetes
Master Node AWS IAM
1. kubectl 명령 (API 호출) 2. AWS IAM 인증
Kubernetes Admin Kubernetes
Master Node AWS IAM
요 청 한 사 용 자 가 AWS IAM
User가 맞는지만 검증
Role Based Access
Control
(RBAC)
1. kubectl 명령 (API 호출) 2. AWS IAM 인증
3. Kubernetes
RBAC 인증
Kubernetes Admin Kubernetes
Master Node AWS IAM
Role Based Access
Control
(RBAC)
1. kubectl 명령 (API 호출) 2. AWS IAM 인증
3. Kubernetes
RBAC 인증
4. 실행 결과 반환
Kubernetes Admin Kubernetes
Master Node AWS IAM
Role Based Access
Control
(RBAC)
1. kubectl 명령 (API 호출) 2. AWS IAM 인증
3. Kubernetes
RBAC 인증
4. 실행 결과 반환
Kubernetes Admin Kubernetes
Master Node AWS IAM
kubectl edit configmap aws-auth -n kube-system
EKS Master Node에 Join한
Worker Node들에 대한 권한
설정
Kubernetes RBAC에 해당
Role Based Access
Control
(RBAC)
1. kubectl 명령 (API 호출) 2. AWS IAM 인증
3. Kubernetes
RBAC 인증
4. 실행 결과 반환
Kubernetes Admin Kubernetes
Master Node AWS IAM
Cluster RoleRole
Cluster RoleRole
특정 Namespace 내 리소스
사용 권한 설정
Cluster RoleRole
Kubernetes Cluster 전 역 의
리소스 사용 권한 설정
Role 생성
Role 생성
Kubernetes 리소스에 대한 사
용 권한 설정
Role 생성
Role Binding
생성
Role 생성
Role Binding
생성
대상 Role의 권한을 할당할
사용자 또는 그룹 설정
kubectl edit clusterrole cluster-admin
Cluster-admin은 모든 리소스
에 대한 사용 권한이 할당됨
kubectl edit clusterrolebinding cluster-admin
대상 Role 설정
Role을 할당할 대상 사용자
또는 그룹 설정
EKS 클러스터를 관리할 관리자가 추가되
었다면?
mapUsers 항목에 IAM User
추가 및 권한 부여
모든 사용자들에게 master 권한을 줄 수
는 없겠죠?
kubectl edit configmap aws-auth -n kube-system
IAM Role 을 대 상 으 로
mapRoles에 추가하거나
IAM User 를 대 상 으 로
mapUsers에 추가합니다.
사용자를 추가하고 권한을 할당하는 전반
적인 Flow를 살펴보겠습니다.
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
IAM Role 생성
Aws-auth Configmap
의 mapRole에 추가
ClusterRole 또는
Role 생성
ClusterRoleBinding 또
는 RoleBinding 생성
Aws-auth Configmap
의 mapRole에 group
설정
대상 사용자의
kubeconfig 파일에 인
증 정보 설정
네트워크
Amazon EKS는 조금 다른 네트워크 구조
를 가지고 있습니다.
먼저 일반적인 네트워크 구조를 알아보겠
습니다.
컨테이너
호스트
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너
호스트
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
물리 네트워크 인터페이스
컨테이너
호스트
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
브릿지 네트워크
컨테이너
호스트
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너에 할당되는 가상 네
트워크 인터페이스
컨테이너1
호스트
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
컨테이너1
호스트
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
--net=container:컨테이너1
컨테이너1
호스트
eth0
10.100.0.2
docker0
172.17.0.1
컨테이너2
veth0
172.17.0.2
컨테이너1
호스트
eth0
10.100.0.2
docker0
172.17.0.1
컨테이너2Pause
veth0
172.17.0.2
컨테이너1
호스트
eth0
10.100.0.2
docker0
172.17.0.1
컨테이너2Pause
veth0
172.17.0.2
Pod
컨테이너1
호스트
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
컨테이너1
호스트1
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
컨테이너1
호스트2
eth0
10.100.0.3
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
컨테이너1
호스트1
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
컨테이너1
호스트2
eth0
10.100.0.3
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
Router/gateway
컨테이너1
호스트1
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
컨테이너1
호스트2
eth0
10.100.0.3
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
veth0
172.17.0.3
Router/gateway
172.17.0.2에 패킷을 전달해주세
요
컨테이너1
호스트1
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2 컨테이너1
호스트2
eth0
10.100.0.3
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
Router/gateway
veth0
172.17.0.3
veth0
172.17.0.3
컨테이너1
호스트1
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2 컨테이너1
호스트2
eth0
10.100.0.3
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
Router/gateway
veth0
172.17.0.3
veth0
172.17.0.3
컨테이너1
호스트1
eth0
10.100.0.2
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2 컨테이너1
호스트2
eth0
10.100.0.3
docker0
172.17.0.1
veth0
172.17.0.2
컨테이너2
Router/gateway
veth0
172.17.0.3
veth0
172.17.0.3
호스트가 여러개가 되어도 각 컨테이너를 찾아갈 수 있게 모든 호스트의 브
릿지 네트워크에 각기 다른 IP를 할당하자.
컨테이너1
호스트1
eth0
10.100.0.2
cni0
10.0.1.1
veth0
10.0.1.2
컨테이너2
veth0
10.0.1.3
컨테이너1
호스트2
eth0
10.100.0.3
cni0
10.0.2.1
veth0
10.0.2.2
컨테이너2
veth0
10.0.2.3
Router/gateway
컨테이너1
호스트1
eth0
10.100.0.2
cni0
10.0.1.1
veth0
10.0.1.2
컨테이너2
veth1
10.0.1.3
컨테이너1
호스트2
eth0
10.100.0.3
cni0
10.0.2.1
veth0
10.0.2.2
컨테이너2
veth1
10.0.2.3
Router/gateway
Overay Network
컨테이너1
호스트1
eth0
10.100.0.2
cni0
10.0.1.1
veth0
10.0.1.2
컨테이너2
veth1
10.0.1.3
컨테이너1
호스트2
eth0
10.100.0.3
cni0
10.0.2.1
veth0
10.0.2.2
컨테이너2
veth1
10.0.2.3
Router/gateway
Overay Network
weave net AWS CNI
컨테이너1
호스트1
eth0
10.100.0.2
cni0
10.0.1.1
veth0
10.0.1.2
컨테이너2
veth1
10.0.1.3
컨테이너1
호스트2
eth0
10.100.0.3
cni0
10.0.2.1
veth0
10.0.2.2
컨테이너2
veth1
10.0.2.3
Router/gateway
Overay Network
weave net AWS CNI
컨테이너1
호스트1
eth0
10.100.0.2
cni0
10.0.1.1
veth0
10.0.1.2
컨테이너2
veth0
10.0.1.3
컨테이너1
호스트2
eth0
10.100.0.3
cni0
10.0.2.1
veth0
10.0.2.2
컨테이너2
veth0
10.0.2.3
Router/gateway
호스트1
컨테이너1
호스트1
eth0
10.100.0.2
cni0
10.0.1.1
veth0
10.0.1.2
컨테이너2
veth0
10.0.1.3
컨테이너1
호스트2
eth0
10.100.0.3
cni0
10.0.2.1
veth0
10.0.2.2
컨테이너2
veth0
10.0.2.3
Router/gateway
호스트1
VPC의 IP Range 내 IP를 할당
하나의 클러스터 내에 Pod 수가 굉장히
많다면 VPC IP Range에 대한 검토가 필
요합니다.
VPC IP Range가 여유있더라도 ENI에 의
해 Pod 생성이 실패할 수도 있습니다.
Worker Node
(EC2 인스턴스)
Worker Node
(EC2 인스턴스)
ENI
Worker Node
(EC2 인스턴스)
ENI
DaemonSet
IPAM
Worker Node
(EC2 인스턴스)
ENI
DaemonSet
IPAM
IPAM이 ENI로부터 IP를 받아
Pod에 할당
Worker Node
(EC2 인스턴스)
ENI
DaemonSet
IPAM
ENI
ENI가 할당할 수 있는 IP 수를
초과하면 추가로 ENI를 생성
Worker Node
(EC2 인스턴스)
ENI
DaemonSet
IPAM
ENI
Worker Node
(EC2 인스턴스)
ENI
DaemonSet
IPAM
ENI
Worker Node
(EC2 인스턴스)
ENI
DaemonSet
IPAM
ENI
최대 Pod 수 = (인스턴스 유형에 따른
ENI 수 * (ENI 별 IP 수 - 1))
최대 Pod 수 = (인스턴스 유형에 따른
ENI 수 * (ENI 별 IP 수 - 1))
ENI 자신에게 할당 된 IP 제외
AWS CNI 1.5.4 버전에서 문제가 있었습
니다.
아래 명령으로 AWS CNI 버전 업데이트
kubectl apply -f
https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/release-1.5.3/config/v1.5/aws-k8s-cni.yam
볼륨
안정적인 데이터 관리는 어떻게 할까요?
안정적인 저장소 준비
컨테이너에 안정적인
저장소를 마운트
안정적인 저장소 준비
컨테이너에 안정적인
저장소를 마운트
EFSEBS
EBS를 마운트 하려면?
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
최초로 컨테이너에 마운트
되는 시점에 EBS가 생성됩
니다.
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
Storage Class
생성
Persistent Volume
Claim 생성
컨테이너에 마운트
모니터링
Master Node의 컴포넌트들의 로그를
CloudWatch를 통해 확인할 수 있습니다.
AWS Console Amazon EKS로 이동 대상 클러스터 선택
로깅의 업데이트 버튼
클릭
확인하고자 하는 로그
활성화
업데이트 버튼 클릭
AWS Console Amazon EKS로 이동 대상 클러스터 선택
로깅의 업데이트 버튼
클릭
확인하고자 하는 로그
활성화
업데이트 버튼 클릭
Pod 모니터링은 Container Insights를 사
용하면 간단하게 할 수 있습니다.
Work Node의
IAM Role 편집
CloudWatchAgentServerPolicy
정책 추가
빠른 시작 설정
CloudWatch 페이지 이동Container Insights 선택대상 EKS 클러스터 선택
Work Node의
IAM Role 편집
CloudWatchAgentServerPolicy
정책 추가
빠른 시작 설정
CloudWatch 페이지 이동Container Insights 선택대상 EKS 클러스터 선택
Work Node의
IAM Role 편집
CloudWatchAgentServerPolicy
정책 추가
빠른 시작 설정
CloudWatch 페이지 이동Container Insights 선택대상 EKS 클러스터 선택
Work Node의
IAM Role 편집
CloudWatchAgentServerPolicy
정책 추가
간편 스크립트 실행
CloudWatch 페이지 이동Container Insights 선택대상 EKS 클러스터 선택
결론
kubectl
API 서버
Controller
Manager
Scheduler
Kubelet Kube proxy
Pod
Pod
Pod
etcd
Master Node Worker Node
Amazon
EKS
Amazon
EKS
Node groups
감사합니다

쿠알못이 Amazon EKS로 안정적인 서비스 운영하기 - 최용호