Help us understand the problem. What is going on with this article?

【解決方法】Amazon EKSクラスターのkubeconfigが取得できない

More than 1 year has passed since last update.

問題

Amazon EKSクラスターのkubeconfigが取得できない

# クラスターの kubeconfig を作成または更新
$ aws eks update-kubeconfig --name <cluster_name>

Could not connect to the endpoint URL: "https://eks.ap-northeast-1.amazonaws.com/clusters/<cluster_name>"

補足:<cluster_name>は事前に作成したEKSクラスター名

調査

AWS CLIの設定を確認

$ aws configure
AWS Access Key ID [****************WVJA]:
AWS Secret Access Key [****************LD/m]:
Default region name [ap-northeast-1]: 
Default output format [None]:

原因

AWS CLIで設定しているリージョンとEKSクラスターを作成したリージョンが不一致だった。

  • AWS CLIで設定しているリージョン:ap-northeast-1
  • EKSクラスターを作成したリージョン:us-west-2

補足
ap-northeast-1:アジアパシフィック (東京)
us-west-2:オレゴン

対処

EKSクラスターを作成したリージョンをAWS CLIで設定する

aws configure
AWS Access Key ID [****************WVJA]:
AWS Secret Access Key [****************LD/m]:
Default region name [ap-northeast-1]: us-west-2
Default output format [None]:

Amazon EKSクラスターのkubeconfigが取得できるようになったことを確認

$ aws eks update-kubeconfig --name <cluster_name>
Added new context arn:aws:eks:us-west-2:xxxxx:cluster/<cluster_name> to /Users/<username>/.kube/config
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away