Configure networking

Configure networking

Before you proceed with the networking configuration, read MOS Reference Architecture: Networking.

This section describes how to configure persistent networking on a host with 3 NICs using the Mirantis Container Cloud L2 Templates:

  • eno1 is used as a PXE interface

  • ens3f1 and ens3f2 are used for bond0

To configure networking:

  1. Create subnets:

    ---
    apiVersion: ipam.mirantis.com/v1alpha1
    kind: Subnet
    metadata:
      labels:
        kaas.mirantis.com/provider: baremetal
        kaas.mirantis.com/region: region-one
      name: storage-backend
      namespace: child-ns
    spec:
      cidr: 10.12.0.0/24
    
    ---
    apiVersion: ipam.mirantis.com/v1alpha1
    kind: Subnet
    metadata:
      labels:
        kaas.mirantis.com/provider: baremetal
        kaas.mirantis.com/region: region-one
      name: storage-frontend
      namespace: child-ns
    spec:
      cidr: 10.12.1.0/24
    
  2. Create the openstack-example-3nic L2 template:

    Caution

    The bootstrapping engine automatically assigns an IP address to the PXE nic 0 NIC. To prevent the IP duplication during updates, do not assign the IP address manually.

    apiVersion: ipam.mirantis.com/v1alpha1
    kind: L2Template
    metadata:
      labels:
        ipam/Cluster: child-cluster
        kaas.mirantis.com/provider: baremetal
        kaas.mirantis.com/region: region-one
      name: openstack-example-3nic
      namespace: child-ns
    spec:
      autoIfMappingPrio:
      - provision
      - eno
      - ens
      - enp
      npTemplate: |-
        version: 2
        ethernets:
          {{nic 0}}:
            # IMPORTANT: Do not assign an IP address here explicitly
            # to prevent IP duplication issues. The IP will be assigned
            # automatically by the bootstrapping engine.
            # addresses: []
            match:
              macaddress: {{mac 0}}
            set-name: {{nic 0}}
            mtu: 1500
          {{nic 1}}:
            dhcp4: false
            dhcp6: false
            match:
              macaddress: {{mac 1}}
            set-name: {{nic 1}}
            mtu: 1500
          {{nic 2}}:
            dhcp4: false
            dhcp6: false
            match:
              macaddress: {{mac 2}}
            set-name: {{nic 2}}
            mtu: 1500
        bonds:
          bond0:
            interfaces:
              - {{nic 1}}
              - {{nic 2}}
        vlans:
          pr-floating:
            id: 403
            link: bond0
          stor-frontend:
            id: 404
            link: bond0
            addresses:
              - {{ip "stor-frontend:storage-frontend"}}
          stor-backend:
            id: 405
            link: bond0
            addresses:
              - {{ip "stor-backend:storage-backend"}}