Skip to content

Commit 8aee755

Browse files
committed
Add osBootcContainerImage and per-NodeSet osImageType selection
Support a second EDPM OS container image (bootc) alongside the existing uefi image for dataplane provisioning. - Add osBootcContainerImage to OpenStackVersion and RELATED_IMAGE env default. - Add osImageType (uefi|bootc, default uefi) to OpenStackDataPlaneNodeSet. - selectOSImage() in the dataplane controller picks the image that fills OpenStackBaremetalSet.spec.osContainerImageUrl based on the NodeSet osImageType. - Derive the bootc update image for inventory rather than adding a new image field as we won't need it when we move to use bootc deploy interface. Jira: https://issues.redhat.com/browse/OSPRH-14326 Signed-off-by: Rabi Mishra <ramishra@redhat.com>
1 parent c96747f commit 8aee755

19 files changed

Lines changed: 290 additions & 51 deletions

‎api/bases/core.openstack.org_openstackcontrolplanes.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19525,6 +19525,8 @@ spec:
1952519525
type: string
1952619526
openstackNetworkExporterImage:
1952719527
type: string
19528+
osBootcContainerImage:
19529+
type: string
1952819530
osContainerImage:
1952919531
type: string
1953019532
ovnControllerImage:

‎api/bases/core.openstack.org_openstackversions.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ spec:
203203
type: string
204204
openstackNetworkExporterImage:
205205
type: string
206+
osBootcContainerImage:
207+
type: string
206208
osContainerImage:
207209
type: string
208210
ovnControllerImage:
@@ -453,6 +455,8 @@ spec:
453455
type: string
454456
openstackNetworkExporterImage:
455457
type: string
458+
osBootcContainerImage:
459+
type: string
456460
osContainerImage:
457461
type: string
458462
ovnControllerImage:
@@ -659,6 +663,8 @@ spec:
659663
type: string
660664
openstackNetworkExporterImage:
661665
type: string
666+
osBootcContainerImage:
667+
type: string
662668
osContainerImage:
663669
type: string
664670
ovnControllerImage:
@@ -885,6 +891,8 @@ spec:
885891
type: string
886892
openstackNetworkExporterImage:
887893
type: string
894+
osBootcContainerImage:
895+
type: string
888896
osContainerImage:
889897
type: string
890898
ovnControllerImage:

‎api/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,16 @@ spec:
14531453
Nodes - Map of Node Names and node specific data. Values here override defaults in the
14541454
upper level section.
14551455
type: object
1456+
osImageType:
1457+
default: uefi
1458+
description: |-
1459+
OSImageType selects the OS image flavor for this NodeSet's baremetal hosts.
1460+
"uefi" (default) selects the UEFI self-extracting image, "bootc" selects the
1461+
bootc qcow2 self-extracting image.
1462+
enum:
1463+
- uefi
1464+
- bootc
1465+
type: string
14561466
preProvisioned:
14571467
description: PreProvisioned - Set to true if the nodes have been Pre
14581468
Provisioned.

