Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first BGP DTs - WIP #44

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/config/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/config/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/config/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