Skip to content

Commit dd6e27f

Browse files
Merge pull request openstack-k8s-operators#2177 from rabi/bootc_images
Add osBootcContainerImage and per-NodeSet osImageType selection
2 parents 14d36c5 + 8aee755 commit dd6e27f

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
@@ -19545,6 +19545,8 @@ spec:
1954519545
type: string
1954619546
openstackNetworkExporterImage:
1954719547
type: string
19548+
osBootcContainerImage:
19549+
type: string
1954819550
osContainerImage:
1954919551
type: string
1955019552
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
@@ -20574,6 +20574,8 @@ spec:
2057420574
type: string
2057520575
openstackNetworkExporterImage:
2057620576
type: string
20577+
osBootcContainerImage:
20578+
type: string
2057720579
osContainerImage:
2057820580
type: string
2057920581
ovnControllerImage:
@@ -22420,6 +22422,16 @@ spec:
2242022422
Nodes - Map of Node Names and node specific data. Values here override defaults in the
2242122423
upper level section.
2242222424
type: object
22425+
osImageType:
22426+
default: uefi
22427+
description: |-
22428+
OSImageType selects the OS image flavor for this NodeSet's baremetal hosts.
22429+
"uefi" (default) selects the UEFI self-extracting image, "bootc" selects the
22430+
bootc qcow2 self-extracting image.
22431+
enum:
22432+
- uefi
22433+
- bootc
22434+
type: string
2242322435
preProvisioned:
2242422436
description: PreProvisioned - Set to true if the nodes have been Pre
2242522437
Provisioned.
@@ -23190,6 +23202,8 @@ spec:
2319023202
type: string
2319123203
openstackNetworkExporterImage:
2319223204
type: string
23205+
osBootcContainerImage:
23206+
type: string
2319323207
osContainerImage:
2319423208
type: string
2319523209
ovnControllerImage:
@@ -23440,6 +23454,8 @@ spec:
2344023454
type: string
2344123455
openstackNetworkExporterImage:
2344223456
type: string
23457+
osBootcContainerImage:
23458+
type: string
2344323459
osContainerImage:
2344423460
type: string
2344523461
ovnControllerImage:
@@ -23646,6 +23662,8 @@ spec:
2364623662
type: string
2364723663
openstackNetworkExporterImage:
2364823664
type: string
23665+
osBootcContainerImage:
23666+
type: string
2364923667
osContainerImage:
2365023668
type: string
2365123669
ovnControllerImage:
@@ -23872,6 +23890,8 @@ spec:
2387223890
type: string
2387323891
openstackNetworkExporterImage:
2387423892
type: string
23893+
osBootcContainerImage:
23894+
type: string
2387523895
osContainerImage:
2387623896
type: string
2387723897
ovnControllerImage:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19545,6 +19545,8 @@ spec:
1954519545
type: string
1954619546
openstackNetworkExporterImage:
1954719547
type: string
19548+
osBootcContainerImage:
19549+
type: string
1954819550
osContainerImage:
1954919551
type: string
1955019552
ovnControllerImage:

0 commit comments

Comments
 (0)