1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

1
Last updated at Posted at 2022-10-17

この記事でわかること

  • Macでeksctlを使ってAmazon EKSのクラスターを構築する で扱う作業の全体像
  • 手順を進める前に確認したい前提
  • 今の環境で試すときに気をつけたい点

はじめに

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 {クラスタ名}
    

実務で使うときの確認ポイント

  • Kubernetes、EKS、関連コントローラーのバージョン差分を確認する。
  • kubectl の接続先、namespace、RBAC権限を確認してから実行する。
  • 検証後は不要なリソース、Load Balancer、ログ出力先、権限設定を整理する。
  • 本番反映前に公式ドキュメント、リリースノート、既存クラスタの運用ルールを確認する。

おわりに

ここまで読んでいただきありがとうございました。
Wealthy Designでは、AWS・Webシステム開発・AI活用など、現場で使える技術を大切にしています。

会社の取り組みは、会社サイトにまとめています。
https://wealthy-design.com/

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?