0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

amazon linux2(aws)にkube環境構築する手順~(おまけつき)

Posted at

前提条件

・作りたてのamazon linux2(centos)

1.ec2にdocker環境構築まで

まずここを参考にamazon linux2 へdocker構築する。
https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/docker-basics.html

インスタンスでインストールされているパッケージ更新
sudo yum update -y

yum install git-all
pip3 install boto3

yum -y install python3
pip3 install awscli --upgrade

sudo pip install --upgrade awscli --ignore-installed six

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install


最新の Docker Community Edition パッケージをインストールします。
# amazon linux2
sudo amazon-linux-extras install docker

# amazon linux
sudo yum install docker

# Docker サービスを開始します。
sudo service docker start

# ec2-user を docker グループに追加すると、sudo を使用せずに Docker コマンドを実行できます。

sudo usermod -a -G docker ec2-user
# ログアウトし、再びログインして、新しい docker グループアクセス権限を取得します。
# これは、現在の SSH ターミナルウィンドウを閉じて、新しいウィンドウでインスタンスに再接続することで達成できます。
# 新しい SSH セッションには適切な docker グループ権限があります。

# ec2-user が sudo を使用せずに Docker コマンドを実行できることを確認します。

# docker環境が出来ているか確認
docker info
docker --version

kubernetes環境構築まで

curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.9/2020-08-04/bin/linux/amd64/kubectl

chmod +x ./kubectl

sudo mv ./kubectl /usr/local/bin
mkdir -p $HOME/bin && mv ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin

echo 'export PATH=$PATH:$HOME/bin' >> ~/.bash_profile

kubectl version --short --client

aws eks describe-cluster --name eks-from-eksctl --region us-west-2

kind cluster構築

本家の構築方法以下を参照
https://kind.sigs.k8s.io/docs/user/quick-start/

curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?