Update wait flag and resolving helm_release deadlock destruction error#5147
Conversation
Summary of ChangesHello @agrawalkhushi18, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the stability and reliability of Kubernetes cluster deployments, particularly concerning Helm chart installations and resource teardown. By enforcing synchronous Helm installations for Kueue and introducing explicit dependency tracking using the system node pool ID, it resolves issues related to transient build failures and prevents deadlock errors during the destruction of Helm releases. The changes ensure a more predictable and robust lifecycle management for cluster components. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively resolves a Helm release deadlock during destruction by enforcing wait=true for Kueue installations and creating an explicit dependency on the system node pool. The use of a tf_dependency_anchor is a solid approach to manage this race condition in Terraform. The changes are well-propagated through the various modules and examples. I've included a couple of suggestions to improve the robustness of a new output and to address an inconsistency introduced by hardcoding the wait flag, which will enhance the long-term maintainability of the module.
|
Added |
39e60a6 to
df71088
Compare
df71088 to
178bc98
Compare
3881b15 to
457011f
Compare
b50773b
into
GoogleCloudPlatform:develop
GoogleCloudPlatform#5147) All the relevant tests passed successfully on running babysit.
This PR addresses transient kueue-webhook build failures caused by asynchronous Helm installs (wait=false) by enabling
wait=true. To prevent the resulting destruction-time race condition where node pools are deleted before Helm resources, it introduces an explicit dependency on the system_node_pool to ensure a clean, sequential teardown.Changes:
gke-cluster/outputs.tf: Added system_node_pool_id output to expose the node pool's unique identifier for dependency tracking.
kubectl-apply/variables.tf: Introduced system_node_pool_id variable to receive the dependency anchor from the cluster module.
kubectl-apply/main.tf: Forced wait = true for Kueue installation and passed the system_node_pool_id into the install_kueue module.
helm_install/main.tf: Implemented a tf_dependency_anchor using a Helm set block to force Terraform to honor sequential resource ordering during destruction.
Updated GKE blueprints to remove explicit setting of the wait flag
To clean up the orphaned resources created through the ansible post-deploy test, a cleanup step to remove these resources has been added for helm and terraform to handle the gcluster destroy gracefully in the build environment.