Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create variables for ipvs kernel modules #10580

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

borgiacis
Copy link
Contributor

@borgiacis borgiacis commented Nov 1, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Allows to manage IPVS kernel modules.
  • Currently you can not configure module ip_vs_lc without it being overwritten by the playbook role/kubernetes/node.

Which issue(s) this PR fixes:

Fixes #9628

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Add variable to configure ipvs modules (`kube_proxy_ipvs_modules`)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 1, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @borgiacis. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 1, 2023
@borgiacis
Copy link
Contributor Author

@floryut please review this PR instead of #9630 .
Thank you!

Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@floryut please review this PR instead of #9630 . Thank you!

@borgiacis Thank you for the PR 👍

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 2, 2023
@floryut
Copy link
Member

floryut commented Nov 2, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 2, 2023
@floryut floryut added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 2, 2023
Copy link
Contributor

@VannTen VannTen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions to avoid duplication and shell module usage (one list + converting to file contents is better in my opinion than defining the two variables)

{% if modprobe_nf_conntrack_ipv4 is success -%}
nf_conntrack_ipv4
{%- endif -%}
content: "{{ kube_proxy_ipvs_modules_list }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
content: "{{ kube_proxy_ipvs_modules_list }}"
content: "{{ kube_proxy_ipvs_modules | join('\n') }}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to new commit

when: kube_proxy_mode == 'ipvs'
tags:
- kube-proxy

- name: Add nf_conntrack_ipv4 to file if module is mounted
shell: "echo 'nf_conntrack_ipv4' >> /etc/modules-load.d/kube_proxy-ipvs.conf"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
shell: "echo 'nf_conntrack_ipv4' >> /etc/modules-load.d/kube_proxy-ipvs.conf"
set_fact:
kube_proxy_ipvs_modules: "{{ kube_proxy_ipvs_modules + ['nf_conntrack_ipv4'] }}"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ moving that before the persist tasks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to new commit

when: kube_proxy_mode == 'ipvs'
tags:
- kube-proxy

- name: Add nf_conntrack_ipv4 to file if module is mounted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Add nf_conntrack_ipv4 to file if module is mounted
- name: Add nf_conntrack_ipv4 kube-proxy ipvs module list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to new commit

@@ -113,10 +113,7 @@
name: "{{ item }}"
state: present
with_items:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with_items:
loop: "{{ kube_proxy_ipvs_modules }}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to new commit

- ip_vs_rr
- ip_vs_wrr
- ip_vs_sh
- "{{ kube_proxy_ipvs_modules }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- "{{ kube_proxy_ipvs_modules }}"

Copy link
Contributor Author

@borgiacis borgiacis Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to new commit

Comment on lines 251 to 258

kube_proxy_ipvs_modules_list: |
ip_vs
ip_vs_rr
ip_vs_wrr
ip_vs_sh
ip_vs_wlc
ip_vs_lc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kube_proxy_ipvs_modules_list: |
ip_vs
ip_vs_rr
ip_vs_wrr
ip_vs_sh
ip_vs_wlc
ip_vs_lc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to new commit

@borgiacis
Copy link
Contributor Author

borgiacis commented Nov 3, 2023

@VannTen I have created a new commit. With suggestions

@VannTen
Copy link
Contributor

VannTen commented Nov 3, 2023

Looks good to me. Can't comment on the module list itself as I don't know much about IPVS, but the code is IMO clearer that way 👍

@borgiacis
Copy link
Contributor Author

Looks good to me. Can't comment on the module list itself as I don't know much about IPVS, but the code is IMO clearer that way 👍

Thanks! for reviewing

Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, looks good 👍
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: borgiacis, floryut, MrFreezeex

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 802da0b into kubernetes-sigs:master Nov 8, 2023
59 checks passed
@yankay yankay mentioned this pull request Dec 15, 2023
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
* Create variables for ipvs kernel modules

* Corrected kubernetes role node task missing name

* Added changes as suggested during review by VannTen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPVS kernel modules overwrite
5 participants