Skip to content

Commit

Permalink
Expose ProvisionServerNodeSelector in baremetalset spec
Browse files Browse the repository at this point in the history
This would allow selecting OCP nodes with specific networks
to deploy OpenStackProvisionServer and avoid issues like
assymetric routing when OSP networks are configured on
some OCP worker nodes by setting  `provisionServerNodeSelector`
in `baremetalSetTemplate` field of nodeset spec.

At present it's possible to pre-create OpenStackProvisionServer
and use it in `baremetalSetTemplate` of OpenStackDaplaneNodeSet CR.

Jira: https://issues.redhat.com/browse/OSPRH-11665

Signed-off-by: rabi <[email protected]>
  • Loading branch information
rabi committed Nov 15, 2024
1 parent d69076b commit 400f623
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
10 changes: 8 additions & 2 deletions api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,15 @@ spec:
type: object
x-kubernetes-map-type: atomic
provisionServerName:
description: ProvisionServerName - Optional. If supplied will be used
as the base Image for the baremetalset instead of baseImageURL.
description: ProvisionServerName - Optional. Existing OpenStackProvisionServer
to use, else one would be created.
type: string
provisionServerNodeSelector:
additionalProperties:
type: string
description: ProvisonServerNodeSelector to target subset of worker
nodes running provision server
type: object
provisioningInterface:
description: ProvisioningInterface - Optional. If not provided along
with ProvisionServerName, it would be discovered from CBO. This
Expand Down
5 changes: 4 additions & 1 deletion api/v1beta1/openstackbaremetalset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ type OpenStackBaremetalSetSpec struct {
// +kubebuilder:default=metadata
// +kubebuilder:validation:Optional
AutomatedCleaningMode AutomatedCleaningMode `json:"automatedCleaningMode,omitempty"`
// ProvisionServerName - Optional. If supplied will be used as the base Image for the baremetalset instead of baseImageURL.
// ProvisionServerName - Optional. Existing OpenStackProvisionServer to use, else one would be created.
// +kubebuilder:validation:Optional
ProvisionServerName string `json:"provisionServerName,omitempty"`
// +kubebuilder:validation:Optional
// ProvisonServerNodeSelector to target subset of worker nodes running provision server
ProvisonServerNodeSelector map[string]string `json:"provisionServerNodeSelector,omitempty"`
// ProvisioningInterface - Optional. If not provided along with ProvisionServerName, it would be discovered from CBO. This is the provisioning interface on the OCP masters/workers.
// +kubebuilder:validation:Optional
ProvisioningInterface string `json:"provisioningInterface,omitempty"`
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

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
Expand Up @@ -268,9 +268,15 @@ spec:
type: object
x-kubernetes-map-type: atomic
provisionServerName:
description: ProvisionServerName - Optional. If supplied will be used
as the base Image for the baremetalset instead of baseImageURL.
description: ProvisionServerName - Optional. Existing OpenStackProvisionServer
to use, else one would be created.
type: string
provisionServerNodeSelector:
additionalProperties:
type: string
description: ProvisonServerNodeSelector to target subset of worker
nodes running provision server
type: object
provisioningInterface:
description: ProvisioningInterface - Optional. If not provided along
with ProvisionServerName, it would be discovered from CBO. This
Expand Down
1 change: 1 addition & 0 deletions controllers/openstackbaremetalset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ func (r *OpenStackBaremetalSetReconciler) provisionServerCreateOrUpdate(
provisionServer.Spec.OSContainerImageURL = instance.Spec.OSContainerImageURL
provisionServer.Spec.ApacheImageURL = instance.Spec.ApacheImageURL
provisionServer.Spec.AgentImageURL = instance.Spec.AgentImageURL
provisionServer.Spec.NodeSelector = instance.Spec.ProvisonServerNodeSelector
provisionServer.Spec.Interface = instance.Spec.ProvisioningInterface

err = controllerutil.SetControllerReference(instance, provisionServer, helper.GetScheme())
Expand Down

0 comments on commit 400f623

Please sign in to comment.