‎api/core/v1beta1/openstackversion_types.go‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ type ContainerTemplate struct {
239239
EdpmOvnBgpAgentImage *string `json:"edpmOvnBgpAgentImage,omitempty"`
240240
EdpmNodeExporterImage *string `json:"edpmNodeExporterImage,omitempty"`
241241
// Deprecated: EdpmKeplerImage is no longer used. Kepler has been removed from the telemetry stack.
242-
EdpmKeplerImage *string `json:"edpmKeplerImage,omitempty"`
243-
EdpmPodmanExporterImage *string `json:"edpmPodmanExporterImage,omitempty"`
242+
EdpmKeplerImage *string `json:"edpmKeplerImage,omitempty"`
243+
EdpmPodmanExporterImage *string `json:"edpmPodmanExporterImage,omitempty"`
244244
// Deprecated: Use OpenstackNetworkExporterImage instead
245245
EdpmOpenstackNetworkExporterImage *string `json:"edpmOpenstackNetworkExporterImage,omitempty"`
246246
OpenstackNetworkExporterImage *string `json:"openstackNetworkExporterImage,omitempty"`
@@ -278,6 +278,7 @@ type ContainerTemplate struct {
278278
OpenstackClientImage *string `json:"openstackClientImage,omitempty"`
279279
OpenstackMcpImage *string `json:"openstackMcpImage,omitempty"`
280280
OsContainerImage *string `json:"osContainerImage,omitempty"` //fixme wire this in?
281+
OsBootcContainerImage *string `json:"osBootcContainerImage,omitempty"`
281282
OvnControllerImage *string `json:"ovnControllerImage,omitempty"`
282283
OvnControllerOvsImage *string `json:"ovnControllerOvsImage,omitempty"`
283284
OvnNbDbclusterImage *string `json:"ovnNbDbclusterImage,omitempty"`
@@ -302,13 +303,13 @@ type ContainerTemplate struct {
302303
// ServiceDefaults - struct that contains defaults for OSP services that can change over time
303304
// but are associated with a specific OpenStack release version
304305
type ServiceDefaults struct {
305-
GlanceWsgi *string `json:"glanceWsgi,omitempty"`
306-
RabbitmqVersion *string `json:"rabbitmqVersion,omitempty"`
307-
MariadbVersion *string `json:"mariadbVersion,omitempty"`
308-
GlanceLocationAPI *string `json:"glanceLocationAPI,omitempty"`
309-
ManilaSharev1 *string `json:"manilaSharev1,omitempty"`
310-
NeutronWsgi *string `json:"neutronWsgi,omitempty"`
311-
IronicInspectInterface *string `json:"ironicInspectInterface,omitempty"`
306+
GlanceWsgi *string `json:"glanceWsgi,omitempty"`
307+
RabbitmqVersion *string `json:"rabbitmqVersion,omitempty"`
308+
MariadbVersion *string `json:"mariadbVersion,omitempty"`
309+
GlanceLocationAPI *string `json:"glanceLocationAPI,omitempty"`
310+
ManilaSharev1 *string `json:"manilaSharev1,omitempty"`
311+
NeutronWsgi *string `json:"neutronWsgi,omitempty"`
312+
IronicInspectInterface *string `json:"ironicInspectInterface,omitempty"`
312313
OVNHardenedOVSSecurityContext *string `json:"ovnHardenedOVSSecurityContext,omitempty"`
313314
}
314315

‎api/core/v1beta1/zz_generated.deepcopy.go‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/dataplane/v1beta1/openstackdataplanenodeset_types.go‎

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,30 @@ import (
3333
"k8s.io/apimachinery/pkg/util/validation/field"
3434
)
3535

36+
// OSImageType selects which OS image flavor is used for a NodeSet's baremetal hosts
37+
type OSImageType string
38+
39+
const (
40+
// OSImageTypeUEFI selects the UEFI self-extracting OS image (default)
41+
OSImageTypeUEFI OSImageType = "uefi"
42+
// OSImageTypeBootc selects the bootc qcow2 self-extracting OS image
43+
OSImageTypeBootc OSImageType = "bootc"
44+
)
45+
3646
// OpenStackDataPlaneNodeSetSpec defines the desired state of OpenStackDataPlaneNodeSet
3747
type OpenStackDataPlaneNodeSetSpec struct {
3848
// +kubebuilder:validation:Optional
3949
// BaremetalSetTemplate Template for BaremetalSet for the NodeSet
4050
BaremetalSetTemplate *baremetalv1.OpenStackBaremetalSetTemplateSpec `json:"baremetalSetTemplate,omitempty"`
4151

52+
// +kubebuilder:validation:Optional
53+
// +kubebuilder:validation:Enum=uefi;bootc
54+
// +kubebuilder:default=uefi
55+
// OSImageType selects the OS image flavor for this NodeSet's baremetal hosts.
56+
// "uefi" (default) selects the UEFI self-extracting image, "bootc" selects the
57+
// bootc qcow2 self-extracting image.
58+
OSImageType OSImageType `json:"osImageType"`
59+
4260
// +kubebuilder:validation:Required
4361
// NodeTemplate - node attributes specific to nodes defined by this resource. These
4462
// attributes can be overriden at the individual node level, else take their defaults
@@ -230,31 +248,32 @@ func (instance OpenStackDataPlaneNodeSet) GetAnsibleEESpec() AnsibleEESpec {
230248
// if no values are set elsewhere.
231249
var ContainerImageDefaults = openstackv1.ContainerImages{
232250
ContainerTemplate: openstackv1.ContainerTemplate{
233-
AgentImage: getStrPtr("quay.io/openstack-k8s-operators/openstack-baremetal-operator-agent:current-podified"),
234-
AnsibleeeImage: getStrPtr("quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest"),
235-
ApacheImage: getStrPtr("registry.redhat.io/ubi10/httpd-24:latest"),
236-
EdpmFrrImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-frr:master-latest"),
251+
AgentImage: getStrPtr("quay.io/openstack-k8s-operators/openstack-baremetal-operator-agent:current-podified"),
252+
AnsibleeeImage: getStrPtr("quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest"),
253+
ApacheImage: getStrPtr("registry.redhat.io/ubi10/httpd-24:latest"),
254+
EdpmFrrImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-frr:master-latest"),
237255
// Deprecated: EdpmIscsidImage is no longer used. iscsid now runs on the host instead of in a container.
238256
EdpmIscsidImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-iscsid:current-podified"),
239257
// Deprecated: EdpmLogrotateCrondImage is no longer used. logrotate-crond has been removed.
240-
EdpmLogrotateCrondImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-cron:current-podified"),
258+
EdpmLogrotateCrondImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-cron:current-podified"),
241259
EdpmNeutronDhcpAgentImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-neutron-dhcp-agent:master-latest"),
242260
EdpmNeutronMetadataAgentImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-neutron-metadata-agent-ovn:master-latest"),
243261
EdpmNeutronOvnAgentImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-neutron-ovn-agent:master-latest"),
244-
EdpmNeutronSriovAgentImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-neutron-sriov-agent:master-latest"),
262+
EdpmNeutronSriovAgentImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-neutron-sriov-agent:master-latest"),
245263
// Deprecated: EdpmMultipathdImage is no longer used. multipathd now runs on the host instead of in a container.
246-
EdpmMultipathdImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-multipathd:current-podified"),
247-
NovaComputeImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-nova-compute:master-latest"),
248-
OvnControllerImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-ovn-controller:master-latest"),
249-
EdpmOvnBgpAgentImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified"),
250-
CeilometerComputeImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-ceilometer-compute:master-latest"),
251-
CeilometerIpmiImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-ceilometer-compute:master-latest"),
252-
EdpmNodeExporterImage: getStrPtr("quay.io/prometheus/node-exporter:v1.5.0"),
264+
EdpmMultipathdImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-multipathd:current-podified"),
265+
NovaComputeImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-nova-compute:master-latest"),
266+
OvnControllerImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-ovn-controller:master-latest"),
267+
EdpmOvnBgpAgentImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified"),
268+
CeilometerComputeImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-ceilometer-compute:master-latest"),
269+
CeilometerIpmiImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-ceilometer-compute:master-latest"),
270+
EdpmNodeExporterImage: getStrPtr("quay.io/prometheus/node-exporter:v1.5.0"),
253271
// Deprecated: EdpmKeplerImage is no longer used. Kepler has been removed from the telemetry stack.
254272
EdpmKeplerImage: getStrPtr("quay.io/sustainable_computing_io/kepler:release-0.7.12"),
255273
EdpmPodmanExporterImage: getStrPtr("quay.io/openstack-k8s-operators/prometheus-podman-exporter:latest"),
256274
OpenstackNetworkExporterImage: getStrPtr("quay.io/openstack-k8s-operators/openstack-network-exporter:current-podified"),
257275
OsContainerImage: getStrPtr("quay.io/podified-antelope-centos9/edpm-hardened-uefi:current-podified"),
276+
OsBootcContainerImage: getStrPtr("quay.io/openstack-k8s-operators/edpm-bootc:latest-qcow2"),
258277
SwiftAccountImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-swift-account:master-latest"),
259278
SwiftContainerImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-swift-container:master-latest"),
260279
SwiftObjectImage: getStrPtr("quay.io/openstack-s2i-containers/openstack-swift-object:master-latest"),
@@ -270,16 +289,16 @@ func SetupDefaults() {
270289
// Acquire environmental defaults and initialize dataplane defaults with them
271290
ContainerImages = openstackv1.ContainerImages{
272291
ContainerTemplate: openstackv1.ContainerTemplate{
273-
AgentImage: getImageDefault("RELATED_IMAGE_AGENT_IMAGE_URL_DEFAULT", ContainerImageDefaults.AgentImage),
274-
AnsibleeeImage: getImageDefault("RELATED_IMAGE_ANSIBLEEE_IMAGE_URL_DEFAULT", ContainerImageDefaults.AnsibleeeImage),
275-
ApacheImage: getImageDefault("RELATED_IMAGE_APACHE_IMAGE_URL_DEFAULT", ContainerImageDefaults.ApacheImage),
276-
EdpmFrrImage: getImageDefault("RELATED_IMAGE_EDPM_FRR_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmFrrImage),
292+
AgentImage: getImageDefault("RELATED_IMAGE_AGENT_IMAGE_URL_DEFAULT", ContainerImageDefaults.AgentImage),
293+
AnsibleeeImage: getImageDefault("RELATED_IMAGE_ANSIBLEEE_IMAGE_URL_DEFAULT", ContainerImageDefaults.AnsibleeeImage),
294+
ApacheImage: getImageDefault("RELATED_IMAGE_APACHE_IMAGE_URL_DEFAULT", ContainerImageDefaults.ApacheImage),
295+
EdpmFrrImage: getImageDefault("RELATED_IMAGE_EDPM_FRR_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmFrrImage),
277296
// Deprecated: EdpmIscsidImage is no longer used. iscsid now runs on the host instead of in a container.
278297
EdpmIscsidImage: getImageDefault("RELATED_IMAGE_EDPM_ISCSID_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmIscsidImage),
279298
// Deprecated: EdpmLogrotateCrondImage is no longer used. logrotate-crond has been removed.
280299
EdpmLogrotateCrondImage: getImageDefault("RELATED_IMAGE_EDPM_LOGROTATE_CROND_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmLogrotateCrondImage),
281300
// Deprecated: EdpmMultipathdImage is no longer used. multipathd now runs on the host instead of in a container.
282-
EdpmMultipathdImage: getImageDefault("RELATED_IMAGE_EDPM_MULTIPATHD_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmMultipathdImage),
301+
EdpmMultipathdImage: getImageDefault("RELATED_IMAGE_EDPM_MULTIPATHD_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmMultipathdImage),
283302
EdpmNeutronDhcpAgentImage: getImageDefault("RELATED_IMAGE_EDPM_NEUTRON_DHCP_AGENT_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmNeutronDhcpAgentImage),
284303
EdpmNeutronMetadataAgentImage: getImageDefault("RELATED_IMAGE_EDPM_NEUTRON_METADATA_AGENT_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmNeutronMetadataAgentImage),
285304
EdpmNeutronOvnAgentImage: getImageDefault("RELATED_IMAGE_EDPM_NEUTRON_OVN_AGENT_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmNeutronOvnAgentImage),
@@ -295,6 +314,7 @@ func SetupDefaults() {
295314
NovaComputeImage: getImageDefault("RELATED_IMAGE_NOVA_COMPUTE_IMAGE_URL_DEFAULT", ContainerImageDefaults.NovaComputeImage),
296315
OvnControllerImage: getImageDefault("RELATED_IMAGE_OVN_CONTROLLER_IMAGE_URL_DEFAULT", ContainerImageDefaults.OvnControllerImage),
297316
OsContainerImage: getImageDefault("RELATED_IMAGE_OS_CONTAINER_IMAGE_URL_DEFAULT", ContainerImageDefaults.OsContainerImage),
317+
OsBootcContainerImage: getImageDefault("RELATED_IMAGE_OS_BOOTC_CONTAINER_IMAGE_URL_DEFAULT", ContainerImageDefaults.OsBootcContainerImage),
298318
SwiftAccountImage: getImageDefault("RELATED_IMAGE_SWIFT_ACCOUNT_IMAGE_URL_DEFAULT", ContainerImageDefaults.SwiftAccountImage),
299319
SwiftContainerImage: getImageDefault("RELATED_IMAGE_SWIFT_CONTAINER_IMAGE_URL_DEFAULT", ContainerImageDefaults.SwiftContainerImage),
300320
SwiftObjectImage: getImageDefault("RELATED_IMAGE_SWIFT_OBJECT_IMAGE_URL_DEFAULT", ContainerImageDefaults.SwiftObjectImage),

‎api/dataplane/v1beta1/openstackdataplanenodeset_webhook.go‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,23 @@ func (spec *OpenStackDataPlaneNodeSetSpec) ValidateUpdate(oldSpec *OpenStackData
205205
}
206206
}
207207

208+
// osImageType is immutable once the NodeSet is created (change would make
209+
// already-provisioned hosts inconsistent on re-provision). NodeSets created
210+
// before the field existed have an empty value, which defaults to uefi.
211+
oldOSImageType := oldSpec.OSImageType
212+
if oldOSImageType == "" {
213+
oldOSImageType = OSImageTypeUEFI
214+
}
215+
newOSImageType := spec.OSImageType
216+
if newOSImageType == "" {
217+
newOSImageType = OSImageTypeUEFI
218+
}
219+
if newOSImageType != oldOSImageType {
220+
errors = append(errors, field.Forbidden(
221+
field.NewPath("spec", "osImageType"),
222+
fmt.Sprintf("osImageType is immutable once set: cannot change from %q to %q. Create a new NodeSet with the desired osImageType instead", oldOSImageType, newOSImageType)))
223+
}
224+
208225
return errors
209226
}
210227

‎bindata/crds/crds.yaml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20554,6 +20554,8 @@ spec:
2055420554
type: string
2055520555
openstackNetworkExporterImage:
2055620556
type: string
20557+
osBootcContainerImage:
20558+
type: string
2055720559
osContainerImage:
2055820560
type: string
2055920561
ovnControllerImage:
@@ -22400,6 +22402,16 @@ spec:
2240022402
Nodes - Map of Node Names and node specific data. Values here override defaults in the
2240122403
upper level section.
2240222404
type: object
22405+
osImageType:
22406+
default: uefi
22407+
description: |-
22408+
OSImageType selects the OS image flavor for this NodeSet's baremetal hosts.
22409+
"uefi" (default) selects the UEFI self-extracting image, "bootc" selects the
22410+
bootc qcow2 self-extracting image.
22411+
enum:
22412+
- uefi
22413+
- bootc
22414+
type: string
2240322415
preProvisioned:
2240422416
description: PreProvisioned - Set to true if the nodes have been Pre
2240522417
Provisioned.
@@ -23170,6 +23182,8 @@ spec:
2317023182
type: string
2317123183
openstackNetworkExporterImage:
2317223184
type: string
23185+
osBootcContainerImage:
23186+
type: string
2317323187
osContainerImage:
2317423188
type: string
2317523189
ovnControllerImage:
@@ -23420,6 +23434,8 @@ spec:
2342023434
type: string
2342123435
openstackNetworkExporterImage:
2342223436
type: string
23437+
osBootcContainerImage:
23438+
type: string
2342323439
osContainerImage:
2342423440
type: string
2342523441
ovnControllerImage:
@@ -23626,6 +23642,8 @@ spec:
2362623642
type: string
2362723643
openstackNetworkExporterImage:
2362823644
type: string
23645+
osBootcContainerImage:
23646+
type: string
2362923647
osContainerImage:
2363023648
type: string
2363123649
ovnControllerImage:
@@ -23852,6 +23870,8 @@ spec:
2385223870
type: string
2385323871
openstackNetworkExporterImage:
2385423872
type: string
23873+
osBootcContainerImage:
23874+
type: string
2385523875
osContainerImage:
2385623876
type: string
2385723877
ovnControllerImage:

‎config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19525,6 +19525,8 @@ spec:
1952519525
type: string
1952619526
openstackNetworkExporterImage:
1952719527
type: string
19528+
osBootcContainerImage:
19529+
type: string
1952819530
osContainerImage:
1952919531
type: string
1953019532
ovnControllerImage:

0 commit comments

Comments
 (0)