Skip to content

Commit

Permalink
Merge branch 'main' into samples-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
slagle authored Sep 8, 2023
2 parents ecb3c34 + 6bab360 commit 39cdeaf
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 242 deletions.
24 changes: 1 addition & 23 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,7 @@ resources:
controller: true
domain: openstack.org
group: dataplane
kind: OpenStackDataPlane
path: github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openstack.org
group: dataplane
kind: OpenStackDataPlaneRole
path: github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openstack.org
group: dataplane
kind: OpenStackDataPlaneNode
kind: OpenStackDataPlaneNodeSet
path: github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1
version: v1beta1
- api:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ spec:
deployStrategy:
deploy: true
baremetalSetTemplate:
bmhNamespace: openstack
deploymentSSHSecret: dataplane-ansible-ssh-private-key-secret
bmhLabelSelector:
app: openstack
Expand All @@ -33,26 +32,16 @@ spec:
nodes:
edpm-compute-0:
hostName: edpm-compute-0
ansible:
ansibleUser: cloud-admin
ansibleHost: 192.168.122.100
ansibleVars:
ctlplane_ip: 192.168.122.100
internal_api_ip: 172.17.0.100
storage_ip: 172.18.0.100
tenant_ip: 172.19.0.100
fqdn_internal_api: edpm-compute-0.example.com
networks:
- name: CtlPlane
subnetName: subnet1
defaultRoute: true
fixedIP: 192.168.122.100
- name: InternalApi
subnetName: subnet1
- name: Storage
subnetName: subnet1
- name: Tenant
subnetName: subnet1
networks:
- name: CtlPlane
subnetName: subnet1
defaultRoute: true
- name: InternalApi
subnetName: subnet1
- name: Storage
subnetName: subnet1
- name: Tenant
subnetName: subnet1
managementNetwork: ctlplane
ansible:
ansibleUser: cloud-admin
Expand All @@ -72,28 +61,6 @@ spec:
# considered EDPM network defaults.
neutron_physical_bridge_name: br-ex
neutron_public_interface_name: eth0
ctlplane_mtu: 1500
ctlplane_subnet_cidr: 24
ctlplane_gateway_ip: 192.168.122.1
ctlplane_host_routes:
- ip_netmask: 0.0.0.0/0
next_hop: 192.168.122.1
external_mtu: 1500
external_vlan_id: 44
external_cidr: '24'
external_host_routes: []
internal_api_mtu: 1500
internal_api_vlan_id: 20
internal_api_cidr: '24'
internal_api_host_routes: []
storage_mtu: 1500
storage_vlan_id: 21
storage_cidr: '24'
storage_host_routes: []
tenant_mtu: 1500
tenant_vlan_id: 22
tenant_cidr: '24'
tenant_host_routes: []
role_networks:
- InternalApi
- Storage
Expand All @@ -111,9 +78,6 @@ spec:
edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1
edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678
edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1
ctlplane_dns_nameservers:
- 192.168.122.1
dns_search_domains: []
edpm_ovn_dbs:
- 192.168.122.1
registry_url: quay.io/podified-antelope-centos9
Expand Down
88 changes: 19 additions & 69 deletions docs/deploying.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Deploying a DataPlane
# Deploying a DataPlaneNodeSet

Deploying a dataplane consists of creating the custom resources (whether
OpenStackDataPlane, OpenStackDataPlaneRole, or OpenStackDataPlaneNode) that
Deploying a dataplane consists of creating the OpenStackDataPlaneNodeSet custom resource that
define the layout of the dataplane.

This documentation will cover using each resource individually, as well as
using the OpenStackDataPlane resource to deploy everything in a single
using the OpenStackDataPlaneNodeSet resource to deploy everything in a single
resource.

## Samples
Expand Down Expand Up @@ -73,17 +72,17 @@ Verify the secret was created:

oc describe secret dataplane-ansible-ssh-private-key-secret

### Create OpenStackDataPlane
### Create OpenStackDataPlaneNodeSet

This document will cover writing the `YAML` document for an
`OpenStackDataPlane` resource. Once the document is ready, it will be created
`OpenStackDataPlaneNodeSet` resource. Once the document is ready, it will be created
with `oc` as the last step.

Start the `YAML` document in an `openstack-edpm.yaml` file and give the
dataplane a name.

apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlane
kind: OpenStackDataPlaneNodeSet
metadata:
name: openstack-edpm

Expand All @@ -92,7 +91,7 @@ added to the spec that contains `deploy: false`. This allows for creating
the dataplane resources without triggering an Ansible execution immediately.

apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlane
kind: OpenStackDataPlaneNodeSet
metadata:
name: openstack-edpm
spec:
Expand All @@ -109,7 +108,7 @@ inheritance works. Within `nodeTemplate`, the fields shown are documented
inline in the example.

apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlane
kind: OpenStackDataPlaneNodeSet
metadata:
name: openstack-edpm
spec:
Expand All @@ -135,7 +134,7 @@ inline in the example.
# These vars are edpm_network_config role vars
edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2

# See config/samples/dataplane_v1beta1_openstackdataplane.yaml
# See config/samples/dataplane_v1beta1_openstackdataplanenodeset.yaml
# for the other most common ansible varialbes that need to be set.

The list of ansible variables that can be set under `ansibleVars` is extensive.
Expand Down Expand Up @@ -192,7 +191,7 @@ With the nodes and the controlplane specific variables added, the full
`openstack-datplane` `YAML` document looks like the following:

apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlane
kind: OpenStackDataPlaneNodeSet
metadata:
name: openstack-edpm
spec:
Expand Down Expand Up @@ -227,7 +226,7 @@ With the nodes and the controlplane specific variables added, the full
edpm_ovn_dbs:
- 192.168.24.1

# See config/samples/dataplane_v1beta1_openstackdataplane.yaml
# See config/samples/dataplane_v1beta1_openstackdataplanenodeset.yaml
# for the other most common ansible varialbes that need to be set.

nodes:
Expand Down Expand Up @@ -258,25 +257,16 @@ Create the dataplane using the `oc` command.

oc create -f openstack-edpm.yaml

Verify that the dataplane, role, and nodes were created.
Verify that the dataplane nodeset were created.

oc get openstackdataplane
oc get openstackdataplanerole
oc get openstackdataplanenode
oc get openstackdataplanenodeset

The output should be similar to:

```console
$ oc get openstackdataplane
$ oc get openstackdataplanenodeset
NAME STATUS MESSAGE
openstack-edpm False Deployment not started
$ oc get openstackdataplanerole
NAME STATUS MESSAGE
edpm-compute False Deployment not started
$ oc get openstackdataplanenode
NAME STATUS MESSAGE
edpm-compute-0 False Deployment not started
edpm-compute-1 False Deployment not started
```

### Understanding OpenStackDataPlaneServices
Expand Down Expand Up @@ -364,27 +354,20 @@ To deploy the `openstack-edpm` dataplane resource, the
the deployment of all the configured services across the nodes. The field can
be set with the following command to start the deployment:

oc patch openstackdataplane openstack-edpm -p='[{"op": "replace", "path": "/spec/deployStrategy/deploy", "value":true}]' --type json
oc patch openstackdataplanenodeset openstack-edpm -p='[{"op": "replace", "path": "/spec/deployStrategy/deploy", "value":true}]' --type json

The `oc patch` command sets the `deploy` field to `True`, which starts the
deployment. `oc edit openstackdataplane openstack-edpm` could alternatively be
deployment. `oc edit OpenStackDataPlaneNodeSet openstack-edpm` could alternatively be
used to edit the resource directly in an editor to set the field to `True`.

With the deployment started, ansible will be executed to configure the nodes.
When the deployment is complete, the status messages will change to indicate
the deployment is ready.

```console
$ oc get openstackdataplane
$ oc get openstackdataplanenodeset
NAME STATUS MESSAGE
openstack-edpm True DataPlane Ready
$ oc get openstackdataplanerole
NAME STATUS MESSAGE
edpm-compute True DataPlaneRole Ready
$ oc get openstackdataplanenode
NAME STATUS MESSAGE
edpm-compute-0 True DataPlaneNode Ready
edpm-compute-1 True DataPlaneNode Ready
```

If the deployment involved adding new compute nodes then after the deployment
Expand All @@ -400,46 +383,13 @@ Each dataplane resource has a series of conditions within their `status`
subresource that indicate the overall state of the resource, including its
deployment progress.

`OpenStackDataPlane` resource conditions:

```console
$ oc get openstackdataplane openstack-edpm -o json | jq .status.conditions[].type
"Ready"
"DeploymentReady"
"SetupReady"
```

`OpenStackDataPlaneRole` resource conditions:

```console
$ oc get openstackdataplanerole edpm-compute -o json | jq .status.conditions[].type
"Ready"
"DeploymentReady"
"RoleBaremetalProvisionReady"
"SetupReady"
"configure-network service ready"
"configure-os service ready"
"install-os service ready"
"libvirt service ready"
"nova service ready"
"run-os service ready"
"validate-network service ready"
```

`OpenStackDataPlaneNode` resource conditions:
`OpenStackDataPlaneNodeSet` resource conditions:

```console
$ oc get openstackdataplanenode edpm-compute-0 -o json | jq .status.conditions[].type
$ oc get openstackdataplanenodeset openstack-edpm -o json | jq .status.conditions[].type
"Ready"
"DeploymentReady"
"SetupReady"
"configure-network service ready"
"configure-os service ready"
"install-os service ready"
"install-os service ready"
"libvirt service ready"
"run-os service ready"
"validate-network service ready"
```

Each resource has a `Ready`, `DeploymentReady`, and `SetupReady` conditions.
Expand Down
5 changes: 2 additions & 3 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ software on the nodes.

## DataPlane Design and Resources

The dataplane-operator exposes the concepts of dataplanes, roles, nodes, and
The dataplane-operator exposes the concepts of nodesets and
services as CRD's:

* [OpenStackDataPlane](https://github.com/openstack-k8s-operators/dataplane-operator/blob/main/config/crd/bases/dataplane.openstack.org_openstackdataplanes.yaml)
* [OpenStackDataPlaneNodeSet](https://github.com/openstack-k8s-operators/dataplane-operator/blob/main/config/crd/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml)
* [OpenStackDataPlaneService](https://github.com/openstack-k8s-operators/dataplane-operator/blob/main/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml)

Each `NodeSet` in a dataplane is represented by a corresponding
OpenStackDataPlaneNodeSet resource. The OpenStackDataPlaneNodeSet CRD provides for a
logical grouping of nodes of a similar type. This is analogous to the concept of "roles"
in TripleO. Similarities within a `NodeSet` are defined by the user, and could be of a
in TripleO. Similarities within a `NodeSet` are defined by the user, and could be of a
small scope (ansible port), or a large scope (same network config, nova config,
provisioning config, etc). The properties that all nodes in a `NodeSet` share is set
in the NodeTemplate field of the `NodeSet`'s Spec. Node specific parameters are then
Expand Down
Loading

0 comments on commit 39cdeaf

Please sign in to comment.