Pod discovery env vars#119
Merged
Merged
Conversation
renormalize
approved these changes
Jul 29, 2025
Contributor
There was a problem hiding this comment.
Verified that the changes are identical to the old PR #117. Thanks!
unmarshall
approved these changes
Jul 29, 2025
68bcb6c to
f672e50
Compare
- Add Grove environment variables (PGS_NAME, PGS_INDEX, PCLQ_NAME, etc.) to pod containers - Implement environment variable injection for both containers and init containers - Add headless service address generation and pod hostname/subdomain configuration - Create comprehensive test coverage for environment variable handling - Add index tracking system for pod creation with available index calculation - Refactor import statements in miscellaneous.go for consistency Signed-off-by: Ron Kahn <rkahn@nvidia.com>
f672e50 to
675dd10
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and refactorings to improve the handling of PodClique and PodCliqueScalingGroup resources in the Grove operator. Key changes include the addition of environment variables for better configurability, new utility methods for managing pod indices, and updates to service discovery and labeling logic.
Enhancements to PodClique and PodCliqueScalingGroup:
Environment Variable Support:
EnvVarPGSName,EnvVarPCSGName, and others, to improve configurability (operator/api/core/v1alpha1/constants.go).operator/internal/component/podclique/pod/pod.go,operator/internal/component/podcliquescalinggroup/podclique/podclique.go) [1] [2].Service Discovery Enhancements:
GenerateHeadlessServiceAddressto generate fully qualified headless service addresses for Pods (operator/api/core/v1alpha1/namegen.go).operator/internal/component/podclique/pod/pod.go).Utility Improvements:
indexpackage to calculate the next available pod indices, ensuring no conflicts during pod creation (operator/internal/index/tracker.go).createPodsmethod to leverage the new index utility for assigning unique pod indices (operator/internal/component/podclique/pod/syncflow.go).Refactorings and Code Simplifications:
Labeling Logic:
operator/internal/component/podclique/pod/pod.go,operator/internal/component/podcliquescalinggroup/podclique/podclique.go) [1] [2].GeneratePodName, to streamline the codebase (operator/api/core/v1alpha1/namegen.go).Error Handling:
buildResourceandcreatePods, to provide more descriptive error messages (operator/internal/component/podclique/pod/pod.go,operator/internal/component/podclique/pod/syncflow.go) [1] [2].These changes collectively enhance the robustness, configurability, and maintainability of the Grove operator, particularly in managing complex PodClique and PodCliqueScalingGroup setups.
Example: