BUG/MEDIUM: preserve NodePort when reconciling Service ports#21
Open
pierrecdn wants to merge 1 commit intohaproxytech:devfrom
Open
BUG/MEDIUM: preserve NodePort when reconciling Service ports#21pierrecdn wants to merge 1 commit intohaproxytech:devfrom
pierrecdn wants to merge 1 commit intohaproxytech:devfrom
Conversation
The Service port reconciler rebuilds .spec.ports from VirtualListeners on every event batch. VirtualListener-derived ports are emitted with no NodePort, so for Services of type NodePort the patch resets NodePort to 0 and Kubernetes re-allocates a random one on every reconcile. That makes the chart's NodePort defaults and any user-supplied nodePort from service.extraPorts effectively useless. This commit carry the existing NodePort through whenever the port number matches. That should cover both the steady-state case (preserve what Kubernetes allocated on the first reconcile) and the initial-state case (keep a user-provided nodePort when the chart-created Service's port number matches a Gateway listener, even if the port names differs). Signed-off-by: Pierre Cheynier <p.cheynier@criteo.com>
caa55f0 to
944ffaa
Compare
Member
|
@pierrecdn Thanks for your contribution. |
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.
Hey team,
At trying to migrate my previous install (0.8) to the Helm chart and 1.0.2, I noticed this behavior associated to the use of statically defined nodePorts, that actually prevented me to complete the said migration.
Typically my HUG Service is constantly updated with dynamically computed NodePorts, which obviously isn't expected 😅.
The Service port reconciler rebuilds .spec.ports from VirtualListeners on every event batch.
VirtualListener-derived ports are emitted with no NodePort, so for Services of type NodePort the patch resets NodePort to 0 and Kubernetes re-allocates a random one on every reconcile. That makes the chart's NodePort defaults and any user-supplied nodePort from service.extraPorts effectively useless.
This commit carry the existing NodePort through whenever the port number matches. That should cover both the steady-state case (preserve what Kubernetes allocated on the first reconcile) and the pre-seeded case (keep a user-provided nodePort when the chart-created Service's port number matches a Gateway listener, even if the port names differs).