Create Kubernetes manager node L2 template

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

  • PXE network

  • LCM network

Caution

If you plan to deploy MOS cluster with the compact control plane option, skip this section entirely and proceed with Create MOS controller node L2 template.

To create an L2 template for Kubernetes manager nodes:

  1. Create or open the mos-l2templates.yml file that contains the L2 templates you are preparing.

  2. Add an L2 template using the following example. Adjust the values of specific parameters according to the specifications of your environment.

    L2 template example
    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: k8s-manager
      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: ""
      npTemplate: |-
        version: 2
        ethernets:
          {{nic 0}}:
            dhcp4: false
            dhcp6: false
            match:
              macaddress: {{mac 0}}
            set-name: {{nic 0}}
            mtu: 9000
          {{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 0}}
            - {{nic 1}}
        vlans:
          k8s-lcm-v:
            id: 403
            link: bond0
            mtu: 9000
          k8s-ext-v:
            id: 409
            link: bond0
            mtu: 9000
          k8s-pods-v:
            id: 408
            link: bond0
            mtu: 9000
        bridges:
          k8s-lcm:
            interfaces: [k8s-lcm-v]
            nameservers:
              addresses: {{nameservers_from_subnet "lcm-nw"}}
            gateway4: {{ gateway_from_subnet "lcm-nw" }}
            addresses:
            - {{ ip "0:lcm-nw" }}
          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
    
  3. Proceed with Create MOS controller node L2 template. The resulting L2 template will be used to render the netplan configuration for the managed cluster machines.