Mirantis Container Cloud (MCC) becomes part of Mirantis OpenStack for Kubernetes (MOSK)!
Now, 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
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.
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, the configuration is applied in the order of appearance in the list after all configurations with the value are applied.
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.
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. Indicates whether the status updates are initiated by
host-os-modules-controller.
isValidIndicates whether all given configurations have been validated successfully and are ready to be applied on machines. An invalid object is discarded from processing.
specUpdatedAtDefines the time of the last change in the object
specobserved byhost-os-modules-controller.
containsDeprecatedModulesIndicates whether the object uses one or several deprecated modules. Boolean.
machinesStatesSpecifies 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.
errorDetails of an error, if any, that occurs during the object processing by
host-os-modules-controller.
secretObjectVersionResource version of the corresponding
Secretobject observed byhost-os-modules-controller. Is present only ifsecretValuesis set.
moduleDeprecatedByList of modules that deprecate the currently configured module. Contains the
nameandversionfields specifying one or more modules that deprecate the current module.
supportedDistributionsList 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"