Skip to content

Commit

Permalink
Add IPv6 controlplane with Ironic DT
Browse files Browse the repository at this point in the history
  • Loading branch information
hjensas committed Apr 12, 2024
1 parent 6221c2a commit 85de8a0
Show file tree
Hide file tree
Showing 18 changed files with 1,028 additions and 0 deletions.
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/dt/ipv6_ironic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nncp.yaml
networking.yaml
control-plane.yaml
16 changes: 16 additions & 0 deletions examples/dt/ipv6_ironic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# OpenStack IPv6 Controlplane with Ironic

This is a collection of CR templates that represent a validated Red Hat OpenStack Services on OpenShift deployment that has the following characteristics:

- 1 master/worker combo-node OpenShift cluster
- 1-replica Galera database
- RabbitMQ
- OVN networking
- Network isolation over two NICs

## Stages

All stages must be executed in the order listed below. Everything is required unless

1. [Install the OpenStack K8S operators and their dependencies](../../common/)
2. [Configuring networking and deploy the OpenStack control plane](control-plane.md)
62 changes: 62 additions & 0 deletions examples/dt/ipv6_ironic/control-plane.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Configuring networking and deploy the OpenStack control plane

## Assumptions

- Operators are already deployed
- A storage class called `local-storage` should already exist.

## Initialize

Switch to the "openstack" namespace
```
oc project openstack
```
Change to the ipv6_ironic directory
```
cd architecture/examples/dt/ipv6_ironic
```
Edit the [control-plane/networking/nncp/values.yaml](control-plane/neworking/nncp/values.yaml) file to suit your environment.
```
vi control-plane/networking/nncp/values.yaml
```

## Apply node network configuration

Generate the node network configuration
```
kustomize build control-plane/networking/nncp > nncp.yaml
```
Apply the NNCP CRs
```
oc apply -f nncp.yaml
```
Wait for NNCPs to be available
```
oc wait nncp -l osp/nncm-config-type=standard --for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured --timeout=300s
```

## Apply networking and configuration

Generate the networking CRs.
```
kustomize build control-plane/networking > networking.yaml
```
Apply the CRs
```
oc apply -f networking.yaml
```

## Apply the control-plane configurastion

Generate the control-plane CRs.
```
kustomize build control-plane > control-plane.yaml
```
Apply the CRs
```
oc apply -f control-plane.yaml
```
Wait for control plane to be available
```
oc wait osctlplane controlplane --for condition=Ready --timeout=600s
```
1 change: 1 addition & 0 deletions examples/dt/ipv6_ironic/control-plane/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
control-plane.yaml
157 changes: 157 additions & 0 deletions examples/dt/ipv6_ironic/control-plane/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

transformers:
# Set namespace to OpenStack on all namespaced objects without a namespace
- |-
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: _ignored_
namespace: openstack
setRoleBindingSubjects: none
unsetOnly: true
fieldSpecs:
- path: metadata/name
kind: Namespace
create: true
components:
- ../../../../lib/control-plane

resources:
- networking/nncp/values.yaml
- service-values.yaml

replacements:
# TODO: re-enabled horizon when OSPRH-6238 is fixed
- source:
kind: ConfigMap
name: service-values
fieldPath: data.horizon.enabled
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.horizon.enabled
options:
create: true
- source:
kind: ConfigMap
name: network-values
fieldPath: data.internalapi.endpoint_annotations
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.ironic.template.ironicAPI.override.service.internal.metadata.annotations
options:
create: true
- source:
kind: ConfigMap
name: network-values
fieldPath: data.lbServiceType
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.ironic.template.ironicAPI.override.service.internal.spec.type
options:
create: true
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bmaas.bridgeName
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.ironic.template.ironicConductors.0.networkAttachments.0
- spec.ironic.template.ironicConductors.0.provisionNetwork
- spec.ironic.template.ironicInspector.inspectionNetwork
- spec.ironic.template.ironicInspector.networkAttachments.0
- spec.ovn.template.ovnController.nicMappings.bmaas
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.ironic.enabled
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.ironic.enabled
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.ironic.ironicConductors.0.customServiceConfig
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.ironic.template.ironicConductors.0.customServiceConfig
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.nova.cellTemplates
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.nova.template.cellTemplates
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.galera.replicas
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.galera.templates.openstack.replicas
- spec.galera.templates.openstack-cell1.replicas
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.rabbitmq.replicas
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.rabbitmq.templates.rabbitmq.replicas
- spec.rabbitmq.templates.rabbitmq-cell1.replicas
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.rabbitmq.erlangInetConfig
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.rabbitmq.templates.rabbitmq.rabbitmq.erlangInetConfig
- spec.rabbitmq.templates.rabbitmq-cell1.rabbitmq.erlangInetConfig
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.rabbitmq.envConfig
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.rabbitmq.templates.rabbitmq.rabbitmq.envConfig
- spec.rabbitmq.templates.rabbitmq-cell1.rabbitmq.envConfig
options:
create: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- ../../../../../lib/metallb
- ../../../../../lib/networking/metallb
- ../../../../../lib/networking/nad
- metallb
- nad

resources:
- nncp/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
namespace: metallb-system
name: bmaas
labels:
osp/lb-addresses-type: standard
spec:
addresses: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- l2advertisement.yaml
- ip_pools.yaml

replacements:

# IPAddressPool addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bmaas.lb_addresses
targets:
- select:
group: metallb.io
kind: IPAddressPool
name: bmaas
fieldPaths:
- spec.addresses

# Loadbalancer interfaces
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bmaas.iface
targets:
- select:
group: metallb.io
kind: L2Advertisement
name: bmaas
fieldPaths:
- spec.interfaces.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Additional advertisements can be added here if needed for other networks
#
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: bmaas
namespace: metallb-system
spec:
ipAddressPools:
- bmaas
interfaces:
- _replaced_
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- nad.yaml

replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bmaas.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: bmaas
fieldPaths:
- spec.config
11 changes: 11 additions & 0 deletions examples/dt/ipv6_ironic/control-plane/networking/nad/nad.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: bmaas
labels:
osp/net: bmaas
osp/net-attach-def-type: standard
spec:
config: |
_replaced_
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nncp.yaml
Loading

0 comments on commit 85de8a0

Please sign in to comment.