✨ Generate VmPlacementPolicies for host-level AF and AAF#1515
Open
palnabarun wants to merge 1 commit intovmware-tanzu:mainfrom
Open
✨ Generate VmPlacementPolicies for host-level AF and AAF#1515palnabarun wants to merge 1 commit intovmware-tanzu:mainfrom
palnabarun wants to merge 1 commit intovmware-tanzu:mainfrom
Conversation
…ffinity Previously, processVMAffinity() and processVMAntiAffinity() only translated zone-topology terms (topologyKey: topology.kubernetes.io/zone) into VmPlacementPolicies. Host-topology terms (topologyKey: kubernetes.io/hostname) were silently skipped with the expectation that ClusterModules would handle host-level anti-affinity. This change: - Refactors buildTagIDsFromZoneTopology into a generic buildTagIDsFromTopology(vmCtx, terms, topologyKey) with thin wrappers buildTagIDsFromZoneTopology and buildTagIDsFromHostTopology to avoid duplicating the tag extraction logic. - Extends processVMAffinity to generate VmVmAffinity policies with Host topology for both required and preferred terms. - Extends processVMAntiAffinity to generate VmToVmGroupsAntiAffinity policies with Host topology for both required and preferred terms. Each topology/strictness combination produces a separate policy object. - Gates all host-topology processing behind a feature-gate - Adds tests for required/preferred host-level affinity and anti-affinity, mixed zone+host topology terms, and verifies that host-topology terms are silently skipped when VMAffinityDuringExecution is disabled while zone-topology terms continue to work. Signed-off-by: Nabarun Pal <nabarun.pal@broadcom.com>
efe4c23 to
0e44738
Compare
Minimum allowed line rate is |
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.
Previously,
processVMAffinity()andprocessVMAntiAffinity()only translated zone-topology terms (topologyKey: topology.kubernetes.io/zone) intoVmPlacementPolicies. Host-topology terms (topologyKey: kubernetes.io/hostname) were silently skipped with the expectation that ClusterModules would handle host-level anti-affinity.What does this PR do, and why is it needed?
buildTagIDsFromZoneTopologyinto a genericbuildTagIDsFromTopology(vmCtx, terms, topologyKey)with thin wrappersbuildTagIDsFromZoneTopologyandbuildTagIDsFromHostTopologyto avoid duplicating the tag extraction logic.processVMAffinityto generateVmVmAffinitypolicies with Host topology for both required and preferred terms.processVMAntiAffinityto generateVmToVmGroupsAntiAffinitypolicies with Host topology for both required and preferred terms. Each topology/strictness combination produces a separate policy object.VMAffinityDuringExecutionis disabled while zone-topology terms continue to work.✨
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Are there any special notes for your reviewer:
Please add a release note if necessary: