Skip to content

Commit

Permalink
Merge pull request #101 from karelyatin/shared_bridge
Browse files Browse the repository at this point in the history
Configure OVN Controller to act as gateway
  • Loading branch information
fultonj committed Feb 20, 2024
2 parents 3460570 + 44a28a8 commit e6af03a
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 12 deletions.
12 changes: 11 additions & 1 deletion examples/va/hci/control-plane/nncp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ data:
"cniVersion": "0.3.1",
"name": "ctlplane",
"type": "macvlan",
"master": "enp7s0",
"master": "ospbr",
"ipam": {
"type": "whereabouts",
"range": "192.168.122.0/24",
Expand Down Expand Up @@ -171,6 +171,15 @@ data:
gateway: 10.0.0.1
name: subnet1
mtu: 1500
datacentre:
net-attach-def: |
{
"cniVersion": "0.3.1",
"name": "datacentre",
"type": "bridge",
"bridge": "ospbr",
"ipam": {}
}
dns-resolver:
config:
Expand Down Expand Up @@ -199,3 +208,4 @@ data:

lbServiceType: LoadBalancer
storageClass: host-nfs-storageclass
bridgeName: ospbr
12 changes: 11 additions & 1 deletion examples/va/nfv/ovs-dpdk/nncp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ data:
"cniVersion": "0.3.1",
"name": "ctlplane",
"type": "macvlan",
"master": "enp7s0",
"master": "ospbr",
"ipam": {
"type": "whereabouts",
"range": "192.168.122.0/24",
Expand Down Expand Up @@ -161,6 +161,15 @@ data:
gateway: 10.0.0.1
name: subnet1
mtu: 1500
datacentre:
net-attach-def: |
{
"cniVersion": "0.3.1",
"name": "datacentre",
"type": "bridge",
"bridge": "ospbr",
"ipam": {}
}
dns-resolver:
config:
Expand Down Expand Up @@ -189,3 +198,4 @@ data:

lbServiceType: LoadBalancer
storageClass: host-nfs-storageclass
bridgeName: ospbr
12 changes: 11 additions & 1 deletion examples/va/nfv/sriov/nncp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ data:
"cniVersion": "0.3.1",
"name": "ctlplane",
"type": "macvlan",
"master": "enp7s0",
"master": "ospbr",
"ipam": {
"type": "whereabouts",
"range": "192.168.122.0/24",
Expand Down Expand Up @@ -161,6 +161,15 @@ data:
gateway: 10.0.0.1
name: subnet1
mtu: 1500
datacentre:
net-attach-def: |
{
"cniVersion": "0.3.1",
"name": "datacentre",
"type": "bridge",
"bridge": "ospbr",
"ipam": {}
}
dns-resolver:
config:
Expand Down Expand Up @@ -189,3 +198,4 @@ data:

lbServiceType: LoadBalancer
storageClass: host-nfs-storageclass
bridgeName: ospbr
9 changes: 9 additions & 0 deletions lib/control-plane/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,12 @@ replacements:
fieldPaths:
- spec.storageClass
- spec.glance.template.storageClass
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bridgeName
targets:
- select:
kind: OpenStackControlPlane
fieldPaths:
- spec.ovn.template.ovnController.nicMappings.datacentre
2 changes: 2 additions & 0 deletions lib/control-plane/openstackcontrolplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ spec:
template:
ovnController:
networkAttachment: tenant
nicMappings:
datacentre: _replaced_
ovnDBCluster:
ovndbcluster-nb:
dbType: NB
Expand Down
12 changes: 11 additions & 1 deletion lib/networking/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ replacements:
name: tenant
fieldPaths:
- spec.config
- source:
kind: ConfigMap
name: network-values
fieldPath: data.datacentre.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: datacentre
fieldPaths:
- spec.config

# IPAddressPool addresses
- source:
Expand Down Expand Up @@ -163,7 +173,7 @@ replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.ctlplane.iface
fieldPath: data.bridgeName
targets:
- select:
group: metallb.io
Expand Down
8 changes: 8 additions & 0 deletions lib/networking/ocp_networks_netattach.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ metadata:
labels:
osp/net: tenant
osp/net-attach-def-type: standard
---
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: datacentre
labels:
osp/net: datacentre
osp/net-attach-def-type: standard
17 changes: 10 additions & 7 deletions lib/nncp/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ replacements:
kind: NodeNetworkConfigurationPolicy
fieldPaths:
- spec.desiredState.interfaces.[type=ethernet].name
- spec.desiredState.interfaces.[type=linux-bridge].bridge.port.0.name
- source:
kind: ConfigMap
name: network-values
Expand All @@ -112,6 +113,7 @@ replacements:
kind: NodeNetworkConfigurationPolicy
fieldPaths:
- spec.desiredState.interfaces.[type=ethernet].mtu
- spec.desiredState.interfaces.[type=linux-bridge].mtu

# Static Node IPs: node-0
- source:
Expand Down Expand Up @@ -143,7 +145,7 @@ replacements:
kind: NodeNetworkConfigurationPolicy
name: node-0
fieldPaths:
- spec.desiredState.interfaces.[type=ethernet].ipv4.address.0.ip
- spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.ip
- source:
kind: ConfigMap
name: network-values
Expand Down Expand Up @@ -185,7 +187,7 @@ replacements:
kind: NodeNetworkConfigurationPolicy
name: node-1
fieldPaths:
- spec.desiredState.interfaces.[type=ethernet].ipv4.address.0.ip
- spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.ip
- source:
kind: ConfigMap
name: network-values
Expand Down Expand Up @@ -227,7 +229,7 @@ replacements:
kind: NodeNetworkConfigurationPolicy
name: node-2
fieldPaths:
- spec.desiredState.interfaces.[type=ethernet].ipv4.address.0.ip
- spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.ip
- source:
kind: ConfigMap
name: network-values
Expand All @@ -249,7 +251,7 @@ replacements:
kind: NodeNetworkConfigurationPolicy
name: node-0
fieldPaths:
- spec.desiredState.interfaces.[type=ethernet].ipv4.address.0.prefix-length
- spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.prefix-length
- source:
kind: ConfigMap
name: network-values
Expand Down Expand Up @@ -291,7 +293,7 @@ replacements:
kind: NodeNetworkConfigurationPolicy
name: node-1
fieldPaths:
- spec.desiredState.interfaces.[type=ethernet].ipv4.address.0.prefix-length
- spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.prefix-length
- source:
kind: ConfigMap
name: network-values
Expand Down Expand Up @@ -333,7 +335,7 @@ replacements:
kind: NodeNetworkConfigurationPolicy
name: node-2
fieldPaths:
- spec.desiredState.interfaces.[type=ethernet].ipv4.address.0.prefix-length
- spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.prefix-length
- source:
kind: ConfigMap
name: network-values
Expand Down Expand Up @@ -433,9 +435,10 @@ replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.routes.config.0.next-hop-interface
fieldPath: data.bridgeName
targets:
- select:
kind: NodeNetworkConfigurationPolicy
fieldPaths:
- spec.desiredState.routes.config.0.next-hop-interface
- spec.desiredState.interfaces.[type=linux-bridge].name
14 changes: 13 additions & 1 deletion lib/nncp/ocp_node_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ spec:
id: _replaced_
mtu: 1500
- description: ctlplane interface
name: _replaced_
state: up
type: ethernet
mtu: 1500
- description: linux-bridge over ctlplane interface
ipv4:
address:
- ip: _replaced_
Expand All @@ -73,7 +78,14 @@ spec:
enabled: false
name: _replaced_
state: up
type: ethernet
type: linux-bridge
bridge:
options:
stp:
enabled: false
port:
- name: _replaced_
vlan: {}
mtu: 1500
nodeSelector:
kubernetes.io/hostname: _replaced_
Expand Down

0 comments on commit e6af03a

Please sign in to comment.