구글의 GKE, Amazon EKS 등 클라우드 환경에서의 Kubernetes 설치 프로그램
구글에서 개발
ssh -i <key값> <user-name>@<public ip>
cd ~
cd .ssh
known_host
의 내용을 전부 지운 후 다시 접속wget -O kops https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
chmod +x ./kops
sudo mv ./kops /usr/local/bin/kops
wget -O kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
sudo apt update
sudo apt install -y python3-pip
pip3 install awscli
sudo apt install awscli
AWS CLI 설정
$ aws configure
AWS Access Key ID [None]: <Your access key id>
AWS Secret Access Key [None]: <Your secret access key>
Default region name [None]: ap-northeast-2 (or es-east-1)
Default output format [None]:
$ aws ec2 describe-instances
$ aws iam list-users
S3 버킷 생성
$ aws s3api create-bucket \
--bucket <bucket name> \
--region ap-northeast-2 \
--create-bucket-configuration LocationConstraint=ap-northeast-2 // us-east-1 사용 시 제외
$ aws s3api put-bucket-versioning \
--bucket <bucket name> \
--versioning-configuration Status=Enabled
export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)
export NAME=<cluster name>
export KOPS_STATE_STORE=s3://<bucket name>
ssh-keygen –t rsa
aws ec2 describe-availability-zones --region ap-northeast-2
kops create cluster --zones ap-northeast-2c ${NAME}
kops edit cluster ${NAME}
kops get ig --name ${NAME}
kops edit ig master-ap-northeast-2c --name ${NAME}
kops edit ig nodes --name ${NAME}
kops update cluster ${NAME} --yes
$ kops export kubecfg <cluster name> –admin
kops validate cluster
kubectl get nodes --show-labels
kubectl -n kube-system get po
kops delete cluster --name ${NAME} --yes