Skip to content

Commit

Permalink
Add Swift network for RGW to HCI scenario
Browse files Browse the repository at this point in the history
When Ceph RGW is used, an endpoint for Swift storage is
hosted not in a pod on k8s but on an EDPM node. Thus, a
service hosted on an EDPM node will need to be accessed
by cloud users from a separate network.

This patch adds the Swift storage network (swift) with
VLAN 25 and range 172.22.0.0/24 in the HCI values example.
The Swift network is configured on the HCI EDPM nodes
and an NNCP, NAD, L2Advertisement and IPAddressPool are
defined so that a pod in k8s can connect to it; such as
the tempest pod which will perform object storage tests.

In order to make these changes va/hci now keeps its own
copy of the nncp and networking directories since they
differ (by the new network) from the generic ones in the
lib directory.

Jira: https://issues.redhat.com/browse/OSPRH-6675
Depends-On: openstack-k8s-operators/ci-framework#2301

Signed-off-by: John Fulton <[email protected]>
  • Loading branch information
fultonj committed Sep 17, 2024
1 parent 21ece11 commit 7051954
Show file tree
Hide file tree
Showing 17 changed files with 1,335 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/va/hci/control-plane/nncp/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ transformers:
create: true
components:
- ../../../../../lib/nncp
- ../../../../../va/hci/nncp

resources:
- values.yaml
33 changes: 33 additions & 0 deletions examples/va/hci/control-plane/nncp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ data:
tenant_ip: 172.19.0.5
ctlplane_ip: 192.168.122.10
storage_ip: 172.18.0.5
swift_ip: 172.22.0.5
node_1:
name: ostest-master-1
internalapi_ip: 172.17.0.6
tenant_ip: 172.19.0.6
ctlplane_ip: 192.168.122.11
storage_ip: 172.18.0.6
swift_ip: 172.22.0.6
node_2:
name: ostest-master-2
internalapi_ip: 172.17.0.7
tenant_ip: 172.19.0.7
ctlplane_ip: 192.168.122.12
storage_ip: 172.18.0.7
swift_ip: 172.22.0.7

# networks
ctlplane:
Expand Down Expand Up @@ -172,6 +175,36 @@ data:
gateway: 10.0.0.1
name: subnet1
mtu: 1500
swift:
dnsDomain: swift.example.com
subnets:
- allocationRanges:
- end: 172.22.0.250
start: 172.22.0.100
cidr: 172.22.0.0/24
gateway: 172.22.0.1
name: subnet1
vlan: 25
mtu: 1500
prefix-length: 24
iface: swift
vlan: 25
base_iface: enp6s0
lb_addresses:
- 172.22.0.80-172.22.0.90
net-attach-def: |
{
"cniVersion": "0.3.1",
"name": "swift",
"type": "macvlan",
"master": "swift",
"ipam": {
"type": "whereabouts",
"range": "172.22.0.0/24",
"range_start": "172.22.0.100",
"range_end": "172.22.0.250"
}
}
datacentre:
net-attach-def: |
{
Expand Down
8 changes: 8 additions & 0 deletions examples/va/hci/edpm-pre-ceph/nodeset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ data:
subnetName: subnet1
- name: tenant
subnetName: subnet1
- name: swift
subnetName: subnet1
nodes:
edpm-compute-0:
ansible:
Expand All @@ -120,6 +122,8 @@ data:
subnetName: subnet1
- name: tenant
subnetName: subnet1
- name: swift
subnetName: subnet1
edpm-compute-1:
ansible:
ansibleHost: 192.168.122.101
Expand All @@ -137,6 +141,8 @@ data:
subnetName: subnet1
- name: tenant
subnetName: subnet1
- name: swift
subnetName: subnet1
edpm-compute-2:
ansible:
ansibleHost: 192.168.122.102
Expand All @@ -154,6 +160,8 @@ data:
subnetName: subnet1
- name: tenant
subnetName: subnet1
- name: swift
subnetName: subnet1
# The nova-custom-ceph service is omitted since it is not yet
# defined. It will be defined and set after Ceph is deployed.
# See deployment servicesOverride for effective services list.
Expand Down
6 changes: 3 additions & 3 deletions va/hci/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ transformers:
create: true
components:
- ../../lib/networking/metallb
- ../../lib/networking/netconfig
- ../../lib/networking/nad
- networking/metallb
- networking/netconfig
- networking/nad
- ../../lib/control-plane

# Add storagemgmt network template, as it is needed for CephHCI
Expand Down
8 changes: 8 additions & 0 deletions va/hci/networking/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

components:
- metallb
- nad
- netconfig
181 changes: 181 additions & 0 deletions va/hci/networking/metallb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- metallb_l2advertisement.yaml
- ocp_ip_pools.yaml

patches:
- target:
kind: IPAddressPool
labelSelector: "osp/lb-addresses-type=standard"
path: ocp_ip_pool_template.yaml

replacements:
# IPAddressPool addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.ctlplane.lb_addresses
targets:
- select:
kind: IPAddressPool
name: ctlplane
fieldPaths:
- spec.addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.internalapi.lb_addresses
targets:
- select:
kind: IPAddressPool
name: internalapi
fieldPaths:
- spec.addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storage.lb_addresses
targets:
- select:
kind: IPAddressPool
name: storage
fieldPaths:
- spec.addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.tenant.lb_addresses
targets:
- select:
kind: IPAddressPool
name: tenant
fieldPaths:
- spec.addresses

# Loadbalancer address pools
- source:
kind: ConfigMap
name: network-values
fieldPath: data.ctlplane.lb_addresses
targets:
- select:
group: metallb.io
kind: IPAddressPool
name: ctlplane
fieldPaths:
- spec.addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.internalapi.lb_addresses
targets:
- select:
group: metallb.io
kind: IPAddressPool
name: internalapi
fieldPaths:
- spec.addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.tenant.lb_addresses
targets:
- select:
group: metallb.io
kind: IPAddressPool
name: tenant
fieldPaths:
- spec.addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.ctlplane.lb_addresses
targets:
- select:
group: metallb.io
kind: IPAddressPool
name: ctlplane
fieldPaths:
- spec.addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storage.lb_addresses
targets:
- select:
group: metallb.io
kind: IPAddressPool
name: storage
fieldPaths:
- spec.addresses
- source:
kind: ConfigMap
name: network-values
fieldPath: data.swift.lb_addresses
targets:
- select:
group: metallb.io
kind: IPAddressPool
name: swift
fieldPaths:
- spec.addresses

# Loadbalancer interfaces
- source:
kind: ConfigMap
name: network-values
fieldPath: data.bridgeName
targets:
- select:
group: metallb.io
kind: L2Advertisement
name: ctlplane
fieldPaths:
- spec.interfaces.0
- source:
kind: ConfigMap
name: network-values
fieldPath: data.tenant.iface
targets:
- select:
group: metallb.io
kind: L2Advertisement
name: tenant
fieldPaths:
- spec.interfaces.0
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storage.iface
targets:
- select:
group: metallb.io
kind: L2Advertisement
name: storage
fieldPaths:
- spec.interfaces.0
- source:
kind: ConfigMap
name: network-values
fieldPath: data.internalapi.iface
targets:
- select:
group: metallb.io
kind: L2Advertisement
name: internalapi
fieldPaths:
- spec.interfaces.0
- source:
kind: ConfigMap
name: network-values
fieldPath: data.swift.iface
targets:
- select:
group: metallb.io
kind: L2Advertisement
name: swift
fieldPaths:
- spec.interfaces.0
59 changes: 59 additions & 0 deletions va/hci/networking/metallb/metallb_l2advertisement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
# Additional advertisements can be added here if needed for other networks
#

---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: ctlplane
namespace: metallb-system
spec:
ipAddressPools:
- ctlplane
interfaces:
- _replaced_
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: internalapi
namespace: metallb-system
spec:
ipAddressPools:
- internalapi
interfaces:
- _replaced_
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: storage
namespace: metallb-system
spec:
ipAddressPools:
- storage
interfaces:
- _replaced_
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: tenant
namespace: metallb-system
spec:
ipAddressPools:
- tenant
interfaces:
- _replaced_
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: swift
namespace: metallb-system
spec:
ipAddressPools:
- swift
interfaces:
- _replaced_
7 changes: 7 additions & 0 deletions va/hci/networking/metallb/ocp_ip_pool_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: _ignored_
spec:
addresses: []
Loading

0 comments on commit 7051954

Please sign in to comment.