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

Allow specifying mtu for kubeovn daemonset #487

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/system/kubeovn/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ update:
curl -sSL https://github.com/kubeovn/kube-ovn/archive/refs/heads/master.tar.gz | \
tar xzvf - --strip 1 kube-ovn-master/charts
patch --no-backup-if-mismatch -p4 < patches/cozyconfig.diff
patch --no-backup-if-mismatch -p4 < patches/mtu.diff

image:
docker buildx build images/kubeovn \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ spec:
- --kubelet-dir={{ .Values.kubelet_conf.KUBELET_DIR }}
- --enable-tproxy={{ .Values.func.ENABLE_TPROXY }}
- --ovs-vsctl-concurrency={{ .Values.performance.OVS_VSCTL_CONCURRENCY }}
{{- with .Values.mtu }}
- --mtu={{ . }}
{{- end }}
securityContext:
runAsUser: 0
privileged: true
Expand Down
14 changes: 14 additions & 0 deletions packages/system/kubeovn/patches/mtu.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/packages/system/kubeovn/charts/kube-ovn/templates/ovncni-ds.yaml b/packages/system/kubeovn/charts/kube-ovn/templates/ovncni-ds.yaml
index c6834ef..423f66b 100644
--- a/packages/system/kubeovn/charts/kube-ovn/templates/ovncni-ds.yaml
+++ b/packages/system/kubeovn/charts/kube-ovn/templates/ovncni-ds.yaml
@@ -76,6 +76,9 @@ spec:
- --kubelet-dir={{ .Values.kubelet_conf.KUBELET_DIR }}
- --enable-tproxy={{ .Values.func.ENABLE_TPROXY }}
- --ovs-vsctl-concurrency={{ .Values.performance.OVS_VSCTL_CONCURRENCY }}
+ {{- with .Values.mtu }}
+ - --mtu={{ . }}
+ {{- end }}
Comment on lines +9 to +11
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

MTU configuration needs validation and documentation

The verification reveals that while the chart has a values.yaml, it currently:

  1. Lacks any MTU configuration validation
  2. Does not document the new MTU configuration option in either values.yaml or README.md

Please add:

  • A documented MTU option in values.yaml with description and default value
  • Schema validation for the MTU value (should be a number between typical MTU ranges)
  • Documentation of the MTU configuration option in the README.md
🔗 Analysis chain

Verify MTU validation and documentation.

While the implementation is correct, please ensure:

  1. The MTU value is properly validated in the chart's values validation
  2. The new configuration option is documented in the chart's README or values.yaml
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if MTU validation exists in values.yaml or schema
fd -t f "values.yaml|values.schema.json" packages/system/kubeovn/charts/kube-ovn -x grep -l "mtu"

# Check if MTU is documented
fd -t f "README.md|CHANGELOG.md|values.yaml" packages/system/kubeovn/charts/kube-ovn -x grep -l "mtu"

Length of output: 199


Script:

#!/bin/bash
# Let's first check if the files exist
fd "values.yaml|values.schema.json|README.md|CHANGELOG.md" packages/system/kubeovn/charts/kube-ovn

# Then let's look at the content of values.yaml if it exists
fd "values.yaml" packages/system/kubeovn/charts/kube-ovn -x cat

# And check for any schema validation files in the chart directory
find packages/system/kubeovn/charts/kube-ovn -type f -name "*schema*" -o -name "*validation*"

Length of output: 4281

securityContext:
runAsUser: 0
privileged: true