-
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
aws-eks: support --atomic
flag for helm commands
#22254
aws-eks: support --atomic
flag for helm commands
#22254
Comments
Thanks for the request @michaelfedell, You're right, this would be a pretty easy implementation done just by introducing a new property and using it similar to the other flags. I am marking this issue as p2, which means that we are unable to work on this immediately. Check out our contributing guide if you're interested in contributing yourself - there's a low chance the team will be able to address this soon but we'd be happy to review a PR 🙂 |
### 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 - [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*
|
Describe the feature
Support the Helm CLI
--atomic
flag as a prop to the aws-cdk.aws-eks.HelmChart construct. This would enable a user to perform their install/upgrade as an atomic operation, rolling back or uninstalling if the operation fails.Use Case
Currently, if the resources installed by helm do not successfully initialize and the
--wait
flag is true, then helm will fail to send a response back to the custom resource in time. Once the first invocation fails, subsequent attempts will fail with the following error:Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress
After the max attempts, the CloudFormation stack will be marked as
UPDATE_ROLLBACK_FAILED
. Forcing the user to manually rollback the helm release as described in this issue on the helm repoProposed Solution
This could be supported with an additional, optional ResourceProperty passed to the custom resource handler and used in the constructed helm command.
aws-cdk/packages/@aws-cdk/aws-eks/lib/kubectl-handler/helm/__init__.py
Line 149 in 877ad71
Other Information
No response
Acknowledgements
CDK version used
2.28.1
Environment details (OS name and version, etc.)
MacOS, TypeScript
The text was updated successfully, but these errors were encountered: