본문 바로가기

AWS EKS 실습/EKS 환경 구성

2. 사전 준비 - 5 (Service Repo, SSH, KMS)

1. Clone the service Repos (예제에서 준비한 서비스에 대한 git 설정

 

$ cd ~/environment 
$ git clone https://github.com/brentley/ecsdemo-frontend.git
 

brentley/ecsdemo-frontend

Contribute to brentley/ecsdemo-frontend development by creating an account on GitHub.

github.com

$ git clone https://github.com/brentley/ecsdemo-nodejs.git
 

brentley/ecsdemo-nodejs

Part 3 of a 4 part ECS workshop. Contribute to brentley/ecsdemo-nodejs development by creating an account on GitHub.

github.com

$ git clone https://github.com/brentley/ecsdemo-crystal.git
 

brentley/ecsdemo-crystal

Part 4 of a 4 part ECS Workshop. Contribute to brentley/ecsdemo-crystal development by creating an account on GitHub.

github.com

2. SSH Key Generation

 

 ㅇ Cloud9에서 아래 SSH Key Generation을 수행한다. 모두 Default로 3번 그대로 Enter

 

$ ssh-keygen

id_rsa.pub.

 

  ㅇ Cloud EC2로 public key upload

 

$ aws ec2 import-key-pair --key-name "eks-newelite" --public-key-material file://~/.ssh/id_rsa.pub

{
    "KeyName": "eks-newelite", 
    "KeyFingerprint": "43:c5:a7:a4:41:e9:07:ff:70:2a:60:1e:20:39:92:d9", 
    "KeyPairId": "key-033ca3d8cdfd053e5"
}

 

 ㅇ EKS Cluster를 위한 CMK 생성

 

$ aws kms create-alias --alias-name alias/eks-newelite --target-key-id $(aws kms create-key --query KeyMetadata.Arn --output text) 

 

$ export MASTER_ARN=$(aws kms describe-key --key-id alias/eks-newelite --query KeyMetadata.Arn --output text)

 

$ echo "export MASTER_ARN=${MASTER_ARN}" | tee -a ~/.bash_profile

export MASTER_ARN=arn:aws:kms:ap-northeast-2:221745184950:key/a1afa1b9-b7f3-45fc-bc94-4c0c7dae8fcd