Skip to content

Commit

Permalink
BGP basic configurations
Browse files Browse the repository at this point in the history
This patch includes kustomizations required to deploy BGP at different
levels:
- metallb
- nad
- control-plane
- edpm
  • Loading branch information
eduolivares committed Apr 23, 2024
1 parent e562e84 commit 5419af4
Show file tree
Hide file tree
Showing 18 changed files with 1,608 additions and 0 deletions.
34 changes: 34 additions & 0 deletions automation/vars/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,37 @@ vas:
- name: edpm-values
src_file: values.yaml
build_output: edpm.yaml

bgp:
stages:
- path: examples/dt/bgp/control-plane/nncp
wait_conditions:
- >-
oc -n openstack wait nncp
-l osp/nncm-config-type=standard
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured
--timeout=60s
values:
- name: network-values
src_file: values.yaml
build_output: nncp.yaml

- path: examples/dt/bgp/control-plane
wait_conditions:
- >-
oc -n openstack wait osctlplane controlplane --for condition=Ready
--timeout=30m
values:
- name: network-values
src_file: nncp/values.yaml
build_output: ../control-plane.yaml

- path: examples/dt/bgp/edpm
wait_conditions:
- >-
oc -n openstack wait
osdpd edpm-deployment --for condition=Ready --timeout=40m
values:
- name: edpm-values
src_file: values.yaml
build_output: dataplane.yaml
24 changes: 24 additions & 0 deletions dt/bgp/edpm/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

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/dataplane

resources:
- nova_custom.yaml
18 changes: 18 additions & 0 deletions dt/bgp/edpm/nova_custom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
name: nova-custom
spec:
secrets:
- nova-cell1-compute-config
- nova-migration-ssh-key
playbook: osp.edpm.nova
tlsCert:
contents:
- dnsnames
- ips
networks:
- ctlplane
issuer: osp-rootca-issuer-internal
caCerts: combined-ca-bundle
175 changes: 175 additions & 0 deletions dt/bgp/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

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/networking/metallb
- networking/bgpmetallb
- ../../lib/networking/netconfig
- ../../lib/networking/nad
- networking/nad
- ../../lib/control-plane

patches:
# Add BGP networks to NetConfig
- target:
kind: NetConfig
name: netconfig
patch: |-
- op: add
path: /spec/networks/-
value:
dnsDomain: bgpnet0.example.com
name: bgpnet0
subnets:
- _replaced_
mtu: 1500
- target:
kind: NetConfig
name: netconfig
patch: |-
- op: add
path: /spec/networks/-
value:
dnsDomain: bgpnet1.example.com
name: bgpnet1
subnets:
- _replaced_
mtu: 1500
- target:
kind: NetConfig
name: netconfig
patch: |-
- op: add
path: /spec/networks/-
value:
dnsDomain: bgpmainnet.example.com
name: bgpmainnet
subnets:
- _replaced_
mtu: 1500
- target:
kind: NetConfig
name: netconfig
patch: |-
- op: add
path: /spec/networks/-
value:
dnsDomain: bgpmainnetv6.example.com
name: bgpmainnetv6
subnets:
- _replaced_
mtu: 1500
# Enable octavia and heat
- target:
kind: OpenStackControlPlane
name: controlplane
patch: |-
- op: replace
path: /spec/octavia/enabled
value: true
- target:
kind: OpenStackControlPlane
name: controlplane
patch: |-
- op: replace
path: /spec/heat/enabled
value: true
# Connect ovnNorthd to internalapi
- target:
kind: OpenStackControlPlane
name: controlplane
patch: |-
- op: add
path: /spec/ovn/template/ovnNorthd
value:
networkAttachment: internalapi
replacements:
# BGP NetConfig customizations
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bgp.subnets.bgpnet0
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=bgpnet0].subnets
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bgp.subnets.bgpnet1
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=bgpnet1].subnets
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bgp.subnets.bgpmainnet
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=bgpmainnet].subnets
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bgp.subnets.bgpmainnetv6
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=bgpmainnetv6].subnets

# Control plane customization to use glance with swift
- source:
kind: ConfigMap
name: service-values
fieldPath: data.glance.customServiceConfig
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.glance.template.customServiceConfig
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.glance.default.replicas
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.glance.template.glanceAPIs.default.replicas
options:
create: true
- source:
kind: ConfigMap
name: service-values
fieldPath: data.swift.enabled
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.swift.enabled
options:
create: true
12 changes: 12 additions & 0 deletions dt/bgp/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: _ignored_
namespace: openstack
setRoleBindingSubjects: none
unsetOnly: true
fieldSpecs:
- path: metadata/name
kind: Namespace
create: true
73 changes: 73 additions & 0 deletions dt/bgp/networking/bgpmetallb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- metallb_bgppeers.yaml
- metallb_bgpadvertisements.yaml

replacements:
# BGP peer IP addresses
# node0
- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_0.bgp_peers.0
targets:
- select:
kind: BGPPeer
name: bgp-peer-node-0-0
fieldPaths:
- spec.peerAddress
- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_0.bgp_peers.1
targets:
- select:
kind: BGPPeer
name: bgp-peer-node-0-1
fieldPaths:
- spec.peerAddress
# node1
- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_1.bgp_peers.0
targets:
- select:
kind: BGPPeer
name: bgp-peer-node-1-0
fieldPaths:
- spec.peerAddress
- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_1.bgp_peers.1
targets:
- select:
kind: BGPPeer
name: bgp-peer-node-1-1
fieldPaths:
- spec.peerAddress
# node2
- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_2.bgp_peers.0
targets:
- select:
kind: BGPPeer
name: bgp-peer-node-2-0
fieldPaths:
- spec.peerAddress
- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_2.bgp_peers.1
targets:
- select:
kind: BGPPeer
name: bgp-peer-node-2-1
fieldPaths:
- spec.peerAddress
19 changes: 19 additions & 0 deletions dt/bgp/networking/bgpmetallb/metallb_bgpadvertisements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
name: bgpadvertisement
namespace: metallb-system
spec:
ipAddressPools:
- ctlplane
- internalapi
- storage
- tenant
peers:
- bgp-peer-node-0-0
- bgp-peer-node-0-1
- bgp-peer-node-1-0
- bgp-peer-node-1-1
- bgp-peer-node-2-0
- bgp-peer-node-2-1
Loading

0 comments on commit 5419af4

Please sign in to comment.