[kubernetes] Cleanup loadbalancer services - #1631
Conversation
## What this PR does Similar to an earlier issue with DataVolumes remaining after deleting the tenant k8s cluster using them, a similar problem is observed with LoadBalancer services consuming external IPs. This patch adds another step to the cleanup Helm hook to delete any such services. ### Release note ```release-note [kubernetes] Add a cleanup hook to delete LoadBalancer services after deleting the tenant Kubernetes cluster that they were servicing. ``` Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Summary of ChangesHello Timofei Larkin (@lllamnyp), 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 implements a critical cleanup enhancement for Kubernetes deployments managed via Helm. It introduces a new step in the post-deletion lifecycle to automatically remove LoadBalancer services that would otherwise remain orphaned after a tenant Kubernetes cluster is decommissioned. This prevents the accumulation of unused external IP addresses and ensures more efficient resource management. 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 (@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
|
WalkthroughThis pull request modifies the Kubernetes delete template to rename cleanup resources from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10–15 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-10-13T16:47:33.093ZApplied to files:
🪛 YAMLlint (1.37.1)packages/apps/kubernetes/templates/delete.yaml[error] 9-9: syntax error: expected , but found '' (syntax) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
The pull request effectively addresses the issue of LoadBalancer services persisting after cluster deletion by extending the existing Helm post-delete hook. The renaming of the cleanup resources from "datavolume-cleanup" to a more generic "cleanup" is a good step towards making this hook more versatile. The addition of the kubectl delete services command with the appropriate field selector and the corresponding RBAC permissions are correctly implemented, ensuring proper cleanup of resources.
|
Successfully created backport PR for |
What this PR does
Similar to an earlier issue with DataVolumes remaining after deleting the tenant k8s cluster using them, a similar problem is observed with LoadBalancer services consuming external IPs. This patch adds another step to the cleanup Helm hook to delete any such services.
Release note
Summary by CodeRabbit
New Features
Chores