LoginSignup
2
0

More than 5 years have passed since last update.

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

Last updated at Posted at 2018-12-01

問題

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
2
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
2
0