Skip to content

feat(helm):Add affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets using v2 chart#6308

Merged
SkalaNetworks merged 2 commits intokubeovn:masterfrom
swisscom:feat/helm-v2-configurable-affinity-nodeselector
Feb 23, 2026
Merged

feat(helm):Add affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets using v2 chart#6308
SkalaNetworks merged 2 commits intokubeovn:masterfrom
swisscom:feat/helm-v2-configurable-affinity-nodeselector

Conversation

@morete
Copy link
Copy Markdown
Contributor

@morete morete commented Feb 18, 2026

Pull Request

What type of this PR

  • Features
  • Add affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets using v2 chart.
  • Default hardcoded values are moved over to the Helm default values

Which issue(s) this PR fixes

N/A

I need to get this ported back to helm chart v2 v1.14.x and v1.15.x

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. chart Helm Chart feature New network feature labels Feb 18, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @morete, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant enhancements to the Kube-OVN v2 Helm chart by enabling advanced scheduling capabilities for the core ovs-ovn and ovs-ovn-dpdk components. By exposing affinity and nodeSelector configurations through Helm values, users gain greater flexibility in defining where these critical network components are deployed within their Kubernetes clusters, improving resource utilization and operational control.

Highlights

  • Feature: Affinity and NodeSelector Support: Added support for affinity and nodeSelector configurations to the ovs-ovn and ovs-ovn-dpdk DaemonSets within the v2 Helm chart, allowing for more granular control over pod placement.
  • Helm Value Integration: Migrated previously hardcoded nodeSelector values into the Helm values.yaml file, enhancing configurability and adherence to Helm best practices.
Changelog
  • charts/kube-ovn-v2/templates/ovs-ovn/ovs-ovn-daemonset.yaml
    • Introduced affinity configuration for the ovs-ovn DaemonSet, allowing it to be defined via Helm values.
    • Updated the nodeSelector for the ovs-ovn DaemonSet to dynamically use values provided in values.yaml instead of a hardcoded kubernetes.io/os: "linux".
  • charts/kube-ovn-v2/templates/ovs-ovn/ovs-ovn-dpdk-daemonset.yaml
    • Added affinity configuration for the ovs-ovn-dpdk DaemonSet, making it configurable through Helm values.
    • Modified the nodeSelector for the ovs-ovn-dpdk DaemonSet to retrieve its configuration from Helm values, replacing the previously hardcoded kubernetes.io/os: "linux" and ovn.kubernetes.io/ovs_dp_type: "userspace".
  • charts/kube-ovn-v2/values.yaml
    • Added a new affinity field under ovsOvn for configuring pod affinity, defaulting to an empty object.
    • Introduced a nodeSelector field under ovsOvn with a default kubernetes.io/os: "linux" to allow custom node selection.
    • Added a new affinity field under ovsOvn.dpdkHybrid for configuring DPDK-specific pod affinity, defaulting to an empty object.
    • Introduced a nodeSelector field under ovsOvn.dpdkHybrid with default values for kubernetes.io/os: "linux" and ovn.kubernetes.io/ovs_dp_type: "userspace" to enable custom node selection for DPDK deployments.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for affinity and nodeSelector to the ovs-ovn and ovs-ovn-dpdk DaemonSets, making them configurable through the Helm chart's values. The changes are well-implemented by moving previously hardcoded values to the values.yaml file and referencing them in the templates. My review includes suggestions to improve the robustness of the Helm templates by using with blocks, which is a common practice to handle optional values gracefully and maintain consistency with other parts of the chart. The provided rule regarding Helm values.yaml and image tag consistency does not apply to these comments, so all original comments have been retained.

@morete morete force-pushed the feat/helm-v2-configurable-affinity-nodeselector branch from cf5bc70 to 1132e10 Compare February 18, 2026 08:14
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Feb 18, 2026
@morete
Copy link
Copy Markdown
Contributor Author

morete commented Feb 18, 2026

I have verified the rendering of both ovs-ovn and ovs-ovn-dpdk daemonsets under various scenarios:

  • With custom values: Both affinity and nodeSelector render correctly. Note that Helm merges these with the default values in values.yaml unless explicitly overridden or set to null.
  • Passed as null: Both fields are correctly removed from the rendered YAML, as the {{- with ... }} block skips them.
  • Passed as empty {}: They merge with defaults. For example, nodeSelector still renders kubernetes.io/os: linux because it's defined in the base values.yaml.

Verification Results:

Scenario Affinity NodeSelector Result
Custom Values Rendered (Custom + Defaults) Rendered (Custom + Defaults) Success
Passed as null Removed Removed Success
Passed as {} Skipped (if default is {}) Rendered (Defaults) Success
Defaults only Skipped Rendered (Defaults) Success

@morete
Copy link
Copy Markdown
Contributor Author

morete commented Feb 18, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for affinity and nodeSelector to the ovs-ovn and ovs-ovn-dpdk DaemonSets in the v2 Helm chart. The changes are well-implemented, using with blocks to conditionally render the new configurations and moving previously hardcoded values to values.yaml as defaults. This improves the chart's flexibility and configurability. The implementation follows Helm best practices, and the changes look good.

@SkalaNetworks SkalaNetworks self-assigned this Feb 19, 2026
@SkalaNetworks
Copy link
Copy Markdown
Member

LGTM, thank you

@SkalaNetworks
Copy link
Copy Markdown
Member

@oujonny your recently added "Lint and Test Charts" test doesn't seem to be running?

I also notice we have those tests
https://github.com/kubeovn/kube-ovn/actions/runs/22141372312/job/64125159405?pr=6308
https://github.com/kubeovn/kube-ovn/actions/runs/22141372312/job/64125159378?pr=6308

For the v1 Helm Chart, it has the benefits of testing if the Pods are ok, and passes a bunch of parameters to make Kube-OVN work. That might be a good idea.

@oujonny
Copy link
Copy Markdown
Contributor

oujonny commented Feb 19, 2026

I would say my new test is not running because the source branch has not yet been updated/rebased. @morete, can you rebase your commits to the latest upstream master branch? :)

I think for the v2 chart, we do not have to provide that much of paramets to make the kube-ovn installation run. The additional checks for the pods are nice. Let me add them with another PR.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 19, 2026
@morete morete force-pushed the feat/helm-v2-configurable-affinity-nodeselector branch from 9f3bf6d to 752126d Compare February 19, 2026 12:28
@morete
Copy link
Copy Markdown
Contributor Author

morete commented Feb 19, 2026

@oujonny , rebased this branch now and test should then succeed.
@SkalaNetworks thanks for picking this one up. Could workflows be approved again please?

…pdk DaemonSets using v2 chart

Signed-off-by: Juan Morete <juan.morete@swisscom.com>
… and ovs-ovn-dpdk DaemonSets

Signed-off-by: Juan Morete <juan.morete@swisscom.com>
@morete morete force-pushed the feat/helm-v2-configurable-affinity-nodeselector branch from 752126d to 742f4de Compare February 19, 2026 13:35
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 19, 2026
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 22183976800

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 23.003%

Files with Coverage Reduction New Missed Lines %
pkg/ovs/ovn-nb-bfd.go 2 61.61%
Totals Coverage Status
Change from base Build 22175163829: 0.0%
Covered Lines: 12504
Relevant Lines: 54358

💛 - Coveralls

@SkalaNetworks
Copy link
Copy Markdown
Member

@oujonny unsure what the pipeline is complaining about, but it is failing for some reason

@oujonny
Copy link
Copy Markdown
Contributor

oujonny commented Feb 20, 2026

The helm chart linting is failing because the chart version got not updated.

I would argue is a best practice to bump the chart version for each change. Similar as for docker images is not recommended to push multiple times to the same tag/version. But is seems like this practice is not applied to this chart. So not sure what to do know.

@oilbeater
Copy link
Copy Markdown
Collaborator

@oujonny I think we can try to disable version check from option https://github.com/helm/chart-testing/blob/main/doc/ct_lint.md

@SkalaNetworks
Copy link
Copy Markdown
Member

I recommend we address that in this PR #6311

We can let this test fail here, it doesn't really matter.

@SkalaNetworks SkalaNetworks merged commit 58b9f59 into kubeovn:master Feb 23, 2026
144 of 149 checks passed
@morete
Copy link
Copy Markdown
Contributor Author

morete commented Mar 2, 2026

Hi @oilbeater , Would you please release this one? I would need to have it available on helm chart v2 1.14.x and 1.15.x would that be possible? Thanks a lot!

oilbeater pushed a commit that referenced this pull request Mar 3, 2026
…ovn-dpdk DaemonSets using v2 chart (#6308)

* feat: add affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets using v2 chart

Signed-off-by: Juan Morete <juan.morete@swisscom.com>

* feat(chart): Add custom affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets

Signed-off-by: Juan Morete <juan.morete@swisscom.com>

---------

Signed-off-by: Juan Morete <juan.morete@swisscom.com>
oilbeater pushed a commit that referenced this pull request Mar 3, 2026
…ovn-dpdk DaemonSets using v2 chart (#6308)

* feat: add affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets using v2 chart

Signed-off-by: Juan Morete <juan.morete@swisscom.com>

* feat(chart): Add custom affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets

Signed-off-by: Juan Morete <juan.morete@swisscom.com>

---------

Signed-off-by: Juan Morete <juan.morete@swisscom.com>
@oilbeater
Copy link
Copy Markdown
Collaborator

@morete I have cherry-pick it and will release on next version.

@morete
Copy link
Copy Markdown
Contributor Author

morete commented Mar 3, 2026

Thanks a lot @oilbeater ! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chart Helm Chart feature New network feature size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants