fix: install ipvsadm for kube-vip load balancing with nftables proxy#13325
fix: install ipvsadm for kube-vip load balancing with nftables proxy#13325isumitsolanki wants to merge 1 commit into
Conversation
Signed-off-by: Sumit Solanki <sumit.solanki@ibm.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: isumitsolanki The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @isumitsolanki. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
There was a problem hiding this comment.
Pull request overview
This PR fixes missing IPVS tooling setup when using kube-vip control plane load balancing together with kube_proxy_mode: nftables, by introducing a shared ipvs_required toggle and using it across package install, kernel module loading, and reset cleanup paths.
Changes:
- Add
ipvs_requiredto central defaults and use it to gate IPVS-related behavior. - Install
ipvsadmbased onipvs_requiredinstead of onlykube_proxy_mode: ipvs. - Use
ipvs_requiredto control IPVS module loading and IPVS table cleanup during reset.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| roles/system_packages/vars/main.yml | Gates ipvsadm installation on the new shared ipvs_required variable. |
| roles/reset/tasks/main.yml | Gates IPVS table cleanup during reset on ipvs_required. |
| roles/kubespray_defaults/defaults/main/main.yml | Introduces ipvs_required logic and adds a default for kube_vip_lb_enable. |
| roles/kubernetes/node/tasks/main.yml | Gates IPVS-related kernel module loading on ipvs_required. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Install IPVS packages/modules when kube-proxy uses IPVS or kube-vip control plane load balancing uses IPVS (local forwarding). | ||
| ipvs_required: "{{ (kube_proxy_mode == 'ipvs' and not kube_proxy_remove) or (kube_vip_enabled | bool and kube_vip_lb_enable | bool and kube_vip_lb_fwdmethod != 'masquerade') }}" |
| # kube-vip | ||
| kube_vip_enabled: false | ||
| kube_vip_lb_enable: false | ||
| kube_vip_lb_fwdmethod: local |
|
Do we really need to add |
|
BTW this should not |
What type of PR is this?
/kind bug
What this PR does / why we need it:
ipvsadmand IPVS kernel modules were only installed whenkube_proxy_modewasipvs. When usingkube_proxy_mode: nftableswith kube-vip control plane load balancing enabled,ipvsadmwas not installed even though kube-vip uses IPVS for local forwarding on control plane nodes.This PR introduces a shared
ipvs_requiredvariable and uses it consistently for:ipvsadmpackage installation (system_packages)kubernetes/node)reset)ipvs_requiredis true when:kube_proxy_mode: ipvsandkube_proxy_remove: false), orkube_vip_enabledandkube_vip_lb_enable) with a non-masquerade forwarding method (kube_vip_lb_fwdmethod != masquerade)kube_vip_lb_enableis also added tokubespray_defaultsso it is available during bootstrap whensystem_packagesruns.Which issue(s) this PR fixes:
Fixes #13321
Special notes for your reviewer:
Per triage on the issue, IPVS packages are gated on
kube_vip_lb_enable, not justkube_vip_enabled. Users need bothkube_vip_enabled: trueandkube_vip_lb_enable: trueforipvsadmto be installed whenkube_proxy_modeisnftables. Withkube_vip_lb_fwdmethod: masquerade,ipvsadmis intentionally not installed since that mode uses iptables.Does this PR introduce a user-facing change?: