From 3df7e6458d74036c57824eabe2822649284522e8 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Mon, 12 Feb 2024 14:56:29 +1300 Subject: [PATCH] Expose provision server images in baremetal set This change is proposed so that a custom osContainerImageUrl can be provided in the dataplane spec. This makes it possible to deploy a modified image for purposes including hotfixes and custom hardware. Other container images are also exposed for completeness. --- ...remetal.openstack.org_openstackbaremetalsets.yaml | 12 ++++++++++++ api/v1beta1/openstackbaremetalset_types.go | 9 +++++++++ ...remetal.openstack.org_openstackbaremetalsets.yaml | 12 ++++++++++++ controllers/openstackbaremetalset_controller.go | 3 +++ 4 files changed, 36 insertions(+) diff --git a/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml b/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml index c6214c7..26ad150 100644 --- a/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml +++ b/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml @@ -49,6 +49,14 @@ spec: spec: description: OpenStackBaremetalSetSpec defines the desired state of OpenStackBaremetalSet properties: + agentImageUrl: + description: AgentImageURL - Container image URL for the sidecar container + that discovers provisioning network IPs + type: string + apacheImageUrl: + description: ApacheImageURL - Container image URL for the main container + that serves the downloaded OS qcow2 image (osImage) + type: string automatedCleaningMode: default: metadata description: When set to disabled, automated cleaning will be avoided @@ -247,6 +255,10 @@ spec: type: string type: object x-kubernetes-map-type: atomic + osContainerImageUrl: + description: OSContainerImageURL - Container image URL for init with + the OS qcow2 image (osImage) + type: string osImage: description: OSImage - OS qcow2 image Name type: string diff --git a/api/v1beta1/openstackbaremetalset_types.go b/api/v1beta1/openstackbaremetalset_types.go index 007871e..e2641b2 100644 --- a/api/v1beta1/openstackbaremetalset_types.go +++ b/api/v1beta1/openstackbaremetalset_types.go @@ -54,6 +54,15 @@ type OpenStackBaremetalSetSpec struct { // OSImage - OS qcow2 image Name OSImage string `json:"osImage,omitempty"` // +kubebuilder:validation:Optional + // OSContainerImageURL - Container image URL for init with the OS qcow2 image (osImage) + OSContainerImageURL string `json:"osContainerImageUrl,omitempty"` + // +kubebuilder:validation:Optional + // ApacheImageURL - Container image URL for the main container that serves the downloaded OS qcow2 image (osImage) + ApacheImageURL string `json:"apacheImageUrl,omitempty"` + // +kubebuilder:validation:Optional + // AgentImageURL - Container image URL for the sidecar container that discovers provisioning network IPs + AgentImageURL string `json:"agentImageUrl,omitempty"` + // +kubebuilder:validation:Optional // UserData holds the reference to the Secret containing the user // data to be passed to the host before it boots. UserData can be // set per host in BaremetalHosts or here. If none of these are diff --git a/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml b/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml index c6214c7..26ad150 100644 --- a/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml +++ b/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml @@ -49,6 +49,14 @@ spec: spec: description: OpenStackBaremetalSetSpec defines the desired state of OpenStackBaremetalSet properties: + agentImageUrl: + description: AgentImageURL - Container image URL for the sidecar container + that discovers provisioning network IPs + type: string + apacheImageUrl: + description: ApacheImageURL - Container image URL for the main container + that serves the downloaded OS qcow2 image (osImage) + type: string automatedCleaningMode: default: metadata description: When set to disabled, automated cleaning will be avoided @@ -247,6 +255,10 @@ spec: type: string type: object x-kubernetes-map-type: atomic + osContainerImageUrl: + description: OSContainerImageURL - Container image URL for init with + the OS qcow2 image (osImage) + type: string osImage: description: OSImage - OS qcow2 image Name type: string diff --git a/controllers/openstackbaremetalset_controller.go b/controllers/openstackbaremetalset_controller.go index e044679..e9ca752 100644 --- a/controllers/openstackbaremetalset_controller.go +++ b/controllers/openstackbaremetalset_controller.go @@ -485,6 +485,9 @@ func (r *OpenStackBaremetalSetReconciler) provisionServerCreateOrUpdate( } provisionServer.Spec.OSImage = instance.Spec.OSImage + provisionServer.Spec.OSContainerImageURL = instance.Spec.OSContainerImageURL + provisionServer.Spec.ApacheImageURL = instance.Spec.ApacheImageURL + provisionServer.Spec.AgentImageURL = instance.Spec.AgentImageURL provisionServer.Spec.Interface = instance.Spec.ProvisioningInterface err = controllerutil.SetControllerReference(instance, provisionServer, helper.GetScheme())