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.
Example of a complete template configuration for cluster creation¶
The following example contains all required objects of an advanced network
and host configuration for a MOSK cluster.
The procedure below contains:
Various .yaml objects to be applied with a MOSK
cluster kubeconfig
Useful comments inside the .yaml example files
Example hardware and configuration data, such as network, disk,
auth, that must be updated accordingly to fit your cluster configuration
Example templates, such as l2template and baremetalhostprofline,
that illustrate how to implement a specific configuration
Caution
The exemplary configuration described below is not production
ready and is provided for illustration purposes only.
For illustration purposes, all files provided in this exemplary procedure
are named by the Kubernetes object types:
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.
Create an empty .yaml file with the namespace object:
apiVersion:v1
Select from the following options:
Since MCC 2.21.0 (11.5.0, 7.11.0)
Create the required number of .yaml files with the
BareMetalHostCredential objects for each bmh node with the
unique name and authentication data. The following example
contains one BareMetalHostCredential object:
Note
The kaas.mirantis.com/region label is removed from all MOSK
objects in 24.1. Therefore, do not add the label starting with this release.
On existing clusters updated to this release, or if added manually, MOSK
ignores this label.
Before MCC 2.21.0 (11.4.0, 8.10.0, 7.10.0, or earlier)
Create the required number of .yaml files with the Secret
objects for each bmh node with the unique name and
authentication data. The following example contains one Secret
object:
apiVersion:kaas.mirantis.com/v1alpha1kind:BareMetalHostInventorymetadata:annotations:inspect.metal3.io/hardwaredetails-storage-sort-term:hctl ASC, wwn ASC, by_id ASC, name ASClabels:cluster.sigs.k8s.io/cluster-name:mosk-cluster# we will use those label, to link machine to exact bmh nodekaas.mirantis.com/baremetalhost-id:cz7700kaas.mirantis.com/provider:baremetalname:cz7700-mosk-cluster-control-noefinamespace:mosk-nsspec:bmc:address:192.168.1.12bmhCredentialsName:'cz7740-cred'bootMACAddress:0c:c4:7a:34:52:04bootMode:legacyonline:true
apiVersion:metal3.io/v1alpha1kind:BareMetalHostmetadata:labels:cluster.sigs.k8s.io/cluster-name:mosk-clusterhostlabel.bm.kaas.mirantis.com/controlplane:controlplane# we will use those label, to link machine to exact bmh nodekaas.mirantis.com/baremetalhost-id:cz7700kaas.mirantis.com/provider:baremetalkaas.mirantis.com/region:region-oneannotations:kaas.mirantis.com/baremetalhost-credentials-name:cz7700-credname:cz7700-mosk-cluster-control-noefinamespace:mosk-nsspec:bmc:address:192.168.1.12# credentialsName is updated automatically during cluster deploymentcredentialsName:''bootMACAddress:0c:c4:7a:34:52:04bootMode:legacyonline:true
apiVersion:metal3.io/v1alpha1kind:BareMetalHostProfilemetadata:labels:cluster.sigs.k8s.io/cluster-name:mosk-cluster# This label indicates that this profile will be default in# namespaces, so machines w\o exact profile selecting will use# this templatekaas.mirantis.com/defaultBMHProfile:'true'kaas.mirantis.com/provider:baremetalkaas.mirantis.com/region:region-onename:bmhp-cluster-defaultnamespace:mosk-nsspec:devices:-device:byPath:/dev/disk/by-path/pci-0000:00:1f.2-ata-1minSize:120Giwipe:truepartitions:-name:bios_grubpartflags:-bios_grubsize:4Miwipe:true-name:uefipartflags:-espsize:200Miwipe:true-name:config-2size:64Miwipe:true-name:lvm_dummy_partsize:1Giwipe:true-name:lvm_root_partsize:0wipe:true-device:byPath:/dev/disk/by-path/pci-0000:00:1f.2-ata-2minSize:30Giwipe:true-device:byPath:/dev/disk/by-path/pci-0000:00:1f.2-ata-3minSize:30Giwipe:truepartitions:-name:lvm_lvp_partsize:0wipe:true-device:byPath:/dev/disk/by-path/pci-0000:00:1f.2-ata-4wipe:truefileSystems:-fileSystem:vfatpartition:config-2-fileSystem:vfatmountPoint:/boot/efipartition:uefi-fileSystem:ext4logicalVolume:rootmountPoint:/-fileSystem:ext4logicalVolume:lvpmountPoint:/mnt/local-volumes/grubConfig:defaultGrubOptions:-GRUB_DISABLE_RECOVERY="true"-GRUB_PRELOAD_MODULES=lvm-GRUB_TIMEOUT=30kernelParameters:modules:-content:'optionskvm_intelnested=1'filename:kvm_intel.confsysctl:# For the list of options prohibited to change, refer to# https://docs.mirantis.com/mke/3.7/install/predeployment/set-up-kernel-default-protections.htmlfs.aio-max-nr:'1048576'fs.file-max:'9223372036854775807'fs.inotify.max_user_instances:'4096'kernel.core_uses_pid:'1'kernel.dmesg_restrict:'1'net.ipv4.conf.all.rp_filter:'0'net.ipv4.conf.default.rp_filter:'0'net.ipv4.conf.k8s-ext.rp_filter:'0'net.ipv4.conf.k8s-ext.rp_filter:'0'net.ipv4.conf.m-pub.rp_filter:'0'vm.max_map_count:'262144'logicalVolumes:-name:rootsize:0vg:lvm_root-name:lvpsize:0vg:lvm_lvppostDeployScript:|#!/bin/bash -ex# used for test-debug only!echo "root:r00tme" | sudo chpasswdecho 'ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"' > /etc/udev/rules.d/60-ssd-scheduler.rulesecho $(date) 'post_deploy_script done' >> /root/post_deploy_donepreDeployScript:|#!/bin/bash -execho "$(date) pre_deploy_script done" >> /root/pre_deploy_donevolumeGroups:-devices:-partition:lvm_root_partname:lvm_root-devices:-partition:lvm_lvp_partname:lvm_lvp-devices:-partition:lvm_dummy_part# here we can create lvm, but do not mount or format it somewherename:lvm_forawesomeapp
mosk-ns_BareMetalHostProfile_worker-storage1.yaml
apiVersion:metal3.io/v1alpha1kind:BareMetalHostProfilemetadata:labels:cluster.sigs.k8s.io/cluster-name:mosk-clusterkaas.mirantis.com/provider:baremetalkaas.mirantis.com/region:region-onename:worker-storage1namespace:mosk-nsspec:devices:-device:minSize:120Giwipe:truepartitions:-name:bios_grubpartflags:-bios_grubsize:4Miwipe:true-name:uefipartflags:-espsize:200Miwipe:true-name:config-2size:64Miwipe:true# Create dummy partition w\o mounting-name:lvm_dummy_partsize:1Giwipe:true-name:lvm_root_partsize:0wipe:true-device:# Will be used for Ceph, so required to be wipedbyPath:/dev/disk/by-path/pci-0000:00:1f.2-ata-1minSize:30Giwipe:true-device:byPath:/dev/disk/by-path/pci-0000:00:1f.2-ata-2minSize:30Giwipe:truepartitions:-name:lvm_lvp_partsize:0wipe:true-device:byPath:/dev/disk/by-path/pci-0000:00:1f.2-ata-3wipe:true-device:byPath:/dev/disk/by-path/pci-0000:00:1f.2-ata-4minSize:30Giwipe:truepartitions:-name:lvm_lvp_part_sdfwipe:truesize:0fileSystems:-fileSystem:vfatpartition:config-2-fileSystem:vfatmountPoint:/boot/efipartition:uefi-fileSystem:ext4logicalVolume:rootmountPoint:/-fileSystem:ext4logicalVolume:lvpmountPoint:/mnt/local-volumes/grubConfig:defaultGrubOptions:-GRUB_DISABLE_RECOVERY="true"-GRUB_PRELOAD_MODULES=lvm-GRUB_TIMEOUT=30kernelParameters:modules:-content:'optionskvm_intelnested=1'filename:kvm_intel.confsysctl:# For the list of options prohibited to change, refer to# https://docs.mirantis.com/mke/3.6/install/predeployment/set-up-kernel-default-protections.htmlfs.aio-max-nr:'1048576'fs.file-max:'9223372036854775807'fs.inotify.max_user_instances:'4096'kernel.core_uses_pid:'1'kernel.dmesg_restrict:'1'net.ipv4.conf.all.rp_filter:'0'net.ipv4.conf.default.rp_filter:'0'net.ipv4.conf.k8s-ext.rp_filter:'0'net.ipv4.conf.k8s-ext.rp_filter:'0'net.ipv4.conf.m-pub.rp_filter:'0'vm.max_map_count:'262144'logicalVolumes:-name:rootsize:0vg:lvm_root-name:lvpsize:0vg:lvm_lvppostDeployScript:|#!/bin/bash -ex# used for test-debug only! That would allow operator to logic via TTY.echo "root:r00tme" | sudo chpasswd# Just an example for enforcing "ssd" disks to be switched to use "deadline" i\o scheduler.echo 'ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"' > /etc/udev/ rules.d/60-ssd-scheduler.rulesecho $(date) 'post_deploy_script done' >> /root/post_deploy_donepreDeployScript:|#!/bin/bash -execho "$(date) pre_deploy_script done" >> /root/pre_deploy_donevolumeGroups:-devices:-partition:lvm_root_partname:lvm_root-devices:-partition:lvm_lvp_part-partition:lvm_lvp_part_sdfname:lvm_lvp-devices:-partition:lvm_dummy_partname:lvm_forawesomeapp
Mandatory since MOSK 25.2. Before 25.2, mutually
exclusive with the cluster:spec:loadBalancerHost parameter that is
deprecated in 25.2.
For details, see mosk-ns_Cluster_managed-cluster.yaml in one of
the following steps.
Applies since Container Cloud 2.21.0 and 2.21.1 for
MOSK as TechPreview and since 2.24.0 as
GA for management clusters. For MOSK
clusters, is generally available since Container Cloud 2.25.0.
The MetalLBConfigTemplate object is available as
Technology Preview since Container Cloud 2.24.0 (Cluster release
14.0.0) and is generally available since Container Cloud 2.25.0
(Cluster releases 17.0.0 and 16.0.0).
apiVersion:kaas.mirantis.com/v1alpha1kind:KaaSCephClustermetadata:name:ceph-cluster-mosk-clusternamespace:mosk-nsspec:cephClusterSpec:nodes:# Add the exact ``nodes`` names.# Obtain the name from "get bmh -o wide" ``consumer`` field.cz812-mosk-cluster-storage-worker-noefi-58spl:roles:-mgr-mon# All disk configuration must be reflected in ``baremetalhostprofile``storageDevices:-config:deviceClass:ssdfullPath:/dev/disk/by-id/scsi-1ATA_WDC_WDS100T2B0A-00SM50_200231434939cz813-mosk-cluster-storage-worker-noefi-lr4k4:roles:-mgr-monstorageDevices:-config:deviceClass:ssdfullPath:/dev/disk/by-id/scsi-1ATA_WDC_WDS100T2B0A-00SM50_200231440912cz814-mosk-cluster-storage-worker-noefi-z2m67:roles:-mgr-monstorageDevices:-config:deviceClass:ssdfullPath:/dev/disk/by-id/scsi-1ATA_WDC_WDS100T2B0A-00SM50_200231443409pools:-default:truedeviceClass:ssdname:kubernetesreplicated:size:3role:kubernetesk8sCluster:name:mosk-clusternamespace:mosk-ns
Note
The storageDevices[].fullPath field is available since
Container Cloud 2.25.0 (Cluster releases 17.0.0 and 16.0.0). For the
clusters running earlier product versions, define the /dev/disk/by-id
symlinks using storageDevices[].name instead.
Obtain kubeconfig of the newly created MOSK cluster: