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

feat OCM-12069 | add class and resources for cluster migrations #1013

Merged
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
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This document describes the relevant changes between releases of the API model.

## 0.0.407 Jan 17 2025
- Add `ClusterMigration` type
- Add `ClusterMigration` resources

## 0.0.406 Dec 18 2024
- Expose the GCP Shielded VM secure boot setting at the machine pool level

Expand Down
23 changes: 23 additions & 0 deletions model/clusters_mgmt/v1/cluster_migration_resource.model
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright (c) 2025 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Manages a specific cluster migration.
resource ClusterMigration {
// Retrieves the details of the cluster migration.
method Get {
out Body ClusterMigration
}
}
27 changes: 27 additions & 0 deletions model/clusters_mgmt/v1/cluster_migration_state_type.model
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Copyright (c) 2025 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// The state of the cluster migration.
enum ClusterMigrationState {
@json(name = "scheduled")
Scheduled

@json(name = "in progress")
InProgress

@json(name = "completed")
Completed
}
40 changes: 40 additions & 0 deletions model/clusters_mgmt/v1/cluster_migration_type.model
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
Copyright (c) 2025 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Representation of a cluster migration.
class ClusterMigration {
// Internal cluster ID.
ClusterID string

// Type of cluster migration. The rest of the attributes will be populated according to this
// value. For example, if the type is `sdnToOvn` then only the `SdnToOvn` attribute will be
// populated.
Type ClusterMigrationType

// The state of the cluster migration.
State ClusterMigrationState

// Details for `SdnToOvn` cluster migrations.
SdnToOvn SdnToOvnClusterMigration

// Date and time when the cluster migration was initially created, using the
// format defined in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt).
CreationTimestamp Date

// Date and time when the cluster migration was last updated, using the
// format defined in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt).
UpdatedTimestamp Date
}
21 changes: 21 additions & 0 deletions model/clusters_mgmt/v1/cluster_migration_type_type.model
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Copyright (c) 2025 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Type of cluster migration.
enum ClusterMigrationType {
@json(name = "SdnToOvnClusterMigration")
SdnToOvn
}
46 changes: 46 additions & 0 deletions model/clusters_mgmt/v1/cluster_migrations_resource.model
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright (c) 2025 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Manages the collection of cluster migrations of a cluster.
resource ClusterMigrations {
method List {
// Index of the returned page, where one corresponds to the first page.
in out Page Integer = 1
gdbranco marked this conversation as resolved.
Show resolved Hide resolved

// Number of items that will be contained in the returned page.
in out Size Integer = 100
gdbranco marked this conversation as resolved.
Show resolved Hide resolved

// Total number of items of the collection that match the search criteria,
// regardless of the size of the page. As this collection doesn't support paging or
// searching the result will always be the total number of migrations of the cluster.
out Total Integer

// Retrieved list of cluster migrations.
out Items []ClusterMigration
}

// Adds a cluster migration to the database.
method Add {
// Description of the cluster migration.
in out Body ClusterMigration
}

// Returns a reference to the service that manages a specific cluster migration.
locator Migration {
target ClusterMigration
variable ID
}
}
4 changes: 4 additions & 0 deletions model/clusters_mgmt/v1/cluster_resource.model
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,8 @@ resource Cluster {
locator KubeletConfig {
target KubeletConfig
}

locator Migrations {
target ClusterMigrations
}
}
30 changes: 30 additions & 0 deletions model/clusters_mgmt/v1/sdn_to_ovn_cluster_migration_type.model
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright (c) 2025 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Details for `SdnToOvn` cluster migrations.
struct SdnToOvnClusterMigration {
// The IP address range to use for the internalTransSwitchSubnet parameter of OVN-Kubernetes
// upon migration.
TransitIpv4 String

// The IP address range to use for the internalJoinSubnet parameter of OVN-Kubernetes
// upon migration.
JoinIpv4 String

// The IP address range to us for the internalMasqueradeSubnet parameter of OVN-Kubernetes
// upon migration.
MasqueradeIpv4 String
}
Loading