Skip to content

Commit 64cf636

Browse files
committed
fixing UnsupportedAvailabilityZoneException error in us-east-1
1 parent 80d6c16 commit 64cf636

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

01-path-basics/101-start-here/readme.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ a| image::./deploy-to-aws.png[link=https://console.aws.amazon.com/cloudformation
3535

3636
|===
3737

38-
To open the Cloud9 IDE environment, click on the "Outputs" tab in CloudFormation Console and click on the "Cloud9IDE" URL.
38+
Accept the default stack name and Click *Next*. You can give Tags such as Key=Name, Value=k8s-workshop, and click *Next*. Make sure
39+
to check *I acknowledge that AWS CloudFormation might create IAM resources with custom names* and click *Create*.
40+
41+
CloudFormation creates nested stacks and builds several resources that are required for this workshop. Wait until all the resources are created. Once the status for *k8s-workshop* changes to *CREATE_COMPLETE*,
42+
you can open Cloud9 IDE. To open the Cloud9 IDE environment, click on the "Outputs" tab in CloudFormation Console and click on the "Cloud9IDE" URL.
3943

4044
image:cloudformation-output-tab.png[CloudFormation Output Tab]
4145

01-path-basics/102-your-first-cluster/readme.adoc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,51 @@ echo $EKS_SECURITY_GROUPS
6868
```
6969
If any of those environment variables are blank, please re-run the "Build Script" section of the link:../101-start-here[Cloud9 Environment Setup].
7070

71+
If you receive an *UnsupportedAvailabilityZoneException* error during EKS cluster creation, your account is using an AZ that is currently resource constrained. This occurs mostly in N.Virginia region (us-east-1).
72+
73+
An error occurred (UnsupportedAvailabilityZoneException) when calling the CreateCluster operation: Cannot create cluster 'k8s-workshop' because us-east-1c, the targeted availability zone, does not currently have sufficient capacity to support the clust er. Retry and choose from these availability zones: us-east-1a, us-east-1b, us-east-1d
74+
75+
If you receive this error, you need to remove the constrained AZ (us-east-1c in my case) from *`EKS_SUBNET_IDS`* environment variable. Follow these steps to update your environment variable
76+
77+
Save the EKS recommended AZ's that is referred in your CLI output in an environment variable.
78+
Note: you only need two AZ's defined to create EKS cluster
79+
80+
$ export EKS_VALID_AZS=us-east-1a,us-east-1b
81+
82+
Run the command below to determine subnet ID's
83+
84+
$ aws ec2 describe-subnets --filters "Name=vpc-id,Values=$EKS_VPC_ID" "Name=availabilityZone,Values=$EKS_VALID_AZS" --query 'Subnets[*].[SubnetId]' --output text
85+
subnet-6e672524
86+
subnet-18b10e44
87+
88+
Save this output as `*EKS_SUBNET_IDS*` environment variable
89+
90+
$ export EKS_SUBNET_IDS=subnet-6e672524,subnet-18b10e44
91+
92+
Re-run EKS create-cluster and you should now be able to create cluster. The output should look similar to this
93+
94+
{
95+
"cluster": {
96+
"status": "CREATING",
97+
"name": "k8s-workshop",
98+
"certificateAuthority": {},
99+
"roleArn": "arn:aws:iam::123456789012:role/k8s-workshop-EksServiceRo-AWSServiceRoleForAmazonE-1PCSJFFFAF4BL",
100+
"resourcesVpcConfig": {
101+
"subnetIds": [
102+
"subnet-6e672524",
103+
"subnet-18b10e44"
104+
],
105+
"vpcId": "vpc-a779b4dd",
106+
"securityGroupIds": [
107+
"sg-d093de9a"
108+
]
109+
},
110+
"version": "1.10",
111+
"arn": "arn:aws:eks:us-east-1:123456789012:cluster/k8s-workshop",
112+
"createdAt": 1532734869.147
113+
}
114+
}
115+
71116
=== Create the configuration file
72117

73118
In order to access the cluster locally, use a configuration file (sometimes referred to as a `kubeconfig` file). This configuration file can be created automatically.

0 commit comments

Comments
 (0)