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

@aws-cdk/aws-eks: cluster.addHelmChart doesn't pass SkipCrds #31831

Closed
1 task
dancmeyers opened this issue Oct 21, 2024 · 3 comments · Fixed by #31832
Closed
1 task

@aws-cdk/aws-eks: cluster.addHelmChart doesn't pass SkipCrds #31831

dancmeyers opened this issue Oct 21, 2024 · 3 comments · Fixed by #31832
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service @aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@dancmeyers
Copy link
Contributor

dancmeyers commented Oct 21, 2024

Describe the bug

The kubectl custom resource handler has a special path for handling helm charts. This path has a property for SkipCrds, which should do as expected:

The helm function also accepts a skip_crds argument:

def helm(verb, release, chart = None, repo = None, file = None, namespace = None, version = None, wait = False, timeout = None, create_namespace = None, skip_crds = False, atomic = False):

But the line that links the two together does not pass that argument, so it is impossible to tell cluster.addHelmChart not to install CRDs:

helm('upgrade', release, chart, repository, values_file, namespace, version, wait, timeout, create_namespace, atomic=atomic)

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

Passing skipCrds to cluster.addHelmChart should bypass installing CRDs via helm.

Current Behavior

CRDs are still installed via helm even if skipCrds is given as an argument to cluster.addHelmChart.

Reproduction Steps

  • Use cluster.addHelmChart to install a new helm chart that includes CRDs.
  • Pass skipCrds: true as an argument to addHelmChart.
  • Apply the change.
  • Observe that CRDs are still installed.

Possible Solution

The source of the Python kubectl-handler lambda needs to be updated to correctly pass this argument.

Additional Information/Context

No response

CDK CLI Version

2.162.1 (build 10aa526)

Framework Version

No response

Node.js Version

20.18.0

OS

MacOS Sequoia 15.0.1

Language

TypeScript

Language Version

TypeScript (5.6.3), Python 3.11

Other information

No response

@dancmeyers dancmeyers added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 21, 2024
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Oct 21, 2024
@dancmeyers dancmeyers changed the title aws-cdk-lib/aws-eks: cluster.addHelmChart doesn't pass SkipCrds @aws-cdk/aws-eks: cluster.addHelmChart doesn't pass SkipCrds Oct 21, 2024
@github-actions github-actions bot added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Oct 21, 2024
@pahud
Copy link
Contributor

pahud commented Oct 22, 2024

I just read your PR. Yes, looks like that was a miss. Thank you for the report and PR.

@pahud pahud added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Oct 22, 2024
@mergify mergify bot closed this as completed in #31832 Feb 12, 2025
@mergify mergify bot closed this as completed in ee63467 Feb 12, 2025
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

1 similar comment
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2025
yashkh-amzn pushed a commit to yashkh-amzn/aws-cdk that referenced this issue Feb 21, 2025
### Issue # (if applicable)

Closes aws#31831.

### Reason for this change

The `kubectl` custom resource lambda was not correctly passing the `skipCrds` parameter of `aws_eks.Cluster.addHelmChart` all the way through to the invocation of `helm`. As such, unexpected behaviour was observed where, even if `skipCrds` was `true`, `helm` running within the lambda would still attempt to install any relevant CRDs as part of the chart.

### Description of changes

Adds the `skip_crds` argument to the call to `helm` within the `helm_handler` function.

### Description of how you validated changes

I've run the unit tests and verified no changes. I cannot run the integration tests as I cannot afford the cost of deploying a full EKS cluster into my personal AWS account and I can't link this PR to our org's GitHub as per your guidelines, so I can't deploy into an account our org owns through CI.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service @aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants