Skip to content

Commit f9af1e3

Browse files
committed
Add DT using BMO / Metal3 provisioning
1 parent 21ece11 commit f9af1e3

31 files changed

+2142
-0
lines changed

automation/vars/bmo.yaml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
vas:
3+
bmo:
4+
stages:
5+
- path: examples/dt/bmo/control-plane/nncp
6+
wait_conditions:
7+
- >-
8+
oc -n openstack wait nncp
9+
-l osp/nncm-config-type=standard
10+
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured
11+
--timeout=5m
12+
values:
13+
- name: network-values
14+
src_file: values.yaml
15+
build_output: nncp.yaml
16+
17+
- pre_stage_run:
18+
- name: Apply cinder-lvm label on master-0
19+
type: cr
20+
definition:
21+
metadata:
22+
labels:
23+
openstack.org/cinder-lvm: ""
24+
kind: Node
25+
resource_name: master-0
26+
state: patched
27+
path: examples/dt/bmo/control-plane
28+
wait_conditions:
29+
- >-
30+
oc -n openstack wait openstackcontrolplane
31+
controlplane
32+
--for condition=Ready
33+
--timeout=60m
34+
values:
35+
- name: network-values
36+
src_file: nncp/values.yaml
37+
- name: service-values
38+
src_file: service-values.yaml
39+
build_output: control-plane.yaml
40+
41+
- pre_stage_run:
42+
- name: Patch Provisioning CR
43+
type: cr
44+
definition:
45+
spec:
46+
watchAllNamespaces: true
47+
virtualMediaViaExternalNetwork: true
48+
namespace: openshift-machine-api
49+
api_version: metal3.io/v1alpha1
50+
kind: Provisioning
51+
resource_name: provisioning-configuration
52+
state: patched
53+
path: examples/dt/bmo/dataplane/baremetalhosts
54+
wait_conditions:
55+
- >-
56+
oc -n openstack wait baremetalhosts.metal3.io
57+
-l app=openstack
58+
--for jsonpath=status.provisioning.state=available
59+
--timeout=10m
60+
values:
61+
- name: baremetalhost-values
62+
src_file: values.yaml
63+
build_output: baremetalhosts.yaml
64+
65+
- path: examples/dt/bmo/dataplane/secrets
66+
wait_conditions:
67+
- >-
68+
oc -n openstack wait secrets dataplane-ansible-ssh-private-key-secret
69+
--for jsonpath=metadata.uid
70+
- >-
71+
oc -n openstack wait secrets nova-migration-ssh-key
72+
--for jsonpath=metadata.uid
73+
values:
74+
- name: secret-values
75+
src_file: values.yaml
76+
build_output: dataplane-secrets.yaml
77+
78+
- path: examples/dt/bmo/dataplane/nodesets
79+
wait_conditions:
80+
- >-
81+
oc -n openstack wait openstackdataplanenodesets
82+
nodeset-0
83+
--for condition=NodeSetBaremetalProvisionReady
84+
--timeout=40m
85+
- >-
86+
oc -n openstack wait openstackdataplanenodesets
87+
nodeset-1
88+
--for condition=NodeSetBaremetalProvisionReady
89+
--timeout=40m
90+
values:
91+
- name: nodeset-values
92+
src_file: values.yaml
93+
build_output: dataplane-nodesets.yaml
94+
95+
- path: examples/dt/bmo/dataplane
96+
wait_conditions:
97+
- >-
98+
oc -n openstack wait openstackdataplanedeployment
99+
edpm-deployment
100+
--for condition=Ready
101+
--timeout=40m
102+
values:
103+
- name: deployment-values
104+
src_file: values.yaml
105+
build_output: edpm.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: metal3.io/v1alpha1
2+
kind: BareMetalHost
3+
metadata:
4+
labels: {}
5+
name: _ignored_
6+
namespace: openstack
7+
spec:
8+
architecture: x86_64
9+
automatedCleaningMode: metadata
10+
bmc: {}
11+
bootMACAddress: _replaced_
12+
bootMode: UEFI
13+
rootDeviceHints: {}
14+
online: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
apiVersion: metal3.io/v1alpha1
3+
kind: BareMetalHost
4+
metadata:
5+
labels: {}
6+
name: leaf0-0
7+
namespace: openstack
8+
---
9+
apiVersion: metal3.io/v1alpha1
10+
kind: BareMetalHost
11+
metadata:
12+
labels: {}
13+
name: leaf0-1
14+
namespace: openstack
15+
---
16+
apiVersion: metal3.io/v1alpha1
17+
kind: BareMetalHost
18+
metadata:
19+
labels: {}
20+
name: leaf1-0
21+
namespace: openstack
22+
---
23+
apiVersion: metal3.io/v1alpha1
24+
kind: BareMetalHost
25+
metadata:
26+
labels: {}
27+
name: leaf1-1
28+
namespace: openstack
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: bmc-secret
5+
namespace: openstack
6+
data:
7+
username: _raplaced_
8+
password: _replaced_
9+
type: Opaque
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1alpha1
3+
kind: Component
4+
5+
resources:
6+
- bmc_secret.yaml
7+
- baremetalhosts.yaml
8+
9+
patches:
10+
- target:
11+
kind: BareMetalHost
12+
path: baremetalhost_template.yaml
13+
14+
replacements:
15+
- source:
16+
kind: ConfigMap
17+
name: baremetalhost-values
18+
fieldPath: data.bmc_credentials
19+
targets:
20+
- select:
21+
kind: Secret
22+
name: bmc-secret
23+
fieldPaths:
24+
- data
25+
options:
26+
create: true
27+
28+
# Labels
29+
- source:
30+
kind: ConfigMap
31+
name: baremetalhost-values
32+
fieldPath: data.leaf0-0.labels
33+
targets:
34+
- select:
35+
kind: BareMetalHost
36+
name: leaf0-0
37+
fieldPaths:
38+
- metadata.labels
39+
options:
40+
create: true
41+
- source:
42+
kind: ConfigMap
43+
name: baremetalhost-values
44+
fieldPath: data.leaf0-1.labels
45+
targets:
46+
- select:
47+
kind: BareMetalHost
48+
name: leaf0-1
49+
fieldPaths:
50+
- metadata.labels
51+
options:
52+
create: true
53+
- source:
54+
kind: ConfigMap
55+
name: baremetalhost-values
56+
fieldPath: data.leaf1-0.labels
57+
targets:
58+
- select:
59+
kind: BareMetalHost
60+
name: leaf1-0
61+
fieldPaths:
62+
- metadata.labels
63+
options:
64+
create: true
65+
- source:
66+
kind: ConfigMap
67+
name: baremetalhost-values
68+
fieldPath: data.leaf1-1.labels
69+
targets:
70+
- select:
71+
kind: BareMetalHost
72+
name: leaf1-1
73+
fieldPaths:
74+
- metadata.labels
75+
options:
76+
create: true
77+
78+
# BMC
79+
- source:
80+
kind: ConfigMap
81+
name: baremetalhost-values
82+
fieldPath: data.leaf0-0.bmc
83+
targets:
84+
- select:
85+
kind: BareMetalHost
86+
name: leaf0-0
87+
fieldPaths:
88+
- spec.bmc
89+
options:
90+
create: true
91+
- source:
92+
kind: ConfigMap
93+
name: baremetalhost-values
94+
fieldPath: data.leaf0-1.bmc
95+
targets:
96+
- select:
97+
kind: BareMetalHost
98+
name: leaf0-1
99+
fieldPaths:
100+
- spec.bmc
101+
options:
102+
create: true
103+
- source:
104+
kind: ConfigMap
105+
name: baremetalhost-values
106+
fieldPath: data.leaf1-0.bmc
107+
targets:
108+
- select:
109+
kind: BareMetalHost
110+
name: leaf1-0
111+
fieldPaths:
112+
- spec.bmc
113+
options:
114+
create: true
115+
- source:
116+
kind: ConfigMap
117+
name: baremetalhost-values
118+
fieldPath: data.leaf1-1.bmc
119+
targets:
120+
- select:
121+
kind: BareMetalHost
122+
name: leaf1-1
123+
fieldPaths:
124+
- spec.bmc
125+
options:
126+
create: true
127+
# bootMACAddress
128+
- source:
129+
kind: ConfigMap
130+
name: baremetalhost-values
131+
fieldPath: data.leaf0-0.bootMACAddress
132+
targets:
133+
- select:
134+
kind: BareMetalHost
135+
name: leaf0-0
136+
fieldPaths:
137+
- spec.bootMACAddress
138+
options:
139+
create: true
140+
- source:
141+
kind: ConfigMap
142+
name: baremetalhost-values
143+
fieldPath: data.leaf0-1.bootMACAddress
144+
targets:
145+
- select:
146+
kind: BareMetalHost
147+
name: leaf0-1
148+
fieldPaths:
149+
- spec.bootMACAddress
150+
options:
151+
create: true
152+
- source:
153+
kind: ConfigMap
154+
name: baremetalhost-values
155+
fieldPath: data.leaf1-0.bootMACAddress
156+
targets:
157+
- select:
158+
kind: BareMetalHost
159+
name: leaf1-0
160+
fieldPaths:
161+
- spec.bootMACAddress
162+
options:
163+
create: true
164+
- source:
165+
kind: ConfigMap
166+
name: baremetalhost-values
167+
fieldPath: data.leaf1-1.bootMACAddress
168+
targets:
169+
- select:
170+
kind: BareMetalHost
171+
name: leaf1-1
172+
fieldPaths:
173+
- spec.bootMACAddress
174+
options:
175+
create: true
176+
177+
# rootDeviceHints
178+
- source:
179+
kind: ConfigMap
180+
name: baremetalhost-values
181+
fieldPath: data.leaf0-0.rootDeviceHints
182+
targets:
183+
- select:
184+
kind: BareMetalHost
185+
name: leaf0-0
186+
fieldPaths:
187+
- spec.rootDeviceHints
188+
options:
189+
create: true
190+
- source:
191+
kind: ConfigMap
192+
name: baremetalhost-values
193+
fieldPath: data.leaf0-1.rootDeviceHints
194+
targets:
195+
- select:
196+
kind: BareMetalHost
197+
name: leaf0-1
198+
fieldPaths:
199+
- spec.rootDeviceHints
200+
options:
201+
create: true
202+
- source:
203+
kind: ConfigMap
204+
name: baremetalhost-values
205+
fieldPath: data.leaf1-0.rootDeviceHints
206+
targets:
207+
- select:
208+
kind: BareMetalHost
209+
name: leaf1-0
210+
fieldPaths:
211+
- spec.rootDeviceHints
212+
options:
213+
create: true
214+
- source:
215+
kind: ConfigMap
216+
name: baremetalhost-values
217+
fieldPath: data.leaf1-1.rootDeviceHints
218+
targets:
219+
- select:
220+
kind: BareMetalHost
221+
name: leaf1-1
222+
fieldPaths:
223+
- spec.rootDeviceHints
224+
options:
225+
create: true

0 commit comments

Comments
 (0)