Mirantis Container Cloud (MCC) becomes part of Mirantis OpenStack for Kubernetes (MOSK)!
Starting with MOSK 25.2, the MOSK documentation set covers all product layers, including MOSK management (formerly Container Cloud). This means everything you need is in one place. Some legacy names may remain in the code and documentation and will be updated in future releases. The separate Container Cloud documentation site will be retired, so please update your bookmarks for continued easy access to the latest content.
IpamHost¶
This section describes the IpamHost resource used in the management API for
MOSK.
The kaas-ipam controller monitors the current state of the bare metal
Machine, verifies whether BareMetalHost is successfully created and
inspection is completed.
Then the kaas-ipam controller fetches the information about the network
interface configuration, creates the IpamHost object, and requests the IP
addresses.
The IpamHost object is created for each Machine and contains
configuration of the host network interfaces and IP address. It also contains
information about associated MAC addresses, BareMetalHost and
Machine objects.
Note
Before update of the management cluster to 2.29.0 (Cluster release
16.4.0), instead of BareMetalHostInventory, use the BareMetalHost
object. For details, see BareMetalHost resource.
Caution
While the Cluster release of the management cluster is 16.4.0,
BareMetalHostInventory operations are allowed to
m:kaas@management-admin only. This limitation is lifted once the
management cluster is updated to the Cluster release 16.4.1 or later.
For demonstration purposes, the IpamHost custom resource (CR) is split into
the following major sections:
IpamHost metadata¶
The IpamHost CR contains the following fields:
apiVersionAPI version of the object that is
ipam.mirantis.com/v1alpha1
kindObject type that is
IpamHost
metadataThe
metadatafield contains the following subfields:nameName of the
IpamHostobject
namespaceProject in which the
IpamHostobject has been created
labelsKey-value pairs that are attached to the object:
cluster.sigs.k8s.io/cluster-nameReferences the
Clusterobject name thatIpamHostis assigned to
ipam/BMHostIDUnique ID of the associated
BareMetalHostobject
ipam/MAC-XX-XX-XX-XX-XX-XX: "1"Number of NICs of the host that the corresponding MAC address is assigned to
ipam/MachineIDUnique ID of the associated
Machineobject
ipam/UIDUnique ID of the
IpamHostobject
Warning
Labels and annotations that are not documented in this API Reference are generated automatically. Do not modify them using the API.
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 required state of
the object. It contains the following fields:
nicMACmapRepresents 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. Theprimaryfield 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.
l2TemplateSelectorOptional. Contains the
name(first priority) orlabelof the L2 template that will be applied during machine creation. Thel2TemplateSelectorfield is copied fromproviderSpecof theMachineobject to theIpamHostobject only once, during machine creation. To modifyl2TemplateSelectorafter creation of theMachineobject, edit theIpamHostobject.
netconfigUpdateModeTechPreviewUpdate mode of network configuration. Possible values:
MANUALDefault, recommended. An operator manually applies new network configuration.
AUTO-UNSAFEUnsafe, not recommended. If new network configuration is rendered by
kaas-ipamsuccessfully, it is applied automatically with no manual approval.
MANUAL-GRACEPERIODInitial value set during the
IpamHostobject creation. If new network configuration is rendered bykaas-ipamsuccessfully, it is applied automatically with no manual approval. This value is implemented for automatic changes in theIpamHostobject during the host provisioning and deployment. The value is changed automatically toMANUALin three hours after theIpamHostobject creation.
netconfigUpdateAllowTechPreviewManual approval of network changes. Possible values:
trueorfalse. Set totrueto approve the Netplan configuration file candidate (stored innetconfigCandidate) and copy its contents to the effective Netplan configuration file list (stored innetconfigFiles). After that, its value is automatically switched back tofalse.Note
This value has effect only if
netconfigUpdateModeis set toMANUAL.Set to
trueonly ifstatus.netconfigCandidateStateof network configuration candidate isOK.Caution
The following fields of the
ipamHoststatus are renamed since MOSK 23.1 in the scope of theL2TemplateandIpamHostobjects refactoring:netconfigV2tonetconfigCandidatenetconfigV2statetonetconfigCandidateStatenetconfigFilesStatetonetconfigFilesStates(per file)
No user actions are required after renaming.
The format of
netconfigFilesStatechanged after renaming. ThenetconfigFilesStatesfield contains a dictionary of statuses of network configuration files stored innetconfigFiles. The dictionary contains the keys that are file paths and values that have the same meaning for each file thatnetconfigFilesStatehad:For a successfully rendered configuration file:
OK: <timestamp> <sha256-hash-of-rendered-file>, where a timestamp is in the RFC 3339 format.For a failed rendering:
ERR: <error-message>.
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
netconfigUpdateMode: manual
netconfigUpdateAllow: false
IpamHost status¶
Caution
The following fields of the ipamHost status are renamed since
MOSK 23.1 in the scope of the L2Template and IpamHost objects
refactoring:
netconfigV2tonetconfigCandidatenetconfigV2statetonetconfigCandidateStatenetconfigFilesStatetonetconfigFilesStates(per file)
No user actions are required after renaming.
The format of netconfigFilesState changed after renaming. The
netconfigFilesStates field contains a dictionary of statuses of network
configuration files stored in netconfigFiles. The dictionary contains
the keys that are file paths and values that have the same meaning for each
file that netconfigFilesState had:
For a successfully rendered configuration file:
OK: <timestamp> <sha256-hash-of-rendered-file>, where a timestamp is in the RFC 3339 format.For a failed rendering:
ERR: <error-message>.
The status field of the IpamHost resource describes the current state
of the object. It contains the following fields:
netconfigCandidateCandidate of the Netplan configuration file in human readable format that is rendered using the corresponding
L2Template. This field contains valid data ifl2RenderResultandnetconfigCandidateStateretain theOKresult.
l2RenderResultDeprecatedStatus of a rendered Netplan configuration candidate stored in
netconfigCandidate. Possible values:For a successful L2 template rendering:
OK: timestamp sha256-hash-of-rendered-netplan, where timestamp is in the RFC 3339 formatFor a failed rendering:
ERR: <error-message>
This field is deprecated and will be removed in one of the following releases. Use
netconfigCandidateStateinstead.
netconfigCandidateStateTechPreviewStatus of a rendered Netplan configuration candidate stored in
netconfigCandidate. Possible values:For a successful L2 template rendering:
OK: timestamp sha256-hash-of-rendered-netplan, where timestamp is in the RFC 3339 formatFor a failed rendering:
ERR: <error-message>
netconfigFilesList of Netplan configuration files rendered using the corresponding
L2Template. It is used to configure host networking during bare metal host provisioning and during Kubernetes node deployment. For details, refer to Workflow of the netplan configuration using an L2 template.Its contents are changed only if rendering of Netplan configuration was successful. So, it always retains the last successfully rendered Netplan configuration. To apply changes in contents, the infrastructure operator approval is required. For details, see Modify network configuration on an existing machine.
Every item in this list contains:
contentThe
base64-encoded Netplan configuration file that was rendered using the correspondingL2Template.
pathThe file path for the Netplan configuration file on the target host.
netconfigFilesStatesStatus of Netplan configuration files stored in
netconfigFiles. Possible values:For a successful L2 template rendering:
OK: timestamp sha256-hash-of-rendered-netplan, where timestamp is in the RFC 3339 formatFor a failed rendering:
ERR: <error-message>
serviceMapDictionary of services and their endpoints (IP address and optional interface name) that have the
ipam/SVC-<serviceName>label. These addresses are added to theServiceMapdictionary during rendering of an L2 template for a givenIpamHost. For details, see Service labels and their life cycle.
stateSince MCC 2.23.0 (11.7.0)Message that reflects the current status of the resource. The list of possible values includes the following:
OK- object is operational.ERR- object is non-operational. This status has a detailed description in themessageslist.TERM- object was deleted and is terminating.
messagesSince MCC 2.23.0 (11.7.0)List of error or warning messages if the object state is
ERR.
objCreatedDate, time, and IPAM version of the resource creation.
objStatusUpdatedDate, time, and IPAM version of the last update of the
statusfield in the resource.
objUpdatedDate, time, and IPAM version of the last resource update.
Configuration example:
status:
l2RenderResult: OK
l2TemplateRef: namespace_name/l2-template-name/1/2589/88865f94-04f0-4226-886b-2640af95a8ab
netconfigFiles:
- content: ...<base64-encoded Netplan configuration file>...
path: /etc/netplan/60-kaas-lcm-netplan.yaml
netconfigFilesStates: /etc/netplan/60-kaas-lcm-netplan.yaml: 'OK: 2023-01-23T09:27:22.71802Z ece7b73808999b540e32ca1720c6b7a6e54c544cc82fa40d7f6b2beadeca0f53'
netconfigCandidate:
...
<Netplan configuration file in plain text, rendered from L2Template>
...
netconfigCandidateState: OK: 2022-06-08T03:18:08.49590Z a4a128bc6069638a37e604f05a5f8345cf6b40e62bce8a96350b5a29bc8bccde\
serviceMap:
ipam/SVC-ceph-cluster:
- ifName: ceph-br2
ipAddress: 10.0.10.11
- ifName: ceph-br1
ipAddress: 10.0.12.22
ipam/SVC-ceph-public:
- ifName: ceph-public
ipAddress: 10.1.1.15
ipam/SVC-k8s-lcm:
- ifName: k8s-lcm
ipAddress: 10.0.1.52
phase: Active
state: OK
objCreated: 2021-10-21T19:09:32Z by v5.1.0-20210930-121522-f5b2af8
objStatusUpdated: 2021-10-21T19:14:18.748114886Z by v5.1.0-20210930-121522-f5b2af8
objUpdated: 2021-10-21T19:09:32.606968024Z by v5.1.0-20210930-121522-f5b2af8