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

cdk8s synth pulls namespace from current context #2303

Open
burner1024 opened this issue Dec 18, 2024 · 4 comments
Open

cdk8s synth pulls namespace from current context #2303

burner1024 opened this issue Dec 18, 2024 · 4 comments
Labels
bug Something isn't working needs-triage Priority and effort undetermined yet

Comments

@burner1024
Copy link

Description of the bug:

When using a Helm chart, namespace for resources would be taken from current context in ~/.kube/config.
That is unexpected.

Reproduction Steps:

        new Helm(this, 'karpenter', {
            chart: 'oci://public.ecr.aws/karpenter/karpenter',
            values: {
                serviceAccount: {
                    annotations:
                        { 'eks.amazonaws.com/role-arn': values.controllerRoleArn }
                },
                settings: {
                    clusterName: values.clusterName,
                    interruptionQueue: values.interruptionQueue,
                },
                webhook: { enabled: false },
            },
            version: values.version,
        });

Easily worked around by explicitly setting namespace = this.namespace.

But this is surprising behaviour, which will lead to generating different manifest from the same code on different machines.

Error Log:

Environment:

  • Framework Version: 2.198.283
  • OS:

Other:


This is 🐛 Bug Report

@burner1024 burner1024 added bug Something isn't working needs-triage Priority and effort undetermined yet labels Dec 18, 2024
@shinebayar-g
Copy link

I believe this is how helm template works. It should be easily reproducible by running the equivalent helm template command.

@burner1024
Copy link
Author

Maybe. But the very reason to use cdk8s is to forget the nightmare that Helm is.

@shinebayar-g
Copy link

Not maybe, it is. You're not escaping anything. You're literally calling helm template.

@burner1024
Copy link
Author

Whatever, doesn't really matter, the ask stands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Priority and effort undetermined yet
Projects
None yet
Development

No branches or pull requests

2 participants