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.
HostOSConfiguration¶
TechPreview since MCC 2.26.0 (17.1.0 and 16.1.0)
Warning
For security reasons and to ensure safe and reliable cluster operability, test this configuration on a staging environment before applying it to production. For any questions, contact Mirantis support.
Caution
As long as the feature is still on the development stage,
Mirantis highly recommends deleting all HostOSConfiguration objects,
if any, before automatic upgrade of the management cluster to Container Cloud
2.27.0 (Cluster release 16.2.0). After the upgrade, you can recreate the
required objects using the updated parameters.
This precautionary step prevents re-processing and re-applying of existing
configuration, which is defined in HostOSConfiguration objects, during
management cluster upgrade to 2.27.0. Such behavior is caused by changes in
the HostOSConfiguration API introduced in 2.27.0.
This section describes the HostOSConfiguration custom resource (CR) used in
the management API. It contains all necessary information to introduce and load
modules for further configuration of the host operating system of the related
Machine object.
Note
This object must be created and managed on the management cluster.
For demonstration purposes, we split the HostOSConfiguration CR into the
following sections:
HostOSConfiguration metadata¶
The HostOSConfiguration custom resource (CR) metadata contains the
following fields:
apiVersionAPI version of the object that is
ipam.mirantis.com/v1alpha1.
kindObject type that is
HostOSConfiguration.
metadataObject metadata that contains the following subfields:
nameObject name.
namespaceProject in which the
HostOSConfigurationobject is created.
Configuration example:
apiVersion: kaas.mirantis.com/v1alpha1
kind: HostOSConfiguration
metadata:
name: host-os-configuration-sample
namespace: default
HostOSConfiguration configuration¶
The spec object field contains configuration for a
HostOSConfiguration object and has the following fields:
machineSelectorRequired for production deployments. A set of
Machineobjects to apply theHostOSConfigurationobject to. Has the format of the Kubernetes label selector.
configsRequired. List of configurations to apply to
Machineobjects defined inmachineSelector. Each entry has the following fields:moduleRequired. Name of the module that refers to an existing module in one of the HostOSConfigurationModules objects.
moduleVersionRequired. Version of the module in use in the SemVer format.
descriptionOptional. Description and purpose of the configuration.
orderOptional. Positive integer between
1and1024that indicates the order of applying the module configuration. A configuration with the lowest order value is applied first. If theorderfield is not set:Since MCC 2.27.0 (Cluster releases 17.2.0 and 16.2.0), the configuration is applied in the order of appearance in the list after all configurations with the value are applied.
In MCC 2.26.0 (Cluster releases 17.1.0 and 16.1.0), the following rules apply to the ordering when comparing each pair of entries:
Ordering by alphabet based on the
modulevalues unless they are equal.Ordering by version based on the
moduleVersionvalues, with preference given to the lesser value.
valuesOptional if
secretValuesis set. Module configuration in the format of key-value pairs.
secretValuesOptional if
valuesis set. Reference to aSecretobject that contains the configuration values for the module:namespaceProject name of the
Secretobject.
nameName of the
Secretobject.
Note
You can use both
valuesandsecretValuestogether. But if the values are duplicated, thesecretValuesdata rewrites duplicated keys of thevaluesdata.Warning
The referenced
Secretobject must contain only primitive non-nested values. Otherwise, the values will not be applied correctly.
phaseOptional. LCM phase, in which a module configuration must be executed. The only supported and default value is
reconfigure. Hence, you may omit this field.
orderRemoved in Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Optional. Positive integer between
1and1024that indicates the order of applyingHostOSConfigurationobjects on newly added or newly assigned machines. An object with the lowest order value is applied first. If the value is not set, the object is applied last in the order.If no
orderfield is set for allHostOSConfigurationobjects, the objects are sorted by name.Note
If a user changes the
HostOSConfigurationobject that was already applied on some machines, then only the changed items from thespec.configssection of theHostOSConfigurationobject are applied to those machines, and the execution order applies only to the changed items.The configuration changes are applied on corresponding
LCMMachineobjects almost immediately afterhost-os-modules-controllerverifies the changes.
Configuration example:
spec:
machineSelector:
matchLabels:
label-name: "label-value"
configs:
- description: Brief description of the configuration
module: mosk-provided-module-name
moduleVersion: 1.0.0
order: 1
# the 'phase' field is provided for illustration purposes. it is redundant
# because the only supported value is "reconfigure".
phase: "reconfigure"
values:
foo: 1
bar: "baz"
secretValues:
name: values-from-secret
namespace: default
HostOSConfiguration status¶
The status field of the HostOSConfiguration object contains the
current state of the object:
controllerUpdateReserved. Available since Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Indicates whether the status updates are initiated by
host-os-modules-controller.
isValidAvailable since Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Indicates whether all given configurations have been validated successfully and are ready to be applied on machines. An invalid object is discarded from processing.
specUpdatedAtAvailable since Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Defines the time of the last change in the object
specobserved byhost-os-modules-controller.
containsDeprecatedModulesAvailable since Container Cloud 2.28.0 (Cluster releases 17.3.0 and 16.3.0). Indicates whether the object uses one or several deprecated modules. Boolean.
machinesStatesAvailable since Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Specifies the per-machine state observed by
baremetal-provider. The keys are machines names, and each entry has the following fields:observedGenerationRead-only. Specifies the sequence number representing the quantity of changes in the object since its creation. For example, during object creation, the value is
1.
selectedIndicates whether the machine satisfied the selector of the object. Non-selected machines are not defined in
machinesStates. Boolean.
secretValuesChangedIndicates whether the secret values have been changed and the corresponding
stateItemshave to be updated. Boolean.The value is set to
truebyhost-os-modules-controllerif changes in the secret data are detected. The value is set tofalsebybaremetal-providerafter processing.
configStateItemsStatusesSpecifies key-value pairs with statuses of
StateItemsthat are applied to the machine. Each key contains thenameandversionof the configuration module. Each key value has the following format:Key: name of a configuration
StateItemValue: simplified status of the configuration
StateItemthat has the following fields:hashValue of the hash sum from the status of the corresponding
StateItemin theLCMMachineobject. Appears when the status switches toSuccess.
stateActual state of the corresponding
StateItemfrom theLCMMachineobject. Possible values:Not Started,Running,Success,Failed.
configsList of configurations statuses, indicating results of application of each configuration. Every entry has the following fields:
moduleNameExisting module name from the list defined in the
spec:modulessection of the related HostOSConfigurationModules object.
moduleVersionExisting module version defined in the
spec:modulessection of the relatedHostOSConfigurationModulesobject.
modulesReferenceName of the
HostOSConfigurationModulesobject that contains the related module configuration.
modulePlaybookName of the Ansible playbook of the module. The value is taken from the related
HostOSConfigurationModulesobject where this module is defined.
moduleURLURL to the module package in the FQDN format. The value is taken from the related
HostOSConfigurationModulesobject where this module is defined.
moduleHashsumHash sum of the module. The value is taken from the related
HostOSConfigurationModulesobject where this module is defined.
lastDesignatedConfigurationRemoved in Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Key-value pairs representing the latest designated configuration data for modules. Each key corresponds to a machine name, while the associated value contains the configuration data encoded in the
gzip+base64format.
lastValidatedSpecRemoved in Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Last validated module configuration encoded in the
gzip+base64format.
valuesValidRemoved in Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Validation state of the configuration and secret values defined in the object
specagainst the modulevaluesValidationSchema. AlwaystruewhenvaluesValidationSchemais empty.
errorDetails of an error, if any, that occurs during the object processing by
host-os-modules-controller.
secretObjectVersionAvailable since Container Cloud 2.27.0 (Cluster releases 17.2.0 and 16.2.0). Resource version of the corresponding
Secretobject observed byhost-os-modules-controller. Is present only ifsecretValuesis set.
moduleDeprecatedByAvailable since Container Cloud 2.28.0 (Cluster releases 17.3.0 and 16.3.0). List of modules that deprecate the currently configured module. Contains the
nameandversionfields specifying one or more modules that deprecate the current module.
supportedDistributionsAvailable since Container Cloud 2.28.0 (Cluster releases 17.3.0 and 16.3.0). List of operating system distributions that are supported by the current module. An empty list means support of any distribution by the current module.
HostOSConfiguration status example:
status:
configs:
- moduleHashsum: bc5fafd15666cb73379d2e63571a0de96fff96ac28e5bce603498cc1f34de299
moduleName: module-name
modulePlaybook: main.yaml
moduleURL: <url-to-module-archive.tgz>
moduleVersion: 1.1.0
modulesReference: mcc-modules
moduleDeprecatedBy:
- name: another-module-name
version: 1.0.0
- moduleHashsum: 53ec71760dd6c00c6ca668f961b94d4c162eef520a1f6cb7346a3289ac5d24cd
moduleName: another-module-name
modulePlaybook: main.yaml
moduleURL: <url-to-another-module-archive.tgz>
moduleVersion: 1.1.0
modulesReference: mcc-modules
secretObjectVersion: "14234794"
containsDeprecatedModules: true
isValid: true
machinesStates:
default/master-0:
configStateItemsStatuses:
# moduleName-moduleVersion
module-name-1.1.0:
# corresponding state item
host-os-download-<object-name>-module-name-1.1.0-reconfigure:
hash: 0e5c4a849153d3278846a8ed681f4822fb721f6d005021c4509e7126164f428d
state: Success
host-os-<object-name>-module-name-1.1.0-reconfigure:
state: Not Started
another-module-name-1.1.0:
host-os-download-<object-name>-another-module-name-1.1.0-reconfigure:
state: Not Started
host-os-<object-name>-another-module-name-1.1.0-reconfigure:
state: Not Started
observedGeneration: 1
selected: true
updatedAt: "2024-04-23T14:10:28Z"