MEDIUM: ingress: support source-IP persistence failover#822
Draft
MaxRink wants to merge 4 commits into
Draft
Conversation
41a765d to
f27017b
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.
Summary
localinstancepeer entries from the current controller pod plus same-workload controller pods.pod name -> PodIP.source-ip-persistencesource-ip-persistence-sizesource-ip-persistence-expirestick-table type ip size <size> expire <expire> peers localinstancestick on srcSRV_<n>slots so every controller replica maps the same endpoint to the same server identity. This matters for MagLev/source-hash consistency and for peer-replicated stick-table server IDs during failover.--localpeer-port, generated stick-table peer behavior, source-IP persistence annotations, and the deterministic server-slot requirement indocumentation/doc.yaml; regeneratecontroller.mdandannotations.md.Behavior
localpeer entry and ensures its own pod peer entry during startup.localinstancepeer section.--localpeer-port;source-ip-persistence: "true"is set, the backend gets a source-IP stick table attached topeers localinstanceand astick on srcrule.load-balance: "source"and CRD hash-type settings can still choose the initial server. The stick table then records the selected server and can replicate that state between controller pods through the local peer section.SRV_1,SRV_2, etc. stable across controller replicas, so MagLev/source-hash choices and replicated stick-table server IDs refer to the same backend pod on each controller.Full failover setup
Service annotation example:
Generated HAProxy backend shape:
Topology requirements:
--localpeer-portis reachable between ingress-controller pods. The default is10000.source-ip-persistenceon the Service or globally in the ConfigMap.load-balance: "source"for standard Ingress source-hash behavior, or CRD hash-type settings where an environment needs explicit hash-type control.Validation
Local Go/unit checks:
Local kind checks only:
Additional local two-controller proof in
kind-codex-haproxy-failover:haproxy-controller/haproxy-kubernetes-ingressto 2 replicas.No actual clusters were used for validation; all Kubernetes runtime checks above were against local kind only.
Scope and limitations
References