-
Notifications
You must be signed in to change notification settings - Fork 843
operator: add allowNoUplink to OVN-Kubernetes GatewayConfig #3009
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -650,6 +650,16 @@ type GatewayConfig struct { | |
| // +kubebuilder:default:=false | ||
| // +optional | ||
| RoutingViaHost bool `json:"routingViaHost,omitempty"` | ||
| // allowNoUplink allows the external gateway bridge (br-ex) to start in local | ||
| // gateway mode when it has no physical uplink port. | ||
| // Allowed values are "Enabled", "Disabled" and omitted. | ||
| // When set to "Enabled", ovn-kubernetes will not require an uplink on the gateway bridge. | ||
| // When omitted or set to "Disabled", this means no opinion and the platform is left to | ||
| // choose a reasonable default which is subject to change over time. The current default | ||
| // is "Disabled", which requires an uplink on the gateway bridge. | ||
| // This setting only takes effect when routingViaHost is true (local gateway mode). | ||
| // +optional | ||
| AllowNoUplink AllowNoUplinkEnablement `json:"allowNoUplink,omitempty"` | ||
|
Contributor
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 field name
Suggested alternatives: // Option A
UplinkMode UplinkMode `json:"uplinkMode,omitempty"`
// Option B
UplinkRequirement UplinkRequirement `json:"uplinkRequirement,omitempty"`With // +kubebuilder:validation:Enum:="Required";"Optional"
Contributor
Author
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.
Contributor
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. I'd push back on
Contributor
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. I think Optional is not the value we want - there is no option.. its gotta be absent or present as the intent of the API i.e if its set to allownouplink=true then we expect no uplink configured there So: deff u/s definition of AllowNoUplink naming wasn't done well :) so we shouldn't use that as the user facing config
Contributor
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. What about
Contributor
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. After looking at the upstream ovn-kubernetes code, I'm revising my earlier position. The --allow-no-uplink flag acts purely as a "tolerate absence" guard every usage checks both the config flag and whether the uplink is actually missing. If the flag is set but an uplink is present, the system works normally. It never disables uplink functionality; it just relaxes the requirement:
So maybe
Contributor
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.
|
||
| // ipForwarding controls IP forwarding for all traffic on OVN-Kubernetes managed interfaces (such as br-ex). | ||
| // By default this is set to Restricted, and Kubernetes related traffic is still forwarded appropriately, but other | ||
| // IP traffic will not be routed by the OCP node. If there is a desire to allow the host to forward traffic across | ||
|
|
@@ -900,6 +910,16 @@ const ( | |
| IPsecModeFull IPsecMode = "Full" | ||
| ) | ||
|
|
||
| // +kubebuilder:validation:Enum:="Enabled";"Disabled" | ||
| type AllowNoUplinkEnablement string | ||
|
|
||
| var ( | ||
| // AllowNoUplinkEnabled allows the gateway bridge to start without a physical uplink. | ||
| AllowNoUplinkEnabled AllowNoUplinkEnablement = "Enabled" | ||
| // AllowNoUplinkDisabled requires an uplink on the gateway bridge. | ||
| AllowNoUplinkDisabled AllowNoUplinkEnablement = "Disabled" | ||
| ) | ||
|
|
||
| // +kubebuilder:validation:Enum:="";"Enabled";"Disabled" | ||
| type RouteAdvertisementsEnablement string | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Define
Disabledas an explicit uplink requirement.Disabledis an explicit enum value. It should not mean “no opinion” or depend on a future platform default.Document omission as no opinion. Document
Disabledas requiring a physical uplink. This matchesAllowNoUplinkDisabledand the declared API contract.Proposed documentation change
🤖 Prompt for AI Agents