Skip to content

Commit

Permalink
Add NFS network for Manila to uni04delta
Browse files Browse the repository at this point in the history
Manila Tempest tests need to connect to the share
for Ganesha via a special (openstack) network [1].

This patch adds the NFS storage network with VLAN
24 and range 172.21.0.0/24 in uni04delta. The NFS
network is connected to Ceph and Compute EDPM nodes.
A NNCP, NAD, L2Advertisement and IPAddressPool are
defined for the NFS network so that a pod in k8s can
connect to it; such as the tempest pod which will
perform the storage tests and the manilaShares pod(s).

[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
Depends-On: openstack-k8s-operators/ci-framework#2273

Signed-off-by: John Fulton <[email protected]>
  • Loading branch information
fultonj committed Sep 20, 2024
1 parent 21ece11 commit 4144ba8
Show file tree
Hide file tree
Showing 15 changed files with 348 additions and 1 deletion.
1 change: 1 addition & 0 deletions dt/uni04delta/edpm-pre-ceph/nodeset/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ transformers:
components:
- ../../../../lib/dataplane/nodeset
- ../../../../dt/uni04delta/nodeset/ceph

patches:
- target:
Expand Down
1 change: 1 addition & 0 deletions dt/uni04delta/edpm/nodeset/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ transformers:
components:
- ../../../../lib/control-plane
- ../../../../lib/dataplane/nodeset
- ../../../../dt/uni04delta/nodeset/compute

resources:
- ceph_secret.yaml
Expand Down
3 changes: 3 additions & 0 deletions dt/uni04delta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ transformers:
components:
- ../../lib/networking/metallb
- networking/metallb
- ../../lib/networking/netconfig
- networking/netconfig
- ../../lib/networking/nad
- networking/nad
- ../../lib/control-plane

patches:
Expand Down
36 changes: 36 additions & 0 deletions dt/uni04delta/networking/metallb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- metallb_l2advertisement.yaml
- ocp_ip_pools.yaml

replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.lb_addresses
targets:
- select:
group: metallb.io
kind: IPAddressPool
name: nfs
fieldPaths:
- spec.addresses
options:
create: true

- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.iface
targets:
- select:
group: metallb.io
kind: L2Advertisement
name: nfs
fieldPaths:
- spec.interfaces.0
options:
create: true
11 changes: 11 additions & 0 deletions dt/uni04delta/networking/metallb/metallb_l2advertisement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: nfs
namespace: metallb-system
spec:
ipAddressPools:
- nfs
interfaces:
- _replaced_
8 changes: 8 additions & 0 deletions dt/uni04delta/networking/metallb/ocp_ip_pools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
namespace: metallb-system
name: nfs
labels:
osp/lb-addresses-type: standard
35 changes: 35 additions & 0 deletions dt/uni04delta/networking/nad/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
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
resources:
- ocp_networks_netattach.yaml

replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: nfs
fieldPaths:
- spec.config
options:
create: true
8 changes: 8 additions & 0 deletions dt/uni04delta/networking/nad/ocp_networks_netattach.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: nfs
labels:
osp/net: nfs
osp/net-attach-def-type: standard
45 changes: 45 additions & 0 deletions dt/uni04delta/networking/netconfig/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patches:
- target:
kind: NetConfig
patch: |-
- op: add
path: /spec/networks/-
value:
name: nfs
dnsDomain: _replaced_
mtu: _replaced_
subnets:
- _replaced_
replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.dnsDomain
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=nfs].dnsDomain
- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.mtu
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=nfs].mtu
- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.subnets
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=nfs].subnets
111 changes: 111 additions & 0 deletions dt/uni04delta/nncp/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
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/nncp

patches:
- target:
kind: NodeNetworkConfigurationPolicy
labelSelector: "osp/nncm-config-type=standard"
patch: |-
- op: add
path: /spec/desiredState/interfaces/-
value:
description: nfs vlan interface
ipv4:
address:
- ip: _replaced_
prefix-length: _replaced_
enabled: true
dhcp: false
ipv6:
enabled: false
name: nfs
state: up
type: vlan
vlan:
base-iface: _replaced_
id: _replaced_
mtu: 1500
replacements:

- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.base_iface
targets:
- select:
kind: NodeNetworkConfigurationPolicy
fieldPaths:
- spec.desiredState.interfaces.[name=nfs].vlan.base-iface

- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.vlan
targets:
- select:
kind: NodeNetworkConfigurationPolicy
fieldPaths:
- spec.desiredState.interfaces.[name=nfs].vlan.id

- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_0.nfs_ip
targets:
- select:
kind: NodeNetworkConfigurationPolicy
labelSelector: "osp/nncm-node=0"
fieldPaths:
- spec.desiredState.interfaces.[name=nfs].ipv4.address.0.ip

- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_1.nfs_ip
targets:
- select:
kind: NodeNetworkConfigurationPolicy
labelSelector: "osp/nncm-node=1"
fieldPaths:
- spec.desiredState.interfaces.[name=nfs].ipv4.address.0.ip

- source:
kind: ConfigMap
name: network-values
fieldPath: data.node_2.nfs_ip
targets:
- select:
kind: NodeNetworkConfigurationPolicy
labelSelector: "osp/nncm-node=2"
fieldPaths:
- spec.desiredState.interfaces.[name=nfs].ipv4.address.0.ip

- source:
kind: ConfigMap
name: network-values
fieldPath: data.nfs.prefix-length
targets:
- select:
kind: NodeNetworkConfigurationPolicy
fieldPaths:
- spec.desiredState.interfaces.[name=nfs].ipv4.address.0.prefix-length
28 changes: 28 additions & 0 deletions dt/uni04delta/nodeset/ceph/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patches:
- target:
kind: OpenStackDataPlaneNodeSet
patch: |-
- op: add
path: /spec/nodeTemplate/networks/-
value:
name: nfs
subnetName: subnet1
- op: add
path: /spec/nodes/edpm-ceph-0/networks/-
value:
name: nfs
subnetName: subnet1
- op: add
path: /spec/nodes/edpm-ceph-1/networks/-
value:
name: nfs
subnetName: subnet1
- op: add
path: /spec/nodes/edpm-ceph-2/networks/-
value:
name: nfs
subnetName: subnet1
23 changes: 23 additions & 0 deletions dt/uni04delta/nodeset/compute/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patches:
- target:
kind: OpenStackDataPlaneNodeSet
patch: |-
- op: add
path: /spec/nodeTemplate/networks/-
value:
name: nfs
subnetName: subnet1
- op: add
path: /spec/nodes/edpm-compute-0/networks/-
value:
name: nfs
subnetName: subnet1
- op: add
path: /spec/nodes/edpm-compute-1/networks/-
value:
name: nfs
subnetName: subnet1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ transformers:
create: true
components:
- ../../../../../lib/nncp
- ../../../../../dt/uni04delta/nncp

resources:
- values.yaml
Loading

0 comments on commit 4144ba8

Please sign in to comment.