LoginSignup
1
1

More than 1 year has passed since last update.

Macでeksctlを利用してAmazon EKSのクラスターを構築する

Last updated at Posted at 2022-10-17

はじめに

eksctl を利用して、Amazon EKSのにクラスターを構築する方法です。
学習する際にクラスターを簡単に作れるので、便利です。
Mac環境を想定しています。

環境設定

  1. kubectlをインストール

    brew install kubectl 
    
  2. eksctlをインストール

    brew tap weaveworks/tap
    brew install weaveworks/tap/eksctl
    

実行環境の準備

  1. AWS CLIの設定
    AWS CloudFormationを動かすためのAWS CLIの設定を参考にしてください。

EKSの構築

  1. AWSで利用できるEKSのバージョンの確認

    aws eks describe-addon-versions --query 'addons[0].addonVersions[0].compatibilities[*].clusterVersion'
    
  2. EKSクラスターを構築する

    eksctl create cluster \
        --name {クラスタ名} \
        --version $(aws eks describe-addon-versions --query 'addons[0].addonVersions[0].compatibilities[1].clusterVersion' --output text) \
        --region ap-northeast-1 \
        --nodegroup-name workers \
        --node-type t3.medium \
        --nodes 2 \
        --nodes-min 1 \
        --nodes-max 4 \
        --ssh-access \
        --ssh-public-key ~/.ssh/{公開鍵} \
        --managed
    
    
  3. EKSクラスターを削除する

    eksctl delete cluster \
        --name {クラスタ名}
    
1
1
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
1
1