Skip to content

Modify the kubectl-apply manifest helm_release_naming#5438

Merged
agrawalkhushi18 merged 11 commits into
GoogleCloudPlatform:developfrom
agrawalkhushi18:release-name
Apr 8, 2026
Merged

Modify the kubectl-apply manifest helm_release_naming#5438
agrawalkhushi18 merged 11 commits into
GoogleCloudPlatform:developfrom
agrawalkhushi18:release-name

Conversation

@agrawalkhushi18

@agrawalkhushi18 agrawalkhushi18 commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

This PR modifies the kubectl-apply manifest Helm release naming to improve resource naming clarity, uniqueness, and stability:

  • Optional name attribute: Adds support for an optional name attribute if defined in the manifest object schema.
  • Automatic basename extraction: Extracts the file basename from source paths or URLs for clean, visible titles.
  • Extension Cleanup: Uses a robust regular expression to automatically strip common extensions like .yaml, .yml, and .tftpl from auto-derived names.
  • Length Constraint (DNS-1123): Auto-derived base names are truncated to 30 characters to ensure that the final Helm release name (including prefix and hash) strictly adheres to the 53-character Kubernetes limit.
  • Fallback naming strategy: Uses a stable fallback prefixed with ${var.module_id}-raw combined with a deterministic hash for raw content, ensuring uniqueness without requiring random_id resources.
    This approach provides flexible, deterministic naming while maintaining clarity and avoiding resource conflicts. The README.md has been updated accordingly.

Submission Checklist

NOTE: Community submissions can take up to 2 weeks to be reviewed.

Please take the following actions before submitting this pull request.

  • Fork your PR branch from the Toolkit "develop" branch (not main)
  • Test all changes with pre-commit in a local branch #
  • Confirm that "make tests" passes all tests
  • Add or modify unit tests to cover code changes
  • Ensure that unit test coverage remains above 80%
  • Update all applicable documentation
  • Follow Cluster Toolkit Contribution guidelines #

@agrawalkhushi18 agrawalkhushi18 added the release-improvements Added to release notes under the "Improvements" heading. label Apr 1, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 refactors the naming convention for Helm releases within the kubectl-apply module. By moving away from random hex suffixes in favor of deterministic names derived from manifest metadata, the changes improve predictability and maintainability of deployed resources. Additionally, the integration of a module-level identifier ensures better tracking and configuration management.

Highlights

  • Dynamic Helm Release Naming: Updated the manifest processing logic to generate more descriptive and stable Helm release names based on manifest names or source filenames, rather than relying on random suffixes.
  • Module ID Injection: Introduced a new 'module_id' variable, injected via ghpc, to improve identification and naming consistency within the module.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the kubectl-apply module to use more descriptive Helm release names based on manifest names or source filenames, and introduces the injection of module_id. Feedback indicates that the new naming logic lacks sanitization for DNS compliance (e.g., handling underscores), which is required for Helm releases. Additionally, the apply_manifests variable definition must be updated to include the name attribute for the new logic to function. Finally, removing the random suffix from release names may lead to naming collisions and leaves unused resources and outdated documentation that should be addressed.

Comment thread modules/management/kubectl-apply/main.tf Outdated
Comment thread modules/management/kubectl-apply/variables.tf
Comment thread modules/management/kubectl-apply/main.tf
@agrawalkhushi18

Copy link
Copy Markdown
Contributor Author

SUCCESS:
[PR-test-gke-a2-highgpu-kueue-onspot]
[PR-test-gke-a3-highgpu-onspot]
[PR-test-gke-a3-megagpu-onspot]
[PR-test-gke-a3-ultragpu-onspot]
[PR-test-gke-a4-onspot]
[PR-test-gke-a4x]
[PR-test-gke-g4]
[PR-test-gke-h4d-onspot]
[PR-test-gke-tpu-7x]
[PR-test-gke-tpu-v6e]
[PR-test-slurm-gke]

Comment thread modules/management/kubectl-apply/main.tf
Comment thread modules/management/kubectl-apply/main.tf Outdated

@SwarnaBharathiMantena SwarnaBharathiMantena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@agrawalkhushi18 agrawalkhushi18 merged commit 038146a into GoogleCloudPlatform:develop Apr 8, 2026
25 of 74 checks passed
kadupoornima added a commit that referenced this pull request Apr 9, 2026
agrawalkhushi18 added a commit to agrawalkhushi18/cluster-toolkit that referenced this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-improvements Added to release notes under the "Improvements" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants