-
Notifications
You must be signed in to change notification settings - Fork 494
Add support for optional node selector labels for kube-ovn OVS/OVN pods #5804
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,6 +180,9 @@ spec: | |
| {{- end }} | ||
| nodeSelector: | ||
| kubernetes.io/os: "linux" | ||
| {{- with .Values.ovsNodesLabels }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
|
Comment on lines
182
to
+185
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current templating for adding {{- toYaml (merge .Values.ovsNodesLabels (dict "kubernetes.io/os" "linux")) | nindent 8 }} |
||
| volumes: | ||
| - name: usr-local-sbin | ||
| emptyDir: {} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -156,6 +156,9 @@ spec: | |
| periodSeconds: 10 | ||
| nodeSelector: | ||
| kubernetes.io/os: "linux" | ||
| {{- with .Values.ovsNodesLabels }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
|
Comment on lines
158
to
+161
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current templating for adding {{- toYaml (merge .Values.ovsNodesLabels (dict "kubernetes.io/os" "linux")) | nindent 8 }} |
||
| volumes: | ||
| - name: host-run-ovs | ||
| hostPath: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,13 @@ masterNodesLabels: | |
| kube-ovn/role: master | ||
| # node-role.kubernetes.io/control-plane: "" | ||
|
|
||
| # -- Additional node selector labels for the OVS/OVN pods. | ||
| # This allows scheduling pods like ovs-ovn, kube-ovn-cni, and kube-ovn-pinger on specific nodes. | ||
| # See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector | ||
| # @section -- Global parameters | ||
| ovsNodesLabels: {} | ||
| # kube-ovn/role: ovs | ||
|
Comment on lines
+54
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The indentation of the commented-out example for ovsNodesLabels: {}
# kube-ovn/role: ovs |
||
|
|
||
| # -- General configuration of the network created by Kube-OVN. | ||
| # @section -- Network parameters of the CNI | ||
| # @default -- "{}" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current templating for adding
ovsNodesLabelscan 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 themergefunction to combine the defaultnodeSelectorlabels with the custom ones provided inValues.ovsNodesLabels. This ensures correct formatting and is easier to read and maintain.{{- toYaml (merge .Values.ovsNodesLabels (dict "kubernetes.io/os" "linux")) | nindent 8 }}