Skip to content

Conversation

@saeed-mcu
Copy link

This change introduces a new Helm value ovsNodesLabels that allows adding custom node selector labels to ovs-ovn pods. For example:
ovsNodesLabels:
kube-ovn/role: ovs
This is useful in environments such as OpenStack-Helm, where operators may want to schedule OVS/OVN pods only on specific nodes (e.g., compute nodes) instead of deploying them cluster-wide. When ovsNodesLabels is empty, only the default selector kubernetes.io/os: linux is applied.

This change introduces a new Helm value ovsNodesLabels that allows
adding custom node selector labels to ovs-ovn pods. For example:
 ovsNodesLabels:
  kube-ovn/role: ovs
This is useful in environments such as OpenStack-Helm, where operators
may want to schedule OVS/OVN pods only on specific nodes (e.g., compute
nodes) instead of deploying them cluster-wide. When ovsNodesLabels is
empty, only the default selector kubernetes.io/os: linux is applied.

Signed-off-by: Saeed Padari <[email protected]>
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Oct 17, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @saeed-mcu, 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 enhances the kube-ovn Helm chart by providing a new configuration option to control where its core components are deployed. It introduces a Helm value that allows operators to specify custom node selector labels, enabling more precise scheduling of OVS/OVN, agent, and pinger pods onto designated nodes within a Kubernetes cluster. This flexibility is particularly beneficial for environments requiring specialized node roles, ensuring optimal resource utilization and operational efficiency.

Highlights

  • New Helm Value: Introduced a new Helm value, ovsNodesLabels, in values.yaml to allow custom node selector labels for Kube-OVN OVS/OVN pods.
  • Dynamic Node Selection: The ovsNodesLabels value can be used to apply custom node selector labels to the kube-ovn-agent, ovs-ovn, and kube-ovn-pinger daemonsets.
  • Targeted Pod Scheduling: This enhancement enables operators to schedule OVS/OVN-related pods on specific nodes, such as compute nodes in OpenStack-Helm environments, improving resource management and deployment flexibility.
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.

@dosubot dosubot bot added the chart Helm Chart label Oct 17, 2025
Copy link
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 introduces a new Helm value ovsNodesLabels to allow adding custom node selector labels to the ovs-ovn, kube-ovn-cni, and kube-ovn-pinger pods. While the intent is good, the implementation in the Helm templates for the daemonsets has issues with whitespace control that can lead to invalid YAML output. I've provided suggestions to use a more robust and idiomatic approach using the merge function to combine the default and custom node selectors. Additionally, I've suggested a small change in values.yaml to improve clarity for users.

Comment on lines 233 to +236
kubernetes.io/os: "linux"
{{- with .Values.ovsNodesLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current templating for adding ovsNodesLabels can lead to incorrect YAML due to issues with whitespace control (- in {{- ... }}) and the indentation of the template directives. A more robust and idiomatic approach in Helm is to use the merge function to combine the default nodeSelector labels with the custom ones provided in Values.ovsNodesLabels. This ensures correct formatting and is easier to read and maintain.

{{- toYaml (merge .Values.ovsNodesLabels (dict "kubernetes.io/os" "linux")) | nindent 8 }}

Comment on lines 182 to +185
kubernetes.io/os: "linux"
{{- with .Values.ovsNodesLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current templating for adding ovsNodesLabels can lead to incorrect YAML due to issues with whitespace control (- in {{- ... }}) and the indentation of the template directives. A more robust and idiomatic approach in Helm is to use the merge function to combine the default nodeSelector labels with the custom ones provided in Values.ovsNodesLabels. This ensures correct formatting and is easier to read and maintain.

{{- toYaml (merge .Values.ovsNodesLabels (dict "kubernetes.io/os" "linux")) | nindent 8 }}

Comment on lines 158 to +161
kubernetes.io/os: "linux"
{{- with .Values.ovsNodesLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current templating for adding ovsNodesLabels can lead to incorrect YAML due to issues with whitespace control (- in {{- ... }}) and the indentation of the template directives. A more robust and idiomatic approach in Helm is to use the merge function to combine the default nodeSelector labels with the custom ones provided in Values.ovsNodesLabels. This ensures correct formatting and is easier to read and maintain.

{{- toYaml (merge .Values.ovsNodesLabels (dict "kubernetes.io/os" "linux")) | nindent 8 }}

Comment on lines +54 to +55
ovsNodesLabels: {}
# kube-ovn/role: ovs
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The indentation of the commented-out example for ovsNodesLabels is misleading. It suggests it's a child of a mapping, but ovsNodesLabels is defined as an empty map on a single line. This can be confusing for users trying to enable this feature. Adjusting the comment's indentation will improve clarity.

ovsNodesLabels: {}
#  kube-ovn/role: ovs

@SkalaNetworks
Copy link
Contributor

Shouldn't those labels be added to every daemon deployed and not just the ones you put? For example, the controller?

If not, there's an ovsOvn section in the chart where that value could probably fit better. Renaming it to "nodeSelector" could also help make its goal clearer.

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

Labels

chart Helm Chart size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants