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

Error creating Chart with aws-cdk Construct scope #624

Open
Hazzard17h opened this issue Jul 14, 2022 · 1 comment
Open

Error creating Chart with aws-cdk Construct scope #624

Hazzard17h opened this issue Jul 14, 2022 · 1 comment
Labels
effort/large 1+ weeks feature-request New/Enhanced functionality wanted priority/p2 Dependent on community feedback. PR's are welcome :)

Comments

@Hazzard17h
Copy link

I'm creating a cdk8s Chart in an aws-cdk project, using the following dependencies versions:

"aws-cdk-lib": "^2.0.0",
"cdk8s": "^2.0.0",
"constructs": "^10.0.0",

Using an aws-cdk Construct as the parent scope for the Chart, I'm getting: 'Error: cannot find a parent chart (directly or indirectly)'

import { Construct } from 'constructs';
import { App as AwsApp, Stack } from 'aws-cdk-lib';
import { Cluster, KubernetesVersion } from 'aws-cdk-lib/aws-eks';
import { App as K8sApp, Chart } from 'cdk8s';

class MyStack extends Stack {
  constructor(scope: Construct, id: string) {
    super(scope, id);

    const cluster = new Cluster(this, 'Cluster', { version: KubernetesVersion.V1_21 });

    cluster.addCdk8sChart('Test1', new Chart(this, 'Test1')); // <--- NOT WORKS
    cluster.addCdk8sChart('Test2', new Chart(new K8sApp(), 'Test2')); // <--- WORKS
  }
}

new MyStack(new AwsApp(), 'MyStack');

Which is the intent of Ecosystem Interoperability if the parent scope of a cdk8s Construct can't be an aws-cdk Construct?

@iliapolo
Copy link
Member

iliapolo commented Sep 14, 2022

@Hazzard17h Yeah, currently passing in an AWS CDK construct as the scope will not work.

I agree this is a bit confusing with regards to interop. There are many levels to that interop support.

  • The first was to even make it possible to use the two CDK's in the same App.
  • The second was to allow passing tokens between the two.
  • The third is to allow common scopes.

We unfortunately still haven't reached level 3.

@iliapolo iliapolo added the needs-triage Priority and effort undetermined yet label Feb 6, 2023
@vinayak-kukreja vinayak-kukreja added feature-request New/Enhanced functionality wanted priority/p2 Dependent on community feedback. PR's are welcome :) effort/large 1+ weeks and removed needs-triage Priority and effort undetermined yet labels Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/large 1+ weeks feature-request New/Enhanced functionality wanted priority/p2 Dependent on community feedback. PR's are welcome :)
Projects
None yet
Development

No branches or pull requests

3 participants