eksctl
https://eksctl.io/
APIエンドポイントの設定変更
https://eksctl.io/usage/vpc-networking/#managing-access-to-the-kubernetes-api-server-endpoints
code:shell
eksctl utils update-cluster-endpoints -f config.yaml --approve
コントロールプレーンのログ記録 設定変更
https://eksctl.io/usage/cloudwatch-cluster-logging/#enabling-cloudwatch-logging
code:shell
eksctl utils update-cluster-logging -f <path>
ノードグループの管理
https://eksctl.io/usage/managing-nodegroups/
SSHを有効にする場合の鍵の指定方法
code:yaml
managedNodeGroups:
- name: test
ssh:
allow: true
publicKeyName: ec2-key-pair-name
code:yaml
# この書き方では同じ鍵を複数回使うとEC2キーペアに重複したキーペアができる
publicKeyPath: ~/.ssh/local-key.pub
クラスター作成失敗
[✖] AWS::EKS::Cluster/ControlPlane: CREATE_FAILED – "Cannot create cluster 'xxxx' because ap-northeast-1a, the targeted availability zone, does not currently have sufficient capacity to support the cluster. Retry and choose from these availability zones: ap-northeast-1b, ap-northeast-1c, ap-northeast-1d (Service: AmazonEKS; Status Code: 400; Error Code: UnsupportedAvailabilityZoneException; Request ID: a5895e0e-90aa-4d49-afef-3ef04568dd00)"
code:shell
✖ AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPublicAPNORTHEAST1D: CREATE_FAILED – "Resource creation cancelled"
✖ AWS::EC2::NatGateway/NATGateway: CREATE_FAILED – "Resource creation cancelled"
✖ AWS::EC2::Route/PublicSubnetRoute: CREATE_FAILED – "Resource creation cancelled"
✖ AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPublicAPNORTHEAST1A: CREATE_FAILED – "Resource creation cancelled"
✖ AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPrivateAPNORTHEAST1A: CREATE_FAILED – "Resource creation cancelled"
✖ AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPrivateAPNORTHEAST1D: CREATE_FAILED – "Resource creation cancelled"
✖ AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPublicAPNORTHEAST1B: CREATE_FAILED – "Resource creation cancelled"
✖ AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPrivateAPNORTHEAST1B: CREATE_FAILED – "Resource creation cancelled"
✖ AWS::EKS::Cluster/ControlPlane: CREATE_FAILED – "Cannot create cluster 'xxxx' because ap-northeast-1a, the targeted availability zone, does not currently have sufficient capacity to support the cluster. Retry and choose from these availability zones: ap-northeast-1b, ap-northeast-1c, ap-northeast-1d (Service: AmazonEKS; Status Code: 400; Error Code: UnsupportedAvailabilityZoneException; Request ID: a5895e0e-90aa-4d49-afef-3ef04568dd00)"
Amazon EKS とは - Amazon EKS
このコントロールプレーンは、リージョン内の 3 つのアベイラビリティーゾーンにまたがって動作する 2 つ以上の API サーバーノードと 3 つの etcd ノードで構成されています。Amazon EKS は、異常なコントロールプレーンインスタンスを自動的に検出して置き換え、必要に応じてリージョン内のアベイラビリティーゾーン全体でそれらを再起動します。Amazon EKS は、高可用性を維持するために AWS リージョンのアーキテクチャを利用します。そのため、Amazon EKS は API サーバーエンドポイントの可用性の SLA を提供できます。
インスタンスの起動に関する問題のトラブルシューティング - Amazon Elastic Compute Cloud
インスタンス容量の不足 ソリューション
数分間待ってからリクエストを再度送信します。容量は頻繁に変化します。
Amazon EKS でクラスター作成エラーを解決する
このエラーを解決するには、エラーメッセージから推奨されるアベイラビリティーゾーンを使用してもう一度クラスターを作成します。
しかし、eksctlの--zonesオプションは、-fオプションと併用はできない。※v0.23.0
Error: cannot use --zones when --config-file/-f is set
でもコントロールプレーンのAZ指定は設定ファイルには書けない。
と思ったがコントリビューターがこう言ってる
https://github.com/weaveworks/eksctl/issues/905#issuecomment-641985395
For those who are stuck with setting the AZ in the config, it belongs under the nodegroup:
スタック削除してリトライしてたら別のエラーが出た。
[✖] AWS::EC2::NatGateway/NATGateway: CREATE_FAILED – "Nat Gateway is not available in this availability zone (Service: AmazonEC2; Status Code: 400; Error Code: NotAvailableInZone; Request ID: 01107de6-5b51-40df-8c68-e8758c4509c0)"
AWS で NAT ゲートウェイ作ろうとして Nat Gateway is not available in this availability zone と怒られた件 - stamemo
NAT ゲートウェイを作れるアベイラビリティゾーンを頑張って当ててください。
マジ?
利用可能なアベイラビリティーゾーン確認
code:shell
❯ aws ec2 describe-availability-zones --region ap-northeast-1 --profile prod
{
"AvailabilityZones": [
{
"State": "available",
"OptInStatus": "opt-in-not-required",
"Messages": [],
"RegionName": "ap-northeast-1",
"ZoneName": "ap-northeast-1a",
"ZoneId": "apne1-az3",
"GroupName": "ap-northeast-1",
"NetworkBorderGroup": "ap-northeast-1"
},
{
"State": "available",
"OptInStatus": "opt-in-not-required",
"Messages": [],
"RegionName": "ap-northeast-1",
"ZoneName": "ap-northeast-1b",
"ZoneId": "apne1-az4",
"GroupName": "ap-northeast-1",
"NetworkBorderGroup": "ap-northeast-1"
},
{
"State": "available",
"OptInStatus": "opt-in-not-required",
"Messages": [],
"RegionName": "ap-northeast-1",
"ZoneName": "ap-northeast-1c",
"ZoneId": "apne1-az1",
"GroupName": "ap-northeast-1",
"NetworkBorderGroup": "ap-northeast-1"
},
{
"State": "available",
"OptInStatus": "opt-in-not-required",
"Messages": [],
"RegionName": "ap-northeast-1",
"ZoneName": "ap-northeast-1d",
"ZoneId": "apne1-az2",
"GroupName": "ap-northeast-1",
"NetworkBorderGroup": "ap-northeast-1"
}
]
}
eksctlでは、ここで同等のことを行っている。
https://github.com/weaveworks/eksctl/blob/b65c3366016a88f09a4efe10ab61926b6589e875/pkg/az/az.go#L161
#EKS #Kubernetes