From 0471e628eef56402ec5c2fa207589dfec98f0f83 Mon Sep 17 00:00:00 2001 From: John Fulton Date: Tue, 13 Aug 2024 15:49:38 -0400 Subject: [PATCH] Add Swift network for RGW to HCI scenario 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. Signed-off-by: John Fulton --- .../hci/control-plane/nncp/kustomization.yaml | 2 +- .../va/hci/control-plane/nncp/values.yaml | 33 ++ .../va/hci/edpm-pre-ceph/nodeset/values.yaml | 8 + va/hci/kustomization.yaml | 6 +- va/hci/networking/kustomization.yaml | 8 + va/hci/networking/metallb/kustomization.yaml | 181 ++++++ .../metallb/metallb_l2advertisement.yaml | 59 ++ .../metallb/ocp_ip_pool_template.yaml | 7 + va/hci/networking/metallb/ocp_ip_pools.yaml | 40 ++ va/hci/networking/nad/kustomization.yaml | 75 +++ .../networking/nad/ocp_network_template.yaml | 8 + .../nad/ocp_networks_netattach.yaml | 48 ++ .../networking/netconfig/kustomization.yaml | 148 +++++ va/hci/networking/netconfig/netconfig.yaml | 38 ++ va/hci/nncp/kustomization.yaml | 523 ++++++++++++++++++ va/hci/nncp/ocp_node_template.yaml | 108 ++++ va/hci/nncp/ocp_nodes_nncp.yaml | 21 + 17 files changed, 1309 insertions(+), 4 deletions(-) create mode 100644 va/hci/networking/kustomization.yaml create mode 100644 va/hci/networking/metallb/kustomization.yaml create mode 100644 va/hci/networking/metallb/metallb_l2advertisement.yaml create mode 100644 va/hci/networking/metallb/ocp_ip_pool_template.yaml create mode 100644 va/hci/networking/metallb/ocp_ip_pools.yaml create mode 100644 va/hci/networking/nad/kustomization.yaml create mode 100644 va/hci/networking/nad/ocp_network_template.yaml create mode 100644 va/hci/networking/nad/ocp_networks_netattach.yaml create mode 100644 va/hci/networking/netconfig/kustomization.yaml create mode 100644 va/hci/networking/netconfig/netconfig.yaml create mode 100644 va/hci/nncp/kustomization.yaml create mode 100644 va/hci/nncp/ocp_node_template.yaml create mode 100644 va/hci/nncp/ocp_nodes_nncp.yaml diff --git a/examples/va/hci/control-plane/nncp/kustomization.yaml b/examples/va/hci/control-plane/nncp/kustomization.yaml index c92bc55fa..fa0eb59ec 100644 --- a/examples/va/hci/control-plane/nncp/kustomization.yaml +++ b/examples/va/hci/control-plane/nncp/kustomization.yaml @@ -18,7 +18,7 @@ transformers: create: true components: - - ../../../../../lib/nncp + - ../../../../../va/hci/nncp resources: - values.yaml diff --git a/examples/va/hci/control-plane/nncp/values.yaml b/examples/va/hci/control-plane/nncp/values.yaml index 7597282a5..b81469b39 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 + 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: @@ -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: | { diff --git a/examples/va/hci/edpm-pre-ceph/nodeset/values.yaml b/examples/va/hci/edpm-pre-ceph/nodeset/values.yaml index f7fa7ed79..bd9319f8e 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: swift + subnetName: subnet1 nodes: edpm-compute-0: ansible: @@ -120,6 +122,8 @@ data: subnetName: subnet1 - name: tenant subnetName: subnet1 + - name: swift + subnetName: subnet1 edpm-compute-1: ansible: ansibleHost: 192.168.122.101 @@ -137,6 +141,8 @@ data: subnetName: subnet1 - name: tenant subnetName: subnet1 + - name: swift + subnetName: subnet1 edpm-compute-2: ansible: ansibleHost: 192.168.122.102 @@ -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. diff --git a/va/hci/kustomization.yaml b/va/hci/kustomization.yaml index a9f72e689..8228ac05c 100644 --- a/va/hci/kustomization.yaml +++ b/va/hci/kustomization.yaml @@ -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 diff --git a/va/hci/networking/kustomization.yaml b/va/hci/networking/kustomization.yaml new file mode 100644 index 000000000..c11ba267d --- /dev/null +++ b/va/hci/networking/kustomization.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +components: + - metallb + - nad + - netconfig diff --git a/va/hci/networking/metallb/kustomization.yaml b/va/hci/networking/metallb/kustomization.yaml new file mode 100644 index 000000000..551d064bd --- /dev/null +++ b/va/hci/networking/metallb/kustomization.yaml @@ -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 diff --git a/va/hci/networking/metallb/metallb_l2advertisement.yaml b/va/hci/networking/metallb/metallb_l2advertisement.yaml new file mode 100644 index 000000000..f9847eb95 --- /dev/null +++ b/va/hci/networking/metallb/metallb_l2advertisement.yaml @@ -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_ diff --git a/va/hci/networking/metallb/ocp_ip_pool_template.yaml b/va/hci/networking/metallb/ocp_ip_pool_template.yaml new file mode 100644 index 000000000..e755d9f31 --- /dev/null +++ b/va/hci/networking/metallb/ocp_ip_pool_template.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + name: _ignored_ +spec: + addresses: [] diff --git a/va/hci/networking/metallb/ocp_ip_pools.yaml b/va/hci/networking/metallb/ocp_ip_pools.yaml new file mode 100644 index 000000000..683500d66 --- /dev/null +++ b/va/hci/networking/metallb/ocp_ip_pools.yaml @@ -0,0 +1,40 @@ +--- +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + namespace: metallb-system + name: ctlplane + labels: + osp/lb-addresses-type: standard +--- +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + namespace: metallb-system + name: internalapi + labels: + osp/lb-addresses-type: standard +--- +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + namespace: metallb-system + name: storage + labels: + osp/lb-addresses-type: standard +--- +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + namespace: metallb-system + name: tenant + labels: + osp/lb-addresses-type: standard +--- +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + namespace: metallb-system + name: swift + labels: + osp/lb-addresses-type: standard diff --git a/va/hci/networking/nad/kustomization.yaml b/va/hci/networking/nad/kustomization.yaml new file mode 100644 index 000000000..db5ec9551 --- /dev/null +++ b/va/hci/networking/nad/kustomization.yaml @@ -0,0 +1,75 @@ +--- +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: + - ocp_networks_netattach.yaml + +patches: + - target: + kind: NetworkAttachmentDefinition + labelSelector: "osp/net-attach-def-type=standard" + path: ocp_network_template.yaml + +replacements: + # NetworkAttachmentDefinition JSON config + - source: + kind: ConfigMap + name: network-values + fieldPath: data.ctlplane.net-attach-def + targets: + - select: + kind: NetworkAttachmentDefinition + name: ctlplane + fieldPaths: + - spec.config + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.net-attach-def + targets: + - select: + kind: NetworkAttachmentDefinition + name: internalapi + fieldPaths: + - spec.config + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.net-attach-def + targets: + - select: + kind: NetworkAttachmentDefinition + name: storage + fieldPaths: + - spec.config + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.net-attach-def + targets: + - select: + kind: NetworkAttachmentDefinition + 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 + - source: + kind: ConfigMap + name: network-values + fieldPath: data.swift.net-attach-def + targets: + - select: + kind: NetworkAttachmentDefinition + name: swift + fieldPaths: + - spec.config diff --git a/va/hci/networking/nad/ocp_network_template.yaml b/va/hci/networking/nad/ocp_network_template.yaml new file mode 100644 index 000000000..29f6deaf6 --- /dev/null +++ b/va/hci/networking/nad/ocp_network_template.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: nmstate.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: _ignored_ +spec: + config: | + _replaced_ diff --git a/va/hci/networking/nad/ocp_networks_netattach.yaml b/va/hci/networking/nad/ocp_networks_netattach.yaml new file mode 100644 index 000000000..304302fb1 --- /dev/null +++ b/va/hci/networking/nad/ocp_networks_netattach.yaml @@ -0,0 +1,48 @@ +--- +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: ctlplane + labels: + osp/net: ctlplane + osp/net-attach-def-type: standard +--- +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: internalapi + labels: + osp/net: internalapi + osp/net-attach-def-type: standard +--- +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: storage + labels: + osp/net: storage + osp/net-attach-def-type: standard +--- +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: tenant + 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 +--- +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: swift + labels: + osp/net: swift + osp/net-attach-def-type: standard diff --git a/va/hci/networking/netconfig/kustomization.yaml b/va/hci/networking/netconfig/kustomization.yaml new file mode 100644 index 000000000..db4066831 --- /dev/null +++ b/va/hci/networking/netconfig/kustomization.yaml @@ -0,0 +1,148 @@ +--- +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: + - netconfig.yaml + +replacements: + # NetConfig dnsDomain + - source: + kind: ConfigMap + name: network-values + fieldPath: data.ctlplane.dnsDomain + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=ctlplane].dnsDomain + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.dnsDomain + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=internalapi].dnsDomain + - source: + kind: ConfigMap + name: network-values + fieldPath: data.external.dnsDomain + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=external].dnsDomain + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.dnsDomain + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=storage].dnsDomain + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.dnsDomain + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=tenant].dnsDomain + + # NetConfig MTU + - source: + kind: ConfigMap + name: network-values + fieldPath: data.ctlplane.mtu + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=ctlplane].mtu + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.mtu + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=internalapi].mtu + - source: + kind: ConfigMap + name: network-values + fieldPath: data.external.mtu + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=external].mtu + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.mtu + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=storage].mtu + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.mtu + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=tenant].mtu + + # NetConfig subnets + - source: + kind: ConfigMap + name: network-values + fieldPath: data.ctlplane.subnets + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=ctlplane].subnets + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.subnets + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=internalapi].subnets + - source: + kind: ConfigMap + name: network-values + fieldPath: data.external.subnets + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=external].subnets + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.subnets + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=storage].subnets + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.subnets + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=tenant].subnets diff --git a/va/hci/networking/netconfig/netconfig.yaml b/va/hci/networking/netconfig/netconfig.yaml new file mode 100644 index 000000000..5753c8115 --- /dev/null +++ b/va/hci/networking/netconfig/netconfig.yaml @@ -0,0 +1,38 @@ +--- +apiVersion: network.openstack.org/v1beta1 +kind: NetConfig +metadata: + name: netconfig + namespace: openstack +spec: + networks: + - dnsDomain: _replaced_ + name: ctlplane + subnets: + - _replaced_ + mtu: 1500 + - dnsDomain: _replaced_ + name: internalapi + subnets: + - _replaced_ + mtu: 1500 + - dnsDomain: _replaced_ + name: external + subnets: + - _replaced_ + mtu: 1500 + - dnsDomain: _replaced_ + name: storage + subnets: + - _replaced_ + mtu: 1500 + - dnsDomain: _replaced_ + name: tenant + subnets: + - _replaced_ + mtu: 1500 + - dnsDomain: _replaced_ + name: swift + subnets: + - _replaced_ + mtu: 1500 diff --git a/va/hci/nncp/kustomization.yaml b/va/hci/nncp/kustomization.yaml new file mode 100644 index 000000000..af82ab685 --- /dev/null +++ b/va/hci/nncp/kustomization.yaml @@ -0,0 +1,523 @@ +--- +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: + - ocp_nodes_nncp.yaml + +patches: + - target: + kind: NodeNetworkConfigurationPolicy + labelSelector: "osp/nncm-config-type=standard" + path: ocp_node_template.yaml + +replacements: + # Common network interfaces and vlans + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.base_iface + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].vlan.base-iface + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.vlan + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].vlan.id + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.mtu + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].mtu + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.base_iface + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].vlan.base-iface + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.vlan + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].vlan.id + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.mtu + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].mtu + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.base_iface + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=storage].vlan.base-iface + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.vlan + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=storage].vlan.id + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.mtu + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=storage].mtu + # storage must be above swift or it will match and reset it + - source: + kind: ConfigMap + name: network-values + fieldPath: data.swift.base_iface + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=swift].vlan.base-iface + - source: + kind: ConfigMap + name: network-values + fieldPath: data.swift.vlan + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=swift].vlan.id + - source: + kind: ConfigMap + name: network-values + fieldPath: data.swift.mtu + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[name=swift].mtu + # ctlplane type is ethernet (not vlan) + - source: + kind: ConfigMap + name: network-values + fieldPath: data.ctlplane.iface + targets: + - select: + 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 + fieldPath: data.ctlplane.mtu + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[type=ethernet].mtu + - spec.desiredState.interfaces.[type=linux-bridge].mtu + + # Static Node IPs: node-0 + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_0.internalapi_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_0.tenant_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_0.ctlplane_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_0.storage_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=storage].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_0.swift_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=swift].ipv4.address.0.ip + + # Static Node IPs: node-1 + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_1.internalapi_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_1.tenant_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_1.ctlplane_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_1.storage_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=storage].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_1.swift_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=swift].ipv4.address.0.ip + + # Static Node IPs: node-2 + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_2.internalapi_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_2.tenant_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_2.ctlplane_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_2.storage_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=storage].ipv4.address.0.ip + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_2.swift_ip + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=swift].ipv4.address.0.ip + + # prefix-length: node-0 + - source: + kind: ConfigMap + name: network-values + fieldPath: data.ctlplane.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=storage].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.swift.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - spec.desiredState.interfaces.[name=swift].ipv4.address.0.prefix-length + + # prefix-length: node-1 + - source: + kind: ConfigMap + name: network-values + fieldPath: data.ctlplane.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=storage].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.swift.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - spec.desiredState.interfaces.[name=swift].ipv4.address.0.prefix-length + + # prefix-length: node-2 + - source: + kind: ConfigMap + name: network-values + fieldPath: data.ctlplane.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[type=linux-bridge].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.internalapi.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=internalapi].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.tenant.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=tenant].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storage.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=storage].ipv4.address.0.prefix-length + - source: + kind: ConfigMap + name: network-values + fieldPath: data.swift.prefix-length + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - spec.desiredState.interfaces.[name=swift].ipv4.address.0.prefix-length + + # Node names + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_0.name + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-0 + fieldPaths: + - metadata.name + - spec.nodeSelector.[kubernetes.io/hostname] + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_1.name + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-1 + fieldPaths: + - metadata.name + - spec.nodeSelector.[kubernetes.io/hostname] + - source: + kind: ConfigMap + name: network-values + fieldPath: data.node_2.name + targets: + - select: + kind: NodeNetworkConfigurationPolicy + name: node-2 + fieldPaths: + - metadata.name + - spec.nodeSelector.[kubernetes.io/hostname] + + # DNS + - source: + kind: ConfigMap + name: network-values + fieldPath: data.dns-resolver.config + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.dns-resolver.config + + # Routes + - source: + kind: ConfigMap + name: network-values + fieldPath: data.routes + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.routes + - source: + kind: ConfigMap + name: network-values + fieldPath: data.bridgeName + targets: + - select: + kind: NodeNetworkConfigurationPolicy + fieldPaths: + - spec.desiredState.interfaces.[type=linux-bridge].name diff --git a/va/hci/nncp/ocp_node_template.yaml b/va/hci/nncp/ocp_node_template.yaml new file mode 100644 index 000000000..6905297b2 --- /dev/null +++ b/va/hci/nncp/ocp_node_template.yaml @@ -0,0 +1,108 @@ +--- +apiVersion: nmstate.io/v1 +kind: NodeNetworkConfigurationPolicy +metadata: + name: _ignored_ +spec: + desiredState: + dns-resolver: + config: + search: [] + server: [] + routes: + config: [] + route-rules: + config: [] + interfaces: + - description: internalapi vlan interface + ipv4: + address: + - ip: _replaced_ + prefix-length: _replaced_ + enabled: true + dhcp: false + ipv6: + enabled: false + name: internalapi + state: up + type: vlan + vlan: + base-iface: _replaced_ + id: _replaced_ + mtu: 1500 + - description: storage vlan interface + ipv4: + address: + - ip: _replaced_ + prefix-length: _replaced_ + enabled: true + dhcp: false + ipv6: + enabled: false + name: storage + state: up + type: vlan + vlan: + base-iface: _replaced_ + id: _replaced_ + mtu: 1500 + - description: tenant vlan interface + ipv4: + address: + - ip: _replaced_ + prefix-length: _replaced_ + enabled: true + dhcp: false + ipv6: + enabled: false + name: tenant + state: up + type: vlan + vlan: + base-iface: _replaced_ + id: _replaced_ + mtu: 1500 + - description: swift vlan interface + ipv4: + address: + - ip: _replaced_ + prefix-length: _replaced_ + enabled: true + dhcp: false + ipv6: + enabled: false + name: swift + state: up + type: vlan + vlan: + base-iface: _replaced_ + 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_ + prefix-length: _replaced_ + enabled: true + dhcp: false + ipv6: + enabled: false + name: _replaced_ + state: up + type: linux-bridge + bridge: + options: + stp: + enabled: false + port: + - name: _replaced_ + vlan: {} + mtu: 1500 + nodeSelector: + kubernetes.io/hostname: _replaced_ + node-role.kubernetes.io/worker: "" diff --git a/va/hci/nncp/ocp_nodes_nncp.yaml b/va/hci/nncp/ocp_nodes_nncp.yaml new file mode 100644 index 000000000..1fd174705 --- /dev/null +++ b/va/hci/nncp/ocp_nodes_nncp.yaml @@ -0,0 +1,21 @@ +--- +apiVersion: nmstate.io/v1 +kind: NodeNetworkConfigurationPolicy +metadata: + name: node-0 + labels: + osp/nncm-config-type: standard +--- +apiVersion: nmstate.io/v1 +kind: NodeNetworkConfigurationPolicy +metadata: + name: node-1 + labels: + osp/nncm-config-type: standard +--- +apiVersion: nmstate.io/v1 +kind: NodeNetworkConfigurationPolicy +metadata: + name: node-2 + labels: + osp/nncm-config-type: standard