Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Update kustomize examples and docs
Browse files Browse the repository at this point in the history
Signed-off-by: Fabricio Aguiar <[email protected]>
  • Loading branch information
fao89 committed Mar 19, 2024
1 parent 60b12bf commit 43d1cb6
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 47 deletions.
2 changes: 1 addition & 1 deletion docs/assemblies/creating-the-data-plane.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To create and deploy a data plane, you must perform the following tasks:
** CBO is installed and configured for provisioning.
** `BareMetalHosts` registered, inspected, and have the label `app:openstack`.
* You are logged on to a workstation that has access to the RHOCP cluster as a user with `cluster-admin` privileges.
* https://kustomize.io/[kustomize] version 5.0.1 or higher
* oc 4.14 or higher (https://kustomize.io/[kustomize] version 5.0.1 or higher)

include::proc_creating-the-SSH-key-secrets.adoc[leveloffset=+1]

Expand Down
50 changes: 6 additions & 44 deletions docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Create an `OpenStackDataPlaneNodeSet` CR for each logical grouping of nodes in y
git checkout
cd examples

. Use kustomize to create the `OpenStackDataPlaneDeployment` and `OpenStackDataPlaneNodeSet` CRs:
. Use kustomize to create the `OpenStackDataPlaneNodeSet` CRs:

* Pre-provisioned nodes:

kustomize build preprovisioned > openstack-edpm.yaml
oc kustomize preprovisioned_nodeset > openstack-edpm.yaml

* Bare metal nodes:

kustomize build baremetal > openstack-edpm.yaml
oc kustomize baremetal_nodeset > openstack-edpm.yaml

+
[NOTE]
Expand All @@ -34,48 +34,10 @@ If desired, update the `values.yaml` file with values from your environment and
====
+

. The sample `OpenStackDataPlaneNodeSet` CR is connected to `cell1` by default. If you added additional Compute cells to the control plane and you want to connect the node set to one of the other cells, then you must create a custom service for the node set that includes the `Secret` CR for the cell:
. The sample `OpenStackDataPlaneNodeSet` CR is connected to `cell1` by default. If you added additional Compute cells to the control plane and you want to connect the node set to one of the other cells, then you must create a custom service for the node set that includes the `Secret` CR for the cell,
see kustomize example at `examples/nova_cell_custom`

.. Create a custom `nova` service that includes the `Secret` CR for the cell to connect to:
+
[subs=+quotes]
----
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
name: *nova-cell-custom*
spec:
label: dataplane-deployment-custom-service
playbook: osp.edpm.nova
...
secrets:
- nova-cell2-compute-config <1>
----
+
<1> The `Secret` CR generated by the control plane for the cell.
+
For information about how to create a custom service, see xref:proc_creating-a-custom-service_dataplane[Creating a custom service].

.. Replace the `nova` service in your `OpenStackDataPlaneNodeSet` CR with your custom `nova` service:
+
[subs=+quotes]
----
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneNodeSet
metadata:
name: openstack-edpm-ipam
spec:
services:
- configure-network
- validate-network
- install-os
- configure-os
- run-os
- ovn
- libvirt
- *nova-cell-custom*
- telemetry
----
+
[NOTE]
Do not change the order of the default services.
Expand Down Expand Up @@ -310,7 +272,7 @@ endif::[]

. Save the `openstack-edpm.yaml` definition file.

. Create and <<proc_deploying-the-data-plane_dataplane,deploy>> the data plane resources:
. Create the data plane resources:
+
----
$ oc create -f openstack-edpm.yaml
Expand Down
6 changes: 4 additions & 2 deletions docs/assemblies/proc_deploying-the-data-plane.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You use the `OpenStackDataPlaneDeployment` CRD to configure the services on the

.Procedure

. Complete the steps from <<proc_creating-a-set-of-data-plane-nodes_dataplane,Creating a DataPlane>> procedure, ensuring that you have a file named `openstack-edpm.yaml` on your workstation.
. Copy the sample `OpenStackDataPlaneDeployment` CR from https://github.com/openstack-k8s-operators/dataplane-operator/blob/main/examples/base/crs/openstackdataplanedeployment.yaml and save it to a file named `openstack-edpm-deploy.yaml` on your workstation.

. Optional: Update `nodeSets` to include all the `OpenStackDataPlaneNodeSet` CRs that you want to deploy:
+
Expand All @@ -25,10 +25,12 @@ spec:
+
* Replace `<nodeSet_name>` with the names of the `OpenStackDataPlaneNodeSet` CRs that you want to include in your data plane deployment.

. Save the `openstack-edpm-deploy.yaml` deployment file.

. Deploy the data plane:
+
----
$ oc create -f openstack-edpm.yaml
$ oc create -f openstack-edpm-deploy.yaml
----
+
You can view the Ansible logs while the deployment executes:
Expand Down
15 changes: 15 additions & 0 deletions examples/baremetal_nodeset/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

components:
- ../baremetal

patches:
- target:
kind: OpenStackDataPlaneDeployment
patch: |
$patch: delete
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneDeployment
metadata:
name: edpm-deployment
33 changes: 33 additions & 0 deletions examples/nova_cell_custom/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

namespace: openstack

components:
- ../base

resources:
- openstackdataplanenovaservice.yaml

configMapGenerator:
- name: nova-extra-config
files:
- 25-nova-extra.conf=nova-extra.conf
options:
disableNameSuffixHash: true

patches:
- target:
kind: OpenStackDataPlaneService
name: nova
patch: |-
- op: replace
path: /metadata/name
value: nova-cell-custom
- op: add
path: /spec/configMaps
value:
- nova-extra-config
configurations:
- servicename.yaml
3 changes: 3 additions & 0 deletions examples/nova_cell_custom/nova-extra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[compute]
cpu_shared_set = 2,6
cpu_dedicated_set = 1,3,5,7
20 changes: 20 additions & 0 deletions examples/nova_cell_custom/openstackdataplanenovaservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
name: nova
spec:
secrets:
- nova-cell1-compute-config
# NOTE: this Secret needs to be created before deploying the data plane.
# It should contain an ssh key-pair in the secret fields: ssh-privatekey
# and ssh-publickey
- nova-migration-ssh-key
playbook: osp.edpm.nova
tlsCert:
contents:
- dnsnames
- ips
networks:
- ctlplane
issuer: osp-rootca-issuer-internal
caCerts: combined-ca-bundle
10 changes: 10 additions & 0 deletions examples/nova_cell_custom/servicename.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file is for teaching kustomize how to substitute OpenStackDataPlaneService name reference in OpenStackDataPlaneNodeSet
nameReference:
- kind: OpenStackDataPlaneService
version: v1beta1
group: dataplane.openstack.org
fieldSpecs:
- kind: OpenStackDataPlaneNodeSet
version: v1beta1
group: dataplane.openstack.org
path: spec/services
17 changes: 17 additions & 0 deletions examples/preprovisioned_nodeset/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

namespace: openstack

components:
- ../preprovisioned

patches:
- target:
kind: OpenStackDataPlaneDeployment
patch: |
$patch: delete
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneDeployment
metadata:
name: edpm-deployment

0 comments on commit 43d1cb6

Please sign in to comment.