Create MOS storage node L2 template

According to the reference architecture, MOS storage nodes in the MOS managed cluster must be connected to the following networks:

  • PXE network

  • LCM network

  • Storage access network

  • Storage replication network

To create an L2 template for MOS storage nodes:

  1. Add an L2 template to the mos-l2templates.yml file using the following example. Adjust the values of parameters according to the specification of your environment.

    Example of an L2 template for MOS storage nodes
    apiVersion: ipam.mirantis.com/v1alpha1
    kind: L2Template
    metadata:
      labels:
        kaas.mirantis.com/provider: baremetal
        kaas.mirantis.com/region: region-one
        cluster.sigs.k8s.io/cluster-name: <MOSClusterName>
      name: mos-storage
      namespace: <MOSClusterNamespace>
    spec:
      autoIfMappingPrio:
      - provision
      - eno
      - ens
      - enp
      clusterRef: <MOSClusterName>
      l3Layout:
      - subnetName: lcm-nw
        scope: global
        labelSelector:
          kaas.mirantis.com/provider: baremetal
          kaas-mgmt-subnet: ""
      - subnetName: k8s-ext-subnet
        scope: namespace
      - subnetName: k8s-pods-subnet
        scope: namespace
      - subnetName: ceph-cluster-subnet
        scope: namespace
      - subnetName: ceph-public-subnet
        scope: namespace
      npTemplate: |-
        version: 2
        ethernets:
          {{nic 0}}:
            nameservers:
              addresses: {{nameservers_from_subnet "lcm-nw"}}
            match:
              macaddress: {{mac 0}}
            set-name: {{nic 0}}
            mtu: 1500
            gateway4: {{ gateway_from_subnet "lcm-nw" }}
            addresses:
            - {{ ip "0:lcm-nw" }}
            dhcp4: false
            dhcp6: false
          {{nic 1}}:
            dhcp4: false
            dhcp6: false
            match:
              macaddress: {{mac 1}}
            set-name: {{nic 1}}
            mtu: 9000
          {{nic 2}}
            dhcp4: false
            dhcp6: false
            match:
              macaddress: {{mac 2}}
            set-name: {{nic 2}}
            mtu: 9000
          {{nic 3}}:
            dhcp4: false
            dhcp6: false
            match:
              macaddress: {{mac 3}}
            set-name: {{nic 3}}
            mtu: 9000
        bonds:
          bond0:
            mtu: 9000
            parameters:
              mode: 802.3ad
            interfaces:
            - {{nic 2}}
            - {{nic 3}}
        vlans:
          k8s-ext-v:
            id: 409
            link: bond0
            mtu: 9000
          k8s-pods-v:
            id: 408
            link: bond0
            mtu: 9000
          stor-frontend:
            id: 404
            link: bond0
            mtu: 9000
          stor-backend:
            id: 405
            link: bond0
            mtu: 9000
        bridges:
          k8s-ext:
            interfaces: [k8s-ext-v]
            addresses:
            - {{ip "k8s-ext:k8s-ext-subnet"}}
            mtu: 9000
          k8s-pods:
            interfaces: [k8s-pods-v]
            addresses:
            - {{ip "k8s-pods:k8s-pods-subnet"}}
            mtu: 9000
          ceph-cluster:
            interfaces: [stor-backend]
            addresses:
            - {{ip "ceph-cluster:ceph-cluster-subnet"}}
            mtu: 9000
          ceph-public:
            interfaces: [stor-frontend]
            addresses:
            - {{ip "ceph-public:ceph-public-subnet"}}
            mtu: 9000
    
  2. Proceed with Apply and check L2 templates.