IpamHost

This section describes the IpamHost resource used in Mirantis Container Cloud API. The kaas-ipam controller monitors the current state of the bare metal Machine, verifies if BareMetalHost is successfully created and inspection is completed. Then the kaas-ipam controller fetches the information about the network card, creates the IpamHost object, and requests the IP address.

The IpamHost object is created for each Machine and contains all configuration of the host network interfaces and IP address. It also contains the information about associated BareMetalHost, Machine, and MAC addresses.

For demonstration purposes, the Container Cloud IpamHost custom resource (CR) is split into the following major sections:

IpamHost metadata

The Container Cloud IpamHost CR contains the following fields:

  • apiVersion

    API version of the object that is ipam.mirantis.com/v1alpha1

  • kind

    Object type that is IpamHost

  • metadata

    The metadata field contains the following subfields:

    • name

      Name of the IpamHost object

    • namespace

      Project in which the IpamHost object has been created

    • labels

      Key-value pairs that are attached to the object:

      • cluster.sigs.k8s.io/cluster-name

        References the Cluster object name that IpamHost is assigned to

      • ipam/BMHostID

        Unique ID of the associated BareMetalHost object

      • ipam/MAC-XX-XX-XX-XX-XX-XX: "1"

        Number of NICs of the host that the corresponding MAC address is assigned to

      • ipam/MachineID

        Unique ID of the associated Machine object

      • ipam/UID

        Unique ID of the IpamHost object

Configuration example:

apiVersion: ipam.mirantis.com/v1alpha1
kind: IpamHost
metadata:
  name: master-0
  namespace: default
  labels:
    cluster.sigs.k8s.io/cluster-name: kaas-mgmt
    ipam/BMHostID: 57250885-f803-11ea-88c8-0242c0a85b02
    ipam/MAC-0C-C4-7A-1E-A9-5C: "1"
    ipam/MAC-0C-C4-7A-1E-A9-5D: "1"
    ipam/MachineID: 573386ab-f803-11ea-88c8-0242c0a85b02
    ipam/UID: 834a2fc0-f804-11ea-88c8-0242c0a85b02

IpamHost configuration

The spec field of the IpamHost resource describes the desired state of the object. It contains the following fields:

  • nicMACmap

    Represents an unordered list of all NICs of the host obtained during the bare metal host inspection. Each NIC entry contains such fields as name, mac, ip, and so on. The primary field defines which NIC was used for PXE booting. Only one NIC can be primary. The IP address is not configurable and is provided only for debug purposes.

  • l2TemplateSelector

    If specified, contains the name (first priority) or label of the L2 template that will be applied during a machine creation. The l2TemplateSelector field is copied from the Machine providerSpec object to the IpamHost object only once, during a machine creation. To modify l2TemplateSelector after creation of a Machine CR, edit the IpamHost object.

Configuration example:

spec:
  nicMACmap:
  - mac: 0c:c4:7a:1e:a9:5c
    name: ens11f0
  - ip: 172.16.48.157
    mac: 0c:c4:7a:1e:a9:5d
    name: ens11f1
    primary: true
  l2TemplateSelector:
    label:xxx

IpamHost status

The status field of the IpamHost resource describes the observed state of the object. It contains the following fields:

  • ipAllocationResult Deprecated since 2.12.0

    Status of IP allocation for the primary NIC (PXE boot). Possible values are OK, ERR (if no IP address was allocated), or a text message that should be interpreted as a warning. This field is deprecated as of Container Cloud 2.12.0 and will be removed in one of the following releases. Use l2RenderResult instead.

  • l2RenderResult

    Result of the L2 template rendering, if applicable. Possible values are: OK for success, ERR for failure, information or warning message.

  • created Deprecated since 2.11.0

    Date and time of the IpamHost status creation. Deprecated as of Container Cloud 2.11.0 and will be replaced with objCreated in one of the following releases.

  • lastUpdated Deprecated since 2.11.0

    Date and time of the last IpamHost status update. Deprecated as of Container Cloud 2.11.0 and will be replaced with objUpdated in one of the following releases.

  • nicMACmap For internal use only

    Unordered list of MAC addresses of a bare metal host and relationships between NICs. Each nicMACmap entry can contain additional fields such as ipRef, nameservers, online, and so on.

    Warning

    • The nicMACmap field has a release-dependent format. It has no backward compatibility and can be deprecated at any moment without notifications.

    • Do not configure this field using Container Cloud API. Use netconfigV2 instead.

  • osMetadataNetwork Deprecated since 2.12.0

    Configuration of the host OS metadata network. This configuration is used in the cloud-init tool and is applicable to the primary NIC only. It is added when the IP address is allocated and the ipAllocationResult status is OK.

    This field is deprecated as of Container Cloud 2.12.0 and will be removed in one of the following releases. Use netconfigV2 instead.

  • versionIpam Deprecated since 2.11.0

    IPAM version used during the last update of the object. Deprecated as of Container Cloud 2.11.0 and will be replaced with objStatusUpdated in one of the following releases.

Configuration example:

status:
  ipAllocationResult: OK
  l2RenderResult: There are no available L2Templates
  lastUpdated: "2020-09-16T11:02:39Z"
  nicMACmap:
  - mac: 0C:C4:7A:1E:A9:5C
    name: ens11f0
  - gateway: 172.16.48.1
    ip: 172.16.48.200/24
    ipRef: default/auto-0c-c4-7a-a8-d3-44
    mac: 0C:C4:7A:1E:A9:5D
    name: ens11f1
    nameservers:
    - 172.18.176.6
    online: true
    primary: true
  osMetadataNetwork:
    links:
    - ethernet_mac_address: 0C:C4:7A:A8:D3:44
      id: enp8s0f0
      type: phy
    networks:
    - ip_address: 172.16.48.200
      link: enp8s0f0
      netmask: 255.255.255.0
      routes:
      - gateway: 172.16.48.1
        netmask: 0.0.0.0
        network: 0.0.0.0
      type: ipv4
    services:
    - address: 172.18.176.6
      type: dns
  versionIpam: v3.0.999-20200807-130909-44151f8