Unable to deploy EKS cluster
See original GitHub issueThe problem
Deploying a basic example of an EKS cluster fails with LocalStack on local.
The code
The stack comes from the AWS CDK EKS example.
import * as eks from "@aws-cdk/aws-eks"
import * as cdk from "@aws-cdk/core"
export class AwsCdkWithTypescriptFoundationsStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props)
// provisiong a cluster
const cluster = new eks.Cluster(this, "hello-eks", {
version: eks.KubernetesVersion.V1_21,
})
// apply a kubernetes manifest to the cluster
cluster.addManifest("mypod", {
apiVersion: "v1",
kind: "Pod",
metadata: { name: "mypod" },
spec: {
containers: [
{
name: "hello",
image: "paulbouwer/hello-kubernetes:1.5",
ports: [{ containerPort: 8080 }],
},
],
},
})
}
}
Steps to recreate
- Add the above code to a TypeScript AWS CDK app
- Run the following:
$ cdk synth
$ cdk bootstrap
$ cdk deploy
# ... error
The error (as far as I can tell) from the docker compose
logs:
localstack_1 | 2021-08-11T09:30:04:DEBUG:localstack.services.cloudformation.cloudformation_api: Unable to resolve references in stack outputs: {'Value': {'Fn::Join': ['', ['aws eks get-token --cluster-name ', {'Ref': 'HelloEKS39C624A1'}, ' --region ', {'Ref': 'AWS::Region'}, ' --role-arn ', {'Fn::GetAtt': ['HelloEKSMastersRole53742E60', 'Arn']}]]}} - Unable to fetch details for resource "HelloEKS39C624A1" (attribute "Ref")
localstack_1 | 2021-08-11T09:30:07:DEBUG:localstack.services.cloudformation.cloudformation_api: Executing change set "cdk-deploy-change-set" for stack "AwsCdkWithTypescriptFoundationsStack" with 37 resources ...
localstack_1 | 2021-08-11T09:30:07:DEBUG:localstack.utils.cloudformation.template_deployer: Error applying changes for CloudFormation stack "AwsCdkWithTypescriptFoundationsStack": An error occurred (DependencyViolation) when calling the DeleteRouteTable operation: The routeTable 'rtb-ea506a4e' has dependencies and cannot be deleted. Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1828, in _run
localstack_1 | self.do_apply_changes_in_loop(changes, stack, stack_name)
localstack_1 | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1879, in do_apply_changes_in_loop
localstack_1 | self.apply_change(change, stack, new_resources, stack_name=stack_name)
localstack_1 | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1934, in apply_change
localstack_1 | result = delete_resource(resource_id, old_stack.resources, stack_name)
localstack_1 | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 984, in delete_resource
localstack_1 | ec2_client.delete_route_table(RouteTableId=rt['RouteTableId'])
localstack_1 | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/botocore/client.py", line 386, in _api_call
localstack_1 | return self._make_api_call(operation_name, kwargs)
localstack_1 | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/botocore/client.py", line 705, in _make_api_call
localstack_1 | raise error_class(parsed_response, operation_name)
localstack_1 | botocore.exceptions.ClientError: An error occurred (DependencyViolation) when calling the DeleteRouteTable operation: The routeTable 'rtb-ea506a4e' has dependencies and cannot be deleted.
localstack_1 |
localstack_1 | 2021-08-11T09:30:07:DEBUG:localstack.utils.cloudformation.template_deployer: Extract resource attribute: Custom::AWSCDK-EKS-Cluster Ref
localstack_1 | 2021-08-11T09:30:07:DEBUG:localstack.services.cloudformation.cloudformation_api: Unable to resolve references in stack outputs: {'Value': {'Fn::Join': ['', ['aws eks update-kubeconfig --name ', {'Ref': 'HelloEKS39C624A1'}, ' --region ', {'Ref': 'AWS::Region'}, ' --role-arn ', {'Fn::GetAtt': ['HelloEKSMastersRole53742E60', 'Arn']}]]}} - Unable to fetch details for resource "HelloEKS39C624A1" (attribute "Ref")
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Amazon EKS troubleshooting - AWS Documentation
NodeCreationFailure: Your launched instances are unable to register with your Amazon EKS cluster. Common causes of this failure are insufficient node IAM role...
Read more >Troubleshoot AWS EKS application deploy failure due to ...
The EKS worker node is deployed using AWS CloudFormation template. To re-generate the issue, we will use a public CloudFormation template (URL: ...
Read more >Troubleshooting Deployments on Amazon EKS - Kubeflow
There are several problems that could lead to cluster creation failure. If you see some errors when creating your cluster using eksctl ...
Read more >Troubleshooting | EKS Anywhere - AWS
Cluster creation fails because a cluster of the same name already exists. Try running the eksctl anywhere create cluster again, adding the --force-cleanup ......
Read more >Why can't I connect to my Amazon EKS cluster? - YouTube
Skip directly to the demo: 0:28For more details see the Knowledge Center article with this video: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Pulled the latest image and this looks to no longer be an issue.
Closing this ticket.
Closing this as there haven’t been any further responses.