eksctl
APIエンドポイントの設定変更
code:shell
eksctl utils update-cluster-endpoints -f config.yaml --approve
コントロールプレーンのログ記録 設定変更
code:shell
eksctl utils update-cluster-logging -f <path>
ノードグループの管理
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)" このコントロールプレーンは、リージョン内の 3 つのアベイラビリティーゾーンにまたがって動作する 2 つ以上の API サーバーノードと 3 つの etcd ノードで構成されています。Amazon EKS は、異常なコントロールプレーンインスタンスを自動的に検出して置き換え、必要に応じてリージョン内のアベイラビリティーゾーン全体でそれらを再起動します。Amazon EKS は、高可用性を維持するために AWS リージョンのアーキテクチャを利用します。そのため、Amazon EKS は API サーバーエンドポイントの可用性の SLA を提供できます。
インスタンス容量の不足 ソリューション
数分間待ってからリクエストを再度送信します。容量は頻繁に変化します。
このエラーを解決するには、エラーメッセージから推奨されるアベイラビリティーゾーンを使用してもう一度クラスターを作成します。
しかし、eksctlの--zonesオプションは、-fオプションと併用はできない。※v0.23.0
Error: cannot use --zones when --config-file/-f is set
でもコントロールプレーンのAZ指定は設定ファイルには書けない。
と思ったがコントリビューターがこう言ってる
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)"
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では、ここで同等のことを行っている。