Skip to content

Commit f40d7d5

Browse files
Merge pull request #354 from mumesan/osprh-11617
Pass bootable image URL to metal3 <JIRA: OSPRH-11617>
2 parents 6890507 + 4444196 commit f40d7d5

File tree

8 files changed

+304
-112
lines changed

8 files changed

+304
-112
lines changed

api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ spec:
5555
properties:
5656
agentImageUrl:
5757
description: AgentImageURL - Container image URL for the sidecar container
58-
that discovers provisioning network IPs
58+
that discovers provisioning network IPs. Ignored when osImageDeploymentType
59+
is PassThrough.
5960
type: string
6061
apacheImageUrl:
6162
description: ApacheImageURL - Container image URL for the main container
62-
that serves the downloaded OS qcow2 image (osImage)
63+
that serves the downloaded OS qcow2 image (osImage). Ignored when
64+
osImageDeploymentType is PassThrough.
6365
type: string
6466
automatedCleaningMode:
6567
default: metadata
@@ -282,12 +284,23 @@ spec:
282284
type: object
283285
type: object
284286
osContainerImageUrl:
285-
description: OSContainerImageURL - Container image URL for init with
286-
the OS qcow2 image (osImage)
287+
description: OSContainerImageURL - When osImageDeploymentType is SelfExtracting,
288+
container image URL for init with the OS qcow2 image (osImage).
289+
When osImageDeploymentType is PassThrough this can be any image
290+
URL which the underlying Metal3 instance supports.
287291
type: string
288292
osImage:
289293
default: edpm-hardened-uefi.qcow2
290-
description: OSImage - OS qcow2 image Name
294+
description: OSImage - OS qcow2 image Name. Ignored when osImageDeploymentType
295+
is PassThrough.
296+
type: string
297+
osImageDeploymentType:
298+
default: SelfExtracting
299+
description: OSImageDeploymentType - Whether the OS image deployment
300+
is self-extracting or pass-through based
301+
enum:
302+
- SelfExtracting
303+
- PassThrough
291304
type: string
292305
passwordSecret:
293306
description: |-
@@ -307,18 +320,21 @@ spec:
307320
x-kubernetes-map-type: atomic
308321
provisionServerName:
309322
description: ProvisionServerName - Optional. Existing OpenStackProvisionServer
310-
to use, else one would be created.
323+
to use, else one would be created. Ignored when osImageDeploymentType
324+
is PassThrough.
311325
type: string
312326
provisionServerNodeSelector:
313327
additionalProperties:
314328
type: string
315329
description: ProvisonServerNodeSelector to target subset of worker
316-
nodes running provision server
330+
nodes running provision server, ignored when osImageDeploymentType
331+
is PassThrough.
317332
type: object
318333
provisioningInterface:
319334
description: ProvisioningInterface - Optional. If not provided along
320335
with ProvisionServerName, it would be discovered from CBO. This
321-
is the provisioning interface on the OCP masters/workers.
336+
is the provisioning interface on the OCP masters/workers. Ignored
337+
when osImageDeploymentType is PassThrough.
322338
type: string
323339
required:
324340
- cloudUserName

api/v1beta1/openstackbaremetalset_types.go

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ type BondConfig struct {
3939
BondOptions map[string]string `json:"bondOptions,omitempty"`
4040
}
4141

