Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(eks): deploying helm chart to cluster created in another stack fails with circular dependency #19655

Open
tom-dudley opened this issue Mar 31, 2022 · 1 comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. effort/medium Medium work item – several days of effort p1

Comments

@tom-dudley
Copy link

tom-dudley commented Mar 31, 2022

What is the problem?

I'm attempting to deploy a helm chart, using assets, to a cluster which I created in a separate stack. It fails with a circular dependency error due to the kubectl barrier.

I can see the original issue was addressed in #7322 with a test added for a simple kubernetes manifest. This looks to have been reverted a few months later in 4fad9bc

I'm not even sure if this should be considered a bug since that later commit quite clearly states everything should await that new barrier object. However this does to me seem to break out-of-stack helm deployments using assets. If it is the expected behaviour it'd be helpful to call it out on the HelmChart docs page.

If this looks feature worthy (I'm not sure how feasible it actually is), let me know and I'll stick a request in.

Reproduction Steps

// Run this in stack2, with a cluster created in stack1
const chartAsset = new s3Assets.Asset(this, "ChartAsset", {
  path: "./helm",
});

new eks.HelmChart(this, "foobar", {
  cluster,
  chartAsset: chartAsset
});

What did you expect to happen?

I expected to be able to deploy a helm chart from a different stack

What actually happened?

'stack2' depends on 'stack1' ("stack2/foobar/Resource/Default" depends on "stack1/cluster/KubectlReadyBarrier"). Adding this dependency (stack1/@aws-cdk--aws-eks.KubectlProvider -> stack2/AssetParameters/guidlookingthing/S3Bucket.Ref) would create a cyclic reference.

CDK CLI Version

1.149.0

Framework Version

No response

Node.js Version

16.3.0

OS

MacOs 12.3 (M1)

Language

Typescript

Language Version

No response

Other information

No response

@tom-dudley tom-dudley added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 31, 2022
@github-actions github-actions bot added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Mar 31, 2022
@peterwoodworth peterwoodworth changed the title (eks): short issue description (eks): deploying helm chart to cluster created in another stack fails with circular dependency Mar 31, 2022
@peterwoodworth peterwoodworth added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Mar 31, 2022
@tom-dudley
Copy link
Author

It's also worth mentioning that the test here adds to the confusion -

test('kubectl resources can be created in a separate stack', () => {

The description suggests that it's testing kubectl resources can be created in separate stacks. Depending on the actual desired behaviour we might want to consider changing this to also test the s3 assets as noted in the bug report, or renaming/removing this test.

@otaviomacedo otaviomacedo removed their assignment Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. effort/medium Medium work item – several days of effort p1
Projects
None yet
Development

No branches or pull requests

3 participants