diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index b135c0c1b9a..d6c8ef43d5c 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -56933,6 +56933,13 @@ func schema_openshift_api_operator_v1_GatewayConfig(ref common.ReferenceCallback Format: "", }, }, + "allowNoUplink": { + SchemaProps: spec.SchemaProps{ + Description: "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).", + Type: []string{"string"}, + Format: "", + }, + }, "ipForwarding": { SchemaProps: spec.SchemaProps{ Description: "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 OVN-Kubernetes managed interfaces, then set this field to \"Global\". The supported values are \"Restricted\" and \"Global\".", diff --git a/openapi/openapi.json b/openapi/openapi.json index 1b487a0b471..96edce04796 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -33032,6 +33032,10 @@ "description": "GatewayConfig holds node gateway-related parsed config file parameters and command-line overrides", "type": "object", "properties": { + "allowNoUplink": { + "description": "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).", + "type": "string" + }, "ipForwarding": { "description": "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 OVN-Kubernetes managed interfaces, then set this field to \"Global\". The supported values are \"Restricted\" and \"Global\".", "type": "string" diff --git a/operator/v1/tests/networks.operator.openshift.io/AAA_ungated.yaml b/operator/v1/tests/networks.operator.openshift.io/AAA_ungated.yaml index 9291acaa3f1..3504fab119f 100644 --- a/operator/v1/tests/networks.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/tests/networks.operator.openshift.io/AAA_ungated.yaml @@ -761,6 +761,86 @@ tests: disableNetworkDiagnostics: false logLevel: "Normal" operatorLogLevel: "Normal" + - name: "Should omit allowNoUplink when not specified" + initial: | + apiVersion: operator.openshift.io/v1 + kind: Network + spec: + defaultNetwork: + ovnKubernetesConfig: + gatewayConfig: + routingViaHost: true + expected: | + apiVersion: operator.openshift.io/v1 + kind: Network + spec: + defaultNetwork: + ovnKubernetesConfig: + gatewayConfig: + routingViaHost: true + ipsecConfig: + mode: Disabled + disableNetworkDiagnostics: false + logLevel: "Normal" + operatorLogLevel: "Normal" + - name: "Should be able to set allowNoUplink to Enabled" + initial: | + apiVersion: operator.openshift.io/v1 + kind: Network + spec: + defaultNetwork: + ovnKubernetesConfig: + gatewayConfig: + routingViaHost: true + allowNoUplink: Enabled + expected: | + apiVersion: operator.openshift.io/v1 + kind: Network + spec: + defaultNetwork: + ovnKubernetesConfig: + gatewayConfig: + allowNoUplink: Enabled + routingViaHost: true + ipsecConfig: + mode: Disabled + disableNetworkDiagnostics: false + logLevel: "Normal" + operatorLogLevel: "Normal" + - name: "Should be able to set allowNoUplink to Disabled" + initial: | + apiVersion: operator.openshift.io/v1 + kind: Network + spec: + defaultNetwork: + ovnKubernetesConfig: + gatewayConfig: + routingViaHost: true + allowNoUplink: Disabled + expected: | + apiVersion: operator.openshift.io/v1 + kind: Network + spec: + defaultNetwork: + ovnKubernetesConfig: + gatewayConfig: + allowNoUplink: Disabled + routingViaHost: true + ipsecConfig: + mode: Disabled + disableNetworkDiagnostics: false + logLevel: "Normal" + operatorLogLevel: "Normal" + - name: "Should not be able to set allowNoUplink to an invalid value" + initial: | + apiVersion: operator.openshift.io/v1 + kind: Network + spec: + defaultNetwork: + ovnKubernetesConfig: + gatewayConfig: + allowNoUplink: Invalid + expectedError: "spec.defaultNetwork.ovnKubernetesConfig.gatewayConfig.allowNoUplink: Unsupported value: \"Invalid\": supported values: \"Enabled\", \"Disabled\"" onUpdate: - name: "IPsec - Removing ipsecConfig.mode is not allowed" initial: | diff --git a/operator/v1/types_network.go b/operator/v1/types_network.go index cd2e2f9e381..079f6faaa22 100644 --- a/operator/v1/types_network.go +++ b/operator/v1/types_network.go @@ -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"` // 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 diff --git a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-CustomNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-CustomNoUpgrade.crd.yaml index 4081fa837b3..d6931f3881c 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-CustomNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-CustomNoUpgrade.crd.yaml @@ -326,6 +326,20 @@ spec: description: gatewayConfig holds the configuration for node gateway options. properties: + allowNoUplink: + description: |- + 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). + enum: + - Enabled + - Disabled + type: string ipForwarding: description: |- ipForwarding controls IP forwarding for all traffic on OVN-Kubernetes managed interfaces (such as br-ex). diff --git a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-Default.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-Default.crd.yaml index 2324d6d3b6b..5277b497e30 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-Default.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-Default.crd.yaml @@ -295,6 +295,20 @@ spec: description: gatewayConfig holds the configuration for node gateway options. properties: + allowNoUplink: + description: |- + 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). + enum: + - Enabled + - Disabled + type: string ipForwarding: description: |- ipForwarding controls IP forwarding for all traffic on OVN-Kubernetes managed interfaces (such as br-ex). diff --git a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-DevPreviewNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-DevPreviewNoUpgrade.crd.yaml index 7fcb1ab52e6..668378fbbe1 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-DevPreviewNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-DevPreviewNoUpgrade.crd.yaml @@ -326,6 +326,20 @@ spec: description: gatewayConfig holds the configuration for node gateway options. properties: + allowNoUplink: + description: |- + 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). + enum: + - Enabled + - Disabled + type: string ipForwarding: description: |- ipForwarding controls IP forwarding for all traffic on OVN-Kubernetes managed interfaces (such as br-ex). diff --git a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-OKD.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-OKD.crd.yaml index 85f957f0da6..6cd57340087 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-OKD.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-OKD.crd.yaml @@ -295,6 +295,20 @@ spec: description: gatewayConfig holds the configuration for node gateway options. properties: + allowNoUplink: + description: |- + 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). + enum: + - Enabled + - Disabled + type: string ipForwarding: description: |- ipForwarding controls IP forwarding for all traffic on OVN-Kubernetes managed interfaces (such as br-ex). diff --git a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-TechPreviewNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-TechPreviewNoUpgrade.crd.yaml index e6a3bedcebe..d2cc64a180e 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-TechPreviewNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-TechPreviewNoUpgrade.crd.yaml @@ -326,6 +326,20 @@ spec: description: gatewayConfig holds the configuration for node gateway options. properties: + allowNoUplink: + description: |- + 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). + enum: + - Enabled + - Disabled + type: string ipForwarding: description: |- ipForwarding controls IP forwarding for all traffic on OVN-Kubernetes managed interfaces (such as br-ex). diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/networks.operator.openshift.io/AAA_ungated.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/networks.operator.openshift.io/AAA_ungated.yaml index 810ab50190c..d3c30511e32 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/networks.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/networks.operator.openshift.io/AAA_ungated.yaml @@ -295,6 +295,20 @@ spec: description: gatewayConfig holds the configuration for node gateway options. properties: + allowNoUplink: + description: |- + 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). + enum: + - Enabled + - Disabled + type: string ipForwarding: description: |- ipForwarding controls IP forwarding for all traffic on OVN-Kubernetes managed interfaces (such as br-ex). diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/networks.operator.openshift.io/NoOverlayMode.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/networks.operator.openshift.io/NoOverlayMode.yaml index de26cd8dd77..aa7b3028210 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/networks.operator.openshift.io/NoOverlayMode.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/networks.operator.openshift.io/NoOverlayMode.yaml @@ -326,6 +326,20 @@ spec: description: gatewayConfig holds the configuration for node gateway options. properties: + allowNoUplink: + description: |- + 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). + enum: + - Enabled + - Disabled + type: string ipForwarding: description: |- ipForwarding controls IP forwarding for all traffic on OVN-Kubernetes managed interfaces (such as br-ex). diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index 2da09cf4a5f..7f14ed64346 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -1869,6 +1869,7 @@ func (FeaturesMigration) SwaggerDoc() map[string]string { var map_GatewayConfig = map[string]string{ "": "GatewayConfig holds node gateway-related parsed config file parameters and command-line overrides", "routingViaHost": "routingViaHost allows pod egress traffic to exit via the ovn-k8s-mp0 management port into the host before sending it out. If this is not set, traffic will always egress directly from OVN to outside without touching the host stack. Setting this to true means hardware offload will not be supported. Default is false if GatewayConfig is specified.", + "allowNoUplink": "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).", "ipForwarding": "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 OVN-Kubernetes managed interfaces, then set this field to \"Global\". The supported values are \"Restricted\" and \"Global\".", "ipv4": "ipv4 allows users to configure IP settings for IPv4 connections. When omitted, this means no opinion and the default configuration is used. Check individual members fields within ipv4 for details of default values.", "ipv6": "ipv6 allows users to configure IP settings for IPv6 connections. When omitted, this means no opinion and the default configuration is used. Check individual members fields within ipv6 for details of default values.",