From 46f874fd641c0613909d0e57870b623617d38c28 Mon Sep 17 00:00:00 2001 From: John Fulton Date: Tue, 27 Aug 2024 18:21:35 -0400 Subject: [PATCH] Add Storage NFS network for Manila to HCI Scenario Manila tests need to connect to the share for both cephfs and ganesha tests, and they use a special (openstack) network for that [1]. This patch adds the NFS storage network (storagenfs) with VLAN 24 and range 172.21.0.0/24 in the HCI values example. The storagenfs 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 storage tests. TODO: update Manila CRDs to use this network. [1] https://opendev.org/openstack/manila-tempest-plugin/src/branch/master/manila_tempest_tests/config.py#L99 Jira: https://issues.redhat.com/browse/OSPRH-7417 Signed-off-by: John Fulton --- .../va/hci/control-plane/nncp/values.yaml | 33 +++++++ .../va/hci/edpm-pre-ceph/nodeset/values.yaml | 8 ++ lib/networking/metallb/kustomization.yaml | 22 +++++ .../metallb/metallb_l2advertisement.yaml | 11 +++ lib/networking/metallb/ocp_ip_pools.yaml | 8 ++ lib/networking/nad/kustomization.yaml | 10 +++ .../nad/ocp_networks_netattach.yaml | 8 ++ lib/nncp/kustomization.yaml | 88 +++++++++++++++++++ lib/nncp/ocp_node_template.yaml | 16 ++++ 9 files changed, 204 insertions(+) diff --git a/examples/va/hci/control-plane/nncp/values.yaml b/examples/va/hci/control-plane/nncp/values.yaml index 7597282a5..57b6dc9be 100644 --- a/examples/va/hci/control-plane/nncp/values.yaml +++ b/examples/va/hci/control-plane/nncp/values.yaml @@ -14,18 +14,21 @@ data: tenant_ip: 172.19.0.5 ctlplane_ip: 192.168.122.10 storage_ip: 172.18.0.5 + storagenfs_ip: 172.21.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 + storagenfs_ip: 172.21.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 + storagenfs_ip: 172.21.0.7 # networks ctlplane: @@ -172,6 +175,36 @@ data: gateway: 10.0.0.1 name: subnet1 mtu: 1500 + storagenfs: + dnsDomain: storagenfs.example.com + subnets: + - allocationRanges: + - end: 172.21.0.250 + start: 172.21.0.100 + cidr: 172.21.0.0/24 + gateway: 172.21.0.1 + name: subnet1 + vlan: 24 + mtu: 1500 + prefix-length: 24 + iface: storagenfs + vlan: 24 + base_iface: enp6s0 + lb_addresses: + - 172.21.0.80-172.21.0.90 + net-attach-def: | + { + "cniVersion": "0.3.1", + "name": "storagenfs", + "type": "macvlan", + "master": "storagenfs", + "ipam": { + "type": "whereabouts", + "range": "172.21.0.0/24", + "range_start": "172.21.0.100", + "range_end": "172.21.0.250" + } + } datacentre: net-attach-def: | { diff --git a/examples/va/hci/edpm-pre-ceph/nodeset/values.yaml b/examples/va/hci/edpm-pre-ceph/nodeset/values.yaml index f7fa7ed79..dbd9acf6b 100644 --- a/examples/va/hci/edpm-pre-ceph/nodeset/values.yaml +++ b/examples/va/hci/edpm-pre-ceph/nodeset/values.yaml @@ -102,6 +102,8 @@ data: subnetName: subnet1 - name: tenant subnetName: subnet1 + - name: storagenfs + subnetName: subnet1 nodes: edpm-compute-0: ansible: @@ -120,6 +122,8 @@ data: subnetName: subnet1 - name: tenant subnetName: subnet1 + - name: storagenfs + subnetName: subnet1 edpm-compute-1: ansible: ansibleHost: 192.168.122.101 @@ -137,6 +141,8 @@ data: subnetName: subnet1 - name: tenant subnetName: subnet1 + - name: storagenfs + subnetName: subnet1 edpm-compute-2: ansible: ansibleHost: 192.168.122.102 @@ -154,6 +160,8 @@ data: subnetName: subnet1 - name: tenant subnetName: subnet1 + - name: storagenfs + 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. diff --git a/lib/networking/metallb/kustomization.yaml b/lib/networking/metallb/kustomization.yaml index 02e26fab0..169468679 100644 --- a/lib/networking/metallb/kustomization.yaml +++ b/lib/networking/metallb/kustomization.yaml @@ -111,6 +111,17 @@ replacements: name: storage fieldPaths: - spec.addresses + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.lb_addresses + targets: + - select: + group: metallb.io + kind: IPAddressPool + name: storagenfs + fieldPaths: + - spec.addresses # Loadbalancer interfaces - source: @@ -157,3 +168,14 @@ replacements: name: internalapi fieldPaths: - spec.interfaces.0 + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.iface + targets: + - select: + group: metallb.io + kind: L2Advertisement + name: storagenfs + fieldPaths: + - spec.interfaces.0 diff --git a/lib/networking/metallb/metallb_l2advertisement.yaml b/lib/networking/metallb/metallb_l2advertisement.yaml index 6d80de936..2ce930db4 100644 --- a/lib/networking/metallb/metallb_l2advertisement.yaml +++ b/lib/networking/metallb/metallb_l2advertisement.yaml @@ -46,3 +46,14 @@ spec: - tenant interfaces: - _replaced_ +--- +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: storagenfs + namespace: metallb-system +spec: + ipAddressPools: + - storagenfs + interfaces: + - _replaced_ diff --git a/lib/networking/metallb/ocp_ip_pools.yaml b/lib/networking/metallb/ocp_ip_pools.yaml index 90c2a19d0..0edc58acd 100644 --- a/lib/networking/metallb/ocp_ip_pools.yaml +++ b/lib/networking/metallb/ocp_ip_pools.yaml @@ -30,3 +30,11 @@ metadata: name: tenant labels: osp/lb-addresses-type: standard +--- +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + namespace: metallb-system + name: storagenfs + labels: + osp/lb-addresses-type: standard diff --git a/lib/networking/nad/kustomization.yaml b/lib/networking/nad/kustomization.yaml index e6427d409..aee72fcee 100644 --- a/lib/networking/nad/kustomization.yaml +++ b/lib/networking/nad/kustomization.yaml @@ -63,3 +63,13 @@ replacements: name: datacentre fieldPaths: - spec.config + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.net-attach-def + targets: + - select: + kind: NetworkAttachmentDefinition + name: storagenfs + fieldPaths: + - spec.config diff --git a/lib/networking/nad/ocp_networks_netattach.yaml b/lib/networking/nad/ocp_networks_netattach.yaml index ec544c740..733758f8f 100644 --- a/lib/networking/nad/ocp_networks_netattach.yaml +++ b/lib/networking/nad/ocp_networks_netattach.yaml @@ -38,3 +38,11 @@ metadata: labels: osp/net: datacentre osp/net-attach-def-type: standard +--- +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: storagenfs + labels: + osp/net: storagenfs + osp/net-attach-def-type: standard diff --git a/lib/nncp/kustomization.yaml b/lib/nncp/kustomization.yaml index c1f6bf742..63abb1c0b 100644 --- a/lib/nncp/kustomization.yaml +++ b/lib/nncp/kustomization.yaml @@ -94,6 +94,34 @@ replacements: kind: NodeNetworkConfigurationPolicy fieldPaths: - spec.desiredState.interfaces.[name=storage].mtu + # storage must be above storagenfs or it will match and reset it + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.base_iface + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].vlan.base-iface + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.vlan + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].vlan.id + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.mtu + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].mtu # ctlplane type is ethernet (not vlan) - source: kind: ConfigMap @@ -157,6 +185,16 @@ replacements: name: node-0 fieldPaths: - spec.desiredState.interfaces.[name=storage].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_0.storagenfs_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].ipv4.address.0.ip # Static Node IPs: node-1 - source: @@ -199,6 +237,16 @@ replacements: name: node-1 fieldPaths: - spec.desiredState.interfaces.[name=storage].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_1.storagenfs_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].ipv4.address.0.ip # Static Node IPs: node-2 - source: @@ -241,6 +289,16 @@ replacements: name: node-2 fieldPaths: - spec.desiredState.interfaces.[name=storage].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_2.storagenfs_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].ipv4.address.0.ip # prefix-length: node-0 - source: @@ -283,6 +341,16 @@ replacements: name: node-0 fieldPaths: - spec.desiredState.interfaces.[name=storage].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].ipv4.address.0.prefix-length # prefix-length: node-1 - source: @@ -325,6 +393,16 @@ replacements: name: node-1 fieldPaths: - spec.desiredState.interfaces.[name=storage].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].ipv4.address.0.prefix-length # prefix-length: node-2 - source: @@ -367,6 +445,16 @@ replacements: name: node-2 fieldPaths: - spec.desiredState.interfaces.[name=storage].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagenfs.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=storagenfs].ipv4.address.0.prefix-length # Node names - source: diff --git a/lib/nncp/ocp_node_template.yaml b/lib/nncp/ocp_node_template.yaml index 6c0735c2a..9c9c417b9 100644 --- a/lib/nncp/ocp_node_template.yaml +++ b/lib/nncp/ocp_node_template.yaml @@ -62,6 +62,22 @@ spec: base-iface: _replaced_ id: _replaced_ mtu: 1500 + - description: storagenfs vlan interface + ipv4: + address: + - ip: _replaced_ + prefix-length: _replaced_ + enabled: true + dhcp: false + ipv6: + enabled: false + name: storagenfs + state: up + type: vlan + vlan: + base-iface: _replaced_ + id: _replaced_ + mtu: 1500 - description: ctlplane interface name: _replaced_ state: up