Warm up the MOSK management cache
TechPreview
This section describes how to speed up deployment and update process of
MOSK clusters, which usually do not have access to the
internet and consume artifacts from a management cluster using the
mcc-cache service.
By default, after auto-upgrade of a management cluster,
before each MOSK cluster deployment or update, mcc-cache
downloads the required list of images, thus slowing down the process.
Using the CacheWarmupRequest resource, you can predownload (warm up)
a list of images included in a given set of Cluster releases into the
mcc-cache service only once per release for further usage on all
MOSK clusters.
After a successful cache warm-up, the object of the CacheWarmupRequest
resource is automatically deleted from the cluster and cache remains for
MOSK clusters deployment or update until next auto-upgrade
of the management cluster.
Caution
If the disk space for cache runs out, or the size of cached artifacts exceeds the configured limit, the cache for the oldest object is evicted. To avoid running out of space in the cache, verify and adjust its size before each cache warm-up.
Requirements
Cache warm-up requires a lot of disk storage, depending on the number of
artifacts to be pre-cached for Cluster and OpenStack releases.
Therefore, make sure to have enough space in the dedicated
LocalVolumeProvisioner (lvp) partition for storing cached objects on
each node of the management cluster before creating the CacheWarmupRequest
resource. By default, 20 GiB of cache size is configured, but Mirantis highly
recommends increasing it to the following values:
Cluster release |
Recommended value in GiB |
|---|---|
MOSK Cluster release with one OpenStack version |
50 |
MOSK Cluster release with an OpenStack version upgrade
from |
120 |
For details about the lvp partition requirements, see
Default configuration of the host system storage.
Increase cache size for mcc-cache
After you calculate the disk size for warming up cache depending on your
cluster settings and minimal cache warm-up requirements, configure the size of
cache in the Cluster object of your cluster.
In the spec:providerSpec:value:kaas:regionalHelmReleases: section of the
management Cluster object, add the following snippet to the mcc-cache
entry with the required cacheSize value in GiB:
nginx:
cacheSize: 100
kubectl --kubeconfig <pathToManagementClusterKubeconfig> edit cluster <clusterName>
Configuration example:
spec:
providerSpec:
value:
kaas:
regionalHelmReleases:
- name: mcc-cache
values:
nginx:
cacheSize: 100
Note
The cacheSize parameter only increases the NGINX cache size and
does not change the size of the related Persistent Volume for the
mcc-cache service. Make sure to have enough capacity in the related
lvp partition on the management cluster nodes. For disk space
requirements, see MOSK cluster hardware requirements.
Warm up cache using CLI
After you increase the size of cache on the cluster as described in
Increase cache size for mcc-cache, create the CacheWarmupRequest object in the
Kubernetes API.
Caution
Create CacheWarmupRequest objects only on the management
cluster.
To warm up cache using CLI:
Identify the latest available Cluster releases to use for deployment of new clusters and update of existing clusters:
kubectl --kubeconfig <pathToManagementClusterKubeconfig> get kaasreleases -l=kaas.mirantis.com/active="true" -o=json | jq -r '.items[].spec.supportedClusterReleases[] | select(.availableUpgrades | length == 0) | .name'
Example of system response:
mke-14-0-1-3-6-5 mosk-15-0-1
On the management cluster, create a
.yamlfile for theCacheWarmupRequestobject using the following example:apiVersion: kaas.mirantis.com/v1alpha1 kind: CacheWarmupRequest metadata: name: example-cluster-name namespace: default spec: clusterReleases: - mke-14-0-1 - mosk-15-0-1 openstackReleases: - yoga fetchRequestTimeout: 30m clientsPerEndpoint: 2 openstackOnly: false
In this example:
The
CacheWarmupRequestobject is created for a management cluster namedexample-cluster-name.The
CacheWarmupRequestobject is created in the only alloweddefaultMOSK management project.Two Cluster releases
mosk-15-0-1andmke-14-0-1will be predownloaded.For
mosk-15-0-1, only images related to the OpenStack versionYogawill be predownloaded.Maximum time-out for a single request to download a single artifact is 30 minutes.
Two parallel workers will fetch artifacts per each
mcc-cacheservice endpoint.All artifacts will be fetched, not only those related to OpenStack.
For details about the
CacheWarmupRequestobject, see CacheWarmupRequest resource.Apply the object to the cluster:
kubectl --kubeconfig <pathToManagementKubeconfig> apply -f <pathToFile>
Once done, during deployment and update of MOSK clusters, MOSK management uses cached artifacts from the
mcc-cacheservice to facilitate and speed up the procedure.
When a new MOSK release becomes available and the management cluster auto-upgrades to a new release, repeat the above steps to predownload a new set of artifacts for MOSK clusters.