-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(eks): add atomic flag for aws-eks Helm Chart #29454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment. Other than that LGTM.
packages/@aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py
Show resolved
Hide resolved
Thank you @godwingrs22 for the review, addressed in latest rev for your final review |
@@ -90,7 +91,7 @@ def helm_handler(event, context): | |||
chart_dir = get_chart_from_oci(tmpdir.name, repository, version) | |||
chart = chart_dir | |||
|
|||
helm('upgrade', release, chart, repository, values_file, namespace, version, wait, timeout, create_namespace) | |||
helm('upgrade', release, chart, repository, values_file, namespace, version, wait, timeout, create_namespace, atomic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this will be passed to helm
definition as skip_crds
as that is the next parameter. I think
since atomic
is a 12th parameter in the helm defintion, this needs to come after skip_crds
is passed or you can pass the parameter explicitly like below
helm('upgrade', release, chart, repository, values_file, namespace, version, wait, timeout, create_namespace, atomic=atomic)
But not sure why the existing skip_crds
is not passed to the defintion. Current code looks like it always be false and doesn't get from the resouce props. But this is different issue and just want to highlight it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is interesting since both integration test and unit tests are passing for this too, imo it could be related to that these two flags don't need any additional handling in regards to values and will be just appended to command if set to true, somehow if this is propogating from props.atomic to underlying function, but yes this is weird that this is working for skip_crds and also have a successful tests passed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, seems like the unit test for skip_crds
to disable by default is not correct I feel. Instead it needs to find the resource with { SkipCrds: true }
which will be expected to 0 like how you have handled for atomic
or wait
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @shikha372 for your contribution.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@Mergifyio update |
☑️ Nothing to do
|
@Mergifyio update |
❌ Mergify doesn't have permission to updateFor security reasons, Mergify can't update this pull request. Try updating locally. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Issue # (if applicable)
Closes #22254.
Reason for this change
Currently, if chart is installed to the EKS cluster with wait timeout period set and fails initialization, helm will fail to send a response back to custom resource and it will be stuck in pending upgrade state (expected state is failed) .
Subsequent attempts to update the stack will result in failure while chart is stuck in
pending upgrade
state until manually rolled back or deleted from the cluster.Description of changes
Added feature flag
--atomic
supported by helm currently to mark the operation as atomic which will automatically rolls back the changes in case of upgrade/installation failure.Reference doc: https://helm.sh/docs/helm/helm_install/#options
Description of how you validated changes
Added unit tests to check if flag is set as per user input in the template.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license