42+
// OSImageDeploymentType specifies the type of OS image deployment
43+
// +kubebuilder:validation:Enum=SelfExtracting;PassThrough
44+
type OSImageDeploymentType string
45+
4246
// InstanceSpec Instance specific attributes
4347
type InstanceSpec struct {
4448
// +kubebuilder:validation:Optional
@@ -71,32 +75,42 @@ const (
7175
CleaningModeMetadata AutomatedCleaningMode = "metadata"
7276
)
7377

78+
// Allowed OS image deployment types
79+
const (
80+
OSImageDeploymentTypeSelfExtracting OSImageDeploymentType = "SelfExtracting"
81+
OSImageDeploymentTypePassThrough OSImageDeploymentType = "PassThrough"
82+
)
83+
7484
type OpenStackBaremetalSetTemplateSpec struct {
7585
// +kubebuilder:validation:Optional
7686
// +kubebuilder:default=edpm-hardened-uefi.qcow2
77-
// OSImage - OS qcow2 image Name
87+
// OSImage - OS qcow2 image Name. Ignored when osImageDeploymentType is PassThrough.
7888
OSImage string `json:"osImage"`
7989
// +kubebuilder:validation:Optional
80-
// OSContainerImageURL - Container image URL for init with the OS qcow2 image (osImage)
90+
// OSContainerImageURL - When osImageDeploymentType is SelfExtracting, container image URL for init with the OS qcow2 image (osImage). When osImageDeploymentType is PassThrough this can be any image URL which the underlying Metal3 instance supports.
8191
OSContainerImageURL string `json:"osContainerImageUrl,omitempty"`
8292
// +kubebuilder:validation:Optional
83-
// ApacheImageURL - Container image URL for the main container that serves the downloaded OS qcow2 image (osImage)
93+
// +kubebuilder:default=SelfExtracting
94+
// OSImageDeploymentType - Whether the OS image deployment is self-extracting or pass-through based
95+
OSImageDeploymentType OSImageDeploymentType `json:"osImageDeploymentType"`
96+
// +kubebuilder:validation:Optional
97+
// ApacheImageURL - Container image URL for the main container that serves the downloaded OS qcow2 image (osImage). Ignored when osImageDeploymentType is PassThrough.
8498
ApacheImageURL string `json:"apacheImageUrl,omitempty"`
8599
// +kubebuilder:validation:Optional
86-
// AgentImageURL - Container image URL for the sidecar container that discovers provisioning network IPs
100+
// AgentImageURL - Container image URL for the sidecar container that discovers provisioning network IPs. Ignored when osImageDeploymentType is PassThrough.
87101
AgentImageURL string `json:"agentImageUrl,omitempty"`
88102
// When set to disabled, automated cleaning will be avoided
89103
// during provisioning and deprovisioning.
90104
// +kubebuilder:default=metadata
91105
// +kubebuilder:validation:Optional
92106
AutomatedCleaningMode AutomatedCleaningMode `json:"automatedCleaningMode"`
93-
// ProvisionServerName - Optional. Existing OpenStackProvisionServer to use, else one would be created.
107+
// ProvisionServerName - Optional. Existing OpenStackProvisionServer to use, else one would be created. Ignored when osImageDeploymentType is PassThrough.
94108
// +kubebuilder:validation:Optional
95109
ProvisionServerName string `json:"provisionServerName,omitempty"`
96110
// +kubebuilder:validation:Optional
97-
// ProvisonServerNodeSelector to target subset of worker nodes running provision server
111+
// ProvisonServerNodeSelector to target subset of worker nodes running provision server, ignored when osImageDeploymentType is PassThrough.
98112
ProvisonServerNodeSelector map[string]string `json:"provisionServerNodeSelector,omitempty"`
99-
// ProvisioningInterface - Optional. If not provided along with ProvisionServerName, it would be discovered from CBO. This is the provisioning interface on the OCP masters/workers.
113+
// ProvisioningInterface - Optional. If not provided along with ProvisionServerName, it would be discovered from CBO. This is the provisioning interface on the OCP masters/workers. Ignored when osImageDeploymentType is PassThrough.
100114
// +kubebuilder:validation:Optional
101115
ProvisioningInterface string `json:"provisioningInterface,omitempty"`
102116
// DeploymentSSHSecret - Name of secret holding the cloud-admin ssh keys

config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ spec:
5555
properties:
5656
agentImageUrl:
5757
description: AgentImageURL - Container image URL for the sidecar container
58-
that discovers provisioning network IPs
58+
that discovers provisioning network IPs. Ignored when osImageDeploymentType
59+
is PassThrough.
5960
type: string
6061
apacheImageUrl:
6162
description: ApacheImageURL - Container image URL for the main container
62-
that serves the downloaded OS qcow2 image (osImage)
63+
that serves the downloaded OS qcow2 image (osImage). Ignored when
64+
osImageDeploymentType is PassThrough.
6365
type: string
6466
automatedCleaningMode:
6567
default: metadata
@@ -282,12 +284,23 @@ spec:
282284
type: object
283285
type: object
284286
osContainerImageUrl:
285-
description: OSContainerImageURL - Container image URL for init with
286-
the OS qcow2 image (osImage)
287+
description: OSContainerImageURL - When osImageDeploymentType is SelfExtracting,
288+
container image URL for init with the OS qcow2 image (osImage).
289+
When osImageDeploymentType is PassThrough this can be any image
290+
URL which the underlying Metal3 instance supports.
287291
type: string
288292
osImage:
289293
default: edpm-hardened-uefi.qcow2
290-
description: OSImage - OS qcow2 image Name
294+
description: OSImage - OS qcow2 image Name. Ignored when osImageDeploymentType
295+
is PassThrough.
296+
type: string
297+
osImageDeploymentType:
298+
default: SelfExtracting
299+
description: OSImageDeploymentType - Whether the OS image deployment
300+
is self-extracting or pass-through based
301+
enum:
302+
- SelfExtracting
303+
- PassThrough
291304
type: string
292305
passwordSecret:
293306
description: |-
@@ -307,18 +320,21 @@ spec:
307320
x-kubernetes-map-type: atomic
308321
provisionServerName:
309322
description: ProvisionServerName - Optional. Existing OpenStackProvisionServer
310-
to use, else one would be created.
323+
to use, else one would be created. Ignored when osImageDeploymentType
324+
is PassThrough.
311325
type: string
312326
provisionServerNodeSelector:
313327
additionalProperties:
314328
type: string
315329
description: ProvisonServerNodeSelector to target subset of worker
316-
nodes running provision server
330+
nodes running provision server, ignored when osImageDeploymentType
331+
is PassThrough.
317332
type: object
318333
provisioningInterface:
319334
description: ProvisioningInterface - Optional. If not provided along
320335
with ProvisionServerName, it would be discovered from CBO. This
321-
is the provisioning interface on the OCP masters/workers.
336+
is the provisioning interface on the OCP masters/workers. Ignored
337+
when osImageDeploymentType is PassThrough.
322338
type: string
323339
required:
324340
- cloudUserName

config/samples/baremetal_v1beta1_openstackbaremetalset.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
# SelfExtracting deployment using qcow2
12
apiVersion: baremetal.openstack.org/v1beta1
23
kind: OpenStackBaremetalSet
34
metadata:
4-
name: openstackbaremetalset
5+
name: openstackbaremetalset-selfextracting
56
spec:
67
# Define how many BaremetalHosts are desired to be provisioned and assign
78
# a control plane IP to them
89
baremetalHosts:
910
compute-0: 172.22.0.100/24
1011
compute-1: 172.22.0.101/24
12+
# SelfExtracting Deployment using qcow2
13+
osImageDeploymentType: SelfExtracting
1114
# The image to install on the provisioned nodes
1215
osImage: edpm-hardened-uefi.qcow2
1316
# provisionServerName: openstack # uncomment if you pre-deploy a separate OsProvServer (use its name for the value)
@@ -20,3 +23,25 @@ spec:
2023
# An optional secret holding a data entry called "NodeRootPassword"
2124
# This will be set as the root password on all provisioned BaremetalHosts
2225
passwordSecret: baremetalset-password-secret
26+
27+
---
28+
# PassThrough deployment using direct container URL passing
29+
apiVersion: baremetal.openstack.org/v1beta1
30+
kind: OpenStackBaremetalSet
31+
metadata:
32+
name: openstackbaremetalset-passthrough
33+
spec:
34+
# Define how many BaremetalHosts are desired to be provisioned and assign
35+
# a control plane IP to them
36+
baremetalHosts:
37+
compute-0: 172.22.0.100/24
38+
compute-1: 172.22.0.101/24
39+
# PassThrough deployment using direct container URL passing
40+
osImageDeploymentType: PassThrough
41+
osContainerImageUrl: quay.io/podified-antelope-centos9/edpm-hardened-uefi:current-podified
42+
# The secret containing the SSH pub key to place on the provisioned nodes
43+
deploymentSSHSecret: baremetalset-deploy-secret
44+
domainName: osptest.openstack.org
45+
ctlplaneInterface: enp1s0
46+
ctlplaneGateway: 172.22.0.3
47+
passwordSecret: baremetalset-password-secret

0 commit comments

Comments
 (0)