Skip to content

Commit

Permalink
Add DT using BMO / Metal3 provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
hjensas committed Sep 24, 2024
1 parent 21ece11 commit a755a9c
Show file tree
Hide file tree
Showing 30 changed files with 2,037 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dt/bmo/dataplane/baremetalhosts/baremetalhost_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: metal3.io/v1alpha1

Check warning on line 1 in dt/bmo/dataplane/baremetalhosts/baremetalhost_template.yaml

View workflow job for this annotation

GitHub Actions / yaml-lint

1:1 [document-start] missing document start "---"
kind: BareMetalHost
metadata:
labels: {}
name: _ignored_
namespace: openstack
spec:
architecture: x86_64
automatedCleaningMode: metadata
bmc: {}
bootMACAddress: _replaced_
bootMode: UEFI
rootDeviceHints: {}
online: false
28 changes: 28 additions & 0 deletions dt/bmo/dataplane/baremetalhosts/baremetalhosts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
labels: {}
name: leaf0-0
namespace: openstack
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
labels: {}
name: leaf0-1
namespace: openstack
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
labels: {}
name: leaf1-0
namespace: openstack
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
labels: {}
name: leaf1-1
namespace: openstack
9 changes: 9 additions & 0 deletions dt/bmo/dataplane/baremetalhosts/bmc_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1

Check warning on line 1 in dt/bmo/dataplane/baremetalhosts/bmc_secret.yaml

View workflow job for this annotation

GitHub Actions / yaml-lint

1:1 [document-start] missing document start "---"
kind: Secret
metadata:
name: bmc-secret
namespace: openstack
data:
username: _raplaced_

Check failure on line 7 in dt/bmo/dataplane/baremetalhosts/bmc_secret.yaml

View workflow job for this annotation

GitHub Actions / yaml-lint

7:3 [indentation] wrong indentation: expected 1 but found 2
password: _replaced_
type: Opaque

Check failure on line 9 in dt/bmo/dataplane/baremetalhosts/bmc_secret.yaml

View workflow job for this annotation

GitHub Actions / yaml-lint

9:13 [new-line-at-end-of-file] no new line character at the end of file
225 changes: 225 additions & 0 deletions dt/bmo/dataplane/baremetalhosts/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- bmc_secret.yaml
- baremetalhosts.yaml

patches:
- target:
kind: BareMetalHost
path: baremetalhost_template.yaml

replacements:
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.bmc_credentials
targets:
- select:
kind: Secret
name: bmc-secret

Check failure on line 22 in dt/bmo/dataplane/baremetalhosts/kustomization.yaml

View workflow job for this annotation

GitHub Actions / yaml-lint

22:17 [colons] too many spaces after colon
fieldPaths:
- data
options:
create: true

Check failure on line 27 in dt/bmo/dataplane/baremetalhosts/kustomization.yaml

View workflow job for this annotation

GitHub Actions / yaml-lint

27:1 [trailing-spaces] trailing spaces
# Labels
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf0-0.labels
targets:
- select:
kind: BareMetalHost
name: leaf0-0
fieldPaths:
- metadata.labels
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf0-1.labels
targets:
- select:
kind: BareMetalHost
name: leaf0-1
fieldPaths:
- metadata.labels
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf1-0.labels
targets:
- select:
kind: BareMetalHost
name: leaf1-0
fieldPaths:
- metadata.labels
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf1-1.labels
targets:
- select:
kind: BareMetalHost
name: leaf1-1
fieldPaths:
- metadata.labels
options:
create: true

# BMC
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf0-0.bmc
targets:
- select:
kind: BareMetalHost
name: leaf0-0
fieldPaths:
- spec.bmc
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf0-1.bmc
targets:
- select:
kind: BareMetalHost
name: leaf0-1
fieldPaths:
- spec.bmc
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf1-0.bmc
targets:
- select:
kind: BareMetalHost
name: leaf1-0
fieldPaths:
- spec.bmc
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf1-1.bmc
targets:
- select:
kind: BareMetalHost
name: leaf1-1
fieldPaths:
- spec.bmc
options:
create: true
# bootMACAddress
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf0-0.bootMACAddress
targets:
- select:
kind: BareMetalHost
name: leaf0-0
fieldPaths:
- spec.bootMACAddress
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf0-1.bootMACAddress
targets:
- select:
kind: BareMetalHost
name: leaf0-1
fieldPaths:
- spec.bootMACAddress
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf1-0.bootMACAddress
targets:
- select:
kind: BareMetalHost
name: leaf1-0
fieldPaths:
- spec.bootMACAddress
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf1-1.bootMACAddress
targets:
- select:
kind: BareMetalHost
name: leaf1-1
fieldPaths:
- spec.bootMACAddress
options:
create: true

Check failure on line 176 in dt/bmo/dataplane/baremetalhosts/kustomization.yaml

View workflow job for this annotation

GitHub Actions / yaml-lint

176:1 [trailing-spaces] trailing spaces
# rootDeviceHints
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf0-0.rootDeviceHints
targets:
- select:
kind: BareMetalHost
name: leaf0-0
fieldPaths:
- spec.rootDeviceHints
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf0-1.rootDeviceHints
targets:
- select:
kind: BareMetalHost
name: leaf0-1
fieldPaths:
- spec.rootDeviceHints
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf1-0.rootDeviceHints
targets:
- select:
kind: BareMetalHost
name: leaf1-0
fieldPaths:
- spec.rootDeviceHints
options:
create: true
- source:
kind: ConfigMap
name: baremetalhost-values
fieldPath: data.leaf1-1.rootDeviceHints
targets:
- select:
kind: BareMetalHost
name: leaf1-1
fieldPaths:
- spec.rootDeviceHints
options:
create: true

Check failure on line 225 in dt/bmo/dataplane/baremetalhosts/kustomization.yaml

View workflow job for this annotation

GitHub Actions / yaml-lint

225:23 [new-line-at-end-of-file] no new line character at the end of file
31 changes: 31 additions & 0 deletions dt/bmo/dataplane/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

transformers:
- |-
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: _ignored_
namespace: openstack
setRoleBindingSubjects: none
unsetOnly: true
fieldSpecs:
- path: metadata/name
kind: Namespace
create: true
components:
- ../../../lib/dataplane/deployment

patches:
- target:
kind: OpenStackDataPlaneDeployment
name: .*
patch: |-
- op: replace
path: /spec/nodeSets
value:
- nodeset-0
- nodeset-1
20 changes: 20 additions & 0 deletions dt/bmo/dataplane/nodesets/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

transformers:
- |-
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: _ignored_
namespace: openstack
setRoleBindingSubjects: none
unsetOnly: true
fieldSpecs:
- path: metadata/name
kind: Namespace
create: true
resources:
- openstackdataplanenodesets.yaml
46 changes: 46 additions & 0 deletions dt/bmo/dataplane/nodesets/openstackdataplanenodesets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneNodeSet
metadata:
name: nodeset-0
spec:
env:
- name: ANSIBLE_FORCE_COLOR
value: "True"
preProvisioned: false
baremetalSetTemplate:
deploymentSSHSecret: dataplane-ansible-ssh-private-key-secret
bmhNamespace: openstack
cloudUserName: cloud-user
bmhLabelSelector:
app: openstack
nodeset: leaf0
ctlplaneInterface: enp5s0
networkAttachments:
- ctlplane
nodeTemplate:
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
managementNetwork: ctlplane
---
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneNodeSet
metadata:
name: nodeset-1
spec:
env:
- name: ANSIBLE_FORCE_COLOR
value: "True"
preProvisioned: false
baremetalSetTemplate:
deploymentSSHSecret: dataplane-ansible-ssh-private-key-secret
bmhNamespace: openstack
cloudUserName: cloud-user
bmhLabelSelector:
app: openstack
nodeset: leaf1
ctlplaneInterface: enp5s0
networkAttachments:
- ctlplane
nodeTemplate:
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
managementNetwork: ctlplane
11 changes: 11 additions & 0 deletions dt/bmo/dataplane/secrets/dataplane-ssh-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: v1
data:
authorized_keys: _replaced_
ssh-privatekey: _replaced_
ssh-publickey: _replaced_
kind: Secret
metadata:
name: dataplane-ansible-ssh-private-key-secret
namespace: openstack
type: Opaque
Loading

0 comments on commit a755a9c

Please sign in to comment.