LoginSignup
0
0

前提条件

  • AWSアカウント
  • AWS CLI
  • kubectl
  • eksctl

本編

この記事では料金が発生するので使い終わったらクラスターを削除してください。
その方法を最後に記載しています。

クラスターを作ってみよう

eksctl create cluster --name 好きな名前 --nodes-min=インスタンスの数 --region 好きなリージョン
aws eks --region 好きなリージョン update-kubeconfig --name 好きな名前

上記のようなコマンドを実行すると、EKSクラスターが作成されます。

私は以下のようにコマンドを実行しました。
ここでは、クラスター名をsampleService、ノード数を2、リージョンをus-west-2に設定しました。

eksctl create cluster --name sampleService --nodes-min=2 --region us-west-2

クラスターの作成には15分程度かかります。
クラスターが完成したら次のコマンドを実行してください。

次にこのコマンドでkubectlにEKSクラスターに接続させます。
--region --nameには先ほどと同じ値を入力してください。

aws eks --region us-west-2 update-kubeconfig --name sampleService

Added new context arn:aws:eks:us-west-2:~~~
このようなメッセージが表示されればOKです。

ダッシュボードを確認しよう

このようにステータスがアクティブになっていればOKです。
active.png

クラスターを消そう

eksctl delete cluster --name 好きな名前

自分はsampleServiceというクラスターを作成したので、以下のようにコマンドを実行しました。

eksctl delete cluster --name sampleService
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