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

restrict network migration mode to techpreview #1560

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions config/v1/feature_gates.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,16 @@ var (
OwningProduct: ocpSpecific,
}

FeatureGateNetworkLiveMigration = FeatureGateName("NetworkLiveMigration")
sdnLiveMigration = FeatureGateDescription{
FeatureGateAttributes: FeatureGateAttributes{
Name: FeatureGateNetworkLiveMigration,
},
OwningJiraComponent: "Networking/ovn-kubernetes",
ResponsiblePerson: "pliu",
OwningProduct: ocpSpecific,
}

FeatureGateAutomatedEtcdBackup = FeatureGateName("AutomatedEtcdBackup")
automatedEtcdBackup = FeatureGateDescription{
FeatureGateAttributes: FeatureGateAttributes{
Expand Down
1 change: 1 addition & 0 deletions config/v1/types_feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ var FeatureSets = map[FeatureSet]*FeatureGateEnabledDisabled{
with(automatedEtcdBackup).
without(machineAPIOperatorDisableMachineHealthCheckController).
with(adminNetworkPolicy).
with(sdnLiveMigration).
toFeatures(defaultFeatures),
LatencySensitive: newDefaultFeatures().
toFeatures(defaultFeatures),
Expand Down
8 changes: 8 additions & 0 deletions openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -26994,6 +26994,11 @@
"description": "features contains the features migration configuration. Set this to migrate feature configuration when changing the cluster default network provider. if unset, the default operation is to migrate all the configuration of supported features.",
"$ref": "#/definitions/com.github.openshift.api.operator.v1.FeaturesMigration"
},
"mode": {
"description": "mode indicates the mode of network migration. The supported values are \"Live\", \"Offline\" and omitted. A \"Live\" migration operation will not cause service interruption by migrating the CNI of each node one by one. The cluster network will work as normal during the network migration. An \"Offline\" migration operation will cause service interruption. During an \"Offline\" migration, two rounds of node reboots are required. The cluster network will be malfunctioning during the network migration. When omitted, this means no opinion and the platform is left to choose a reasonable default which is subject to change over time. The current default value is \"Offline\".",
"type": "string",
"default": ""
},
"mtu": {
"description": "mtu contains the MTU migration configuration. Set this to allow changing the MTU values for the default network. If unset, the operation of changing the MTU for the default network will be rejected.",
"$ref": "#/definitions/com.github.openshift.api.operator.v1.MTUMigration"
Expand Down

Large diffs are not rendered by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Renaming this file has broken the integration tests, need to update the integration test to point to the new file name

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
api-approved.openshift.io: https://github.com/openshift/api/pull/475
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
release.openshift.io/feature-set: Default
name: networks.operator.openshift.io
spec:
group: operator.openshift.io
Expand Down

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions operator/v1/custom.network.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] Network"
crd: 0000_70_cluster-network-operator_01-Custom.crd.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
crd: 0000_70_cluster-network-operator_01-Custom.crd.yaml
crd: 0000_70_cluster-network-operator_01-CustomNoUpgrade.crd.yaml

tests:
onCreate:
- name: Should be able to create migration mode
initial: |
apiVersion: operator.openshift.io/v1
kind: Network
spec:
migration:
mode: Live
expected: |
apiVersion: operator.openshift.io/v1
kind: Network
spec:
disableNetworkDiagnostics: false
logLevel: Normal
operatorLogLevel: Normal
migration:
mode: Live
16 changes: 15 additions & 1 deletion operator/v1/stable.network.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] Network"
crd: 0000_70_cluster-network-operator_01.crd.yaml
crd: 0000_70_cluster-network-operator_01-Default.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal Network
Expand All @@ -15,3 +15,17 @@ tests:
disableNetworkDiagnostics: false
logLevel: Normal
operatorLogLevel: Normal
- name: Should not be able to create migration mode
initial: |
apiVersion: operator.openshift.io/v1
kind: Network
spec:
migration:
mode: Live
expected: |
apiVersion: operator.openshift.io/v1
kind: Network
spec:
disableNetworkDiagnostics: false
logLevel: Normal
operatorLogLevel: Normal
21 changes: 21 additions & 0 deletions operator/v1/techpreview.network.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] Network"
crd: 0000_70_cluster-network-operator_01-TechPreviewNoUpgrade.crd.yaml
tests:
onCreate:
- name: Should be able to create migration mode
initial: |
apiVersion: operator.openshift.io/v1
kind: Network
spec:
migration:
mode: Live
expected: |
apiVersion: operator.openshift.io/v1
kind: Network
spec:
disableNetworkDiagnostics: false
logLevel: Normal
operatorLogLevel: Normal
migration:
mode: Live
23 changes: 23 additions & 0 deletions operator/v1/types_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,20 @@ type NetworkSpec struct {
Migration *NetworkMigration `json:"migration,omitempty"`
}

// NetworkMigrationMode is an enumeration of the possible mode of the network migration
// Valid values are "Live" or "Offline".
// +kubebuilder:validation:Enum:="";Live;Offline
type NetworkMigrationMode string

const (
// A "Live" migration operation will not cause service interruption by migrating the CNI of each node one by one. The cluster network will work as normal during the network migration.
LiveNetworkMigrationMode NetworkMigrationMode = "Live"
// An "Offline" migration operation will cause service interruption. During an "Offline" migration, two rounds of node reboots are required. The cluster network will be malfunctioning during the network migration.
OfflineNetworkMigrationMode NetworkMigrationMode = "Offline"
)

// NetworkMigration represents the cluster network configuration.
// +openshift:validation:FeatureSetAwareXValidation:featureSet=CustomNoUpgrade;TechPreviewNoUpgrade,rule="!has(self.mtu) || !has(self.mode) || self.mode == ”",message="migration mode may not be configured at the same time as an mtu migration"
type NetworkMigration struct {
// networkType is the target type of network migration. Set this to the
// target network type to allow changing the default network. If unset, the
Expand All @@ -137,6 +150,16 @@ type NetworkMigration struct {
// supported features.
// +optional
Features *FeaturesMigration `json:"features,omitempty"`

// mode indicates the mode of network migration.
// The supported values are "Live", "Offline" and omitted.
// A "Live" migration operation will not cause service interruption by migrating the CNI of each node one by one. The cluster network will work as normal during the network migration.
// An "Offline" migration operation will cause service interruption. During an "Offline" migration, two rounds of node reboots are required. The cluster network will be malfunctioning during the network migration.
// When omitted, this means no opinion and the platform is left to choose a reasonable default which is subject to change over time.
// The current default value is "Offline".
// +openshift:enable:FeatureSets=CustomNoUpgrade;TechPreviewNoUpgrade
// +optional
Mode NetworkMigrationMode `json:"mode"`
}

type FeaturesMigration struct {
Expand Down
1 change: 1 addition & 0 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.