[aws-eks] document how to define dependencies between k8s resources
See original GitHub issueKubernetes resources are not deployed in the order they were added via add_resource method. If one of them is a namespace, for instance, others fail with a namespace not found error.
Reproduction Steps
eks_cluster = aws_eks.Cluster(..)
eks_cluster.add_resource('namespace', namespace_resource)
eks_cluster.add_resource('resource_1', resource_1_deployed_in_the_namespace)
..
eks_cluster.add_resource('resource_n', resource_n_deployed_in_the_namespace)
Error Log
2/53 | 10:48:01 | CREATE_IN_PROGRESS | Custom::AWSCDK-EKS-KubernetesResource | DevEksCluster/DevEksCluster/manifest-NginxRole/Resource/Default (DevEksClustermanifestNginxRoleEE01848C) Resource creation Initiated
3/53 | 10:48:01 | CREATE_FAILED | Custom::AWSCDK-EKS-KubernetesResource | DevEksCluster/DevEksCluster/manifest-NginxRole/Resource/Default (DevEksClustermanifestNginxRoleEE01848C) Failed to create resource. b'Error from server (NotFound): error when creating "/tmp/manifest.yaml": namespaces "ingress-nginx" not found\n'
new CustomResource (/tmp/jsii-kernel-jIZKhq/node_modules/@aws-cdk/aws-cloudformation/lib/custom-resource.js:32:25)
\_ new KubernetesResource (/tmp/jsii-kernel-jIZKhq/node_modules/@aws-cdk/aws-eks/lib/k8s-resource.js:22:9)
\_ Cluster.addResource (/tmp/jsii-kernel-jIZKhq/node_modules/@aws-cdk/aws-eks/lib/cluster.js:215:16)
\_ _wrapSandboxCode (/home/lky/Repositories/HuuugeStarsCfConfig/contrib/cloudformation/cdk/eks/cluster/.env/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:6498:51)
\_ Kernel._wrapSandboxCode (/home/lky/Repositories/HuuugeStarsCfConfig/contrib/cloudformation/cdk/eks/cluster/.env/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7131:20)
\_ ret._ensureSync (/home/lky/Repositories/HuuugeStarsCfConfig/contrib/cloudformation/cdk/eks/cluster/.env/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:6498:25)
\_ Kernel._ensureSync (/home/lky/Repositories/HuuugeStarsCfConfig/contrib/cloudformation/cdk/eks/cluster/.env/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7102:20)
Environment
- CLI Version :1.4.0
- Framework Version:1.4.0
- OS :all
- Language :all
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
aws-cdk/aws-eks module - AWS Documentation
This construct library allows you to define Amazon Elastic Container Service for Kubernetes (EKS) clusters. In addition, the library also supports defining ......
Read more >Pod Security - EKS Best Practices Guides
According to the Kubernetes documentation, the PSS "define three different policies to broadly cover the security spectrum. These policies are cumulative ...
Read more >Provision an EKS Cluster (AWS) | Terraform
Graph of Relationships - Terraform understands dependency relationships between resources. For example, if an AWS Kubernetes cluster needs a specific VPC ...
Read more >AWS EKS Module - Terraform Registry
Inspired by and adapted from this doc and its source code. Read the AWS docs on EKS to get connected to the k8s...
Read more >How do you visualise dependencies in your Kubernetes ...
When you have a large number of resources in your Kubernetes cluster, you might lose track of all relationships between them. Learn how...
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
@FarshadNiayesh I ran into a similar situation and provided an example on how to create a dependency between two helm charts. But it would also work to provide a dependency between the namespace & chart: https://github.com/aws/aws-cdk/issues/7592#issuecomment-619598485
@eladb can you provide an example of how to do this? I am trying to create a dependency between namespace and helm chart.