Prepare environment#
The environment is prepared using the Storages utility.
Make sure you are in the working directory with the Kubernetes files:
cd /var/lib/luna/current/extras/k8s/
Using the utility, you can prepare the environment for installation from scratch, upgrade or downgrade. By default, the --platform-version
argument is set to the current version of LUNA PLATFORM. To downgrade, you must specify the appropriate version of LUNA PLATFORM.
Important: When preparing your environment for an upgrade or downgrade, it is important to carefully plan the impact on running services that use databases. See the "Recommendations services behavior during environment preparation" section of the Storages utility manual for details.
The following settings must be set according to the user logic:
storages/files/platform_settings.json
- Dump file to override the default settings using theload_dump
command.storages/files/storages_config.conf
- Storages settings, allowing the utility to go to the database, S3, etc.storages/overlays/<command_name>
- Storages positional arguments.
Environment preparation is performed with the Kustomize tool without using Helm. The storages/base/base.yaml
file defines a template on which layers from the storages/overlays
directory are overlaid. There are 4 layers available - check
, list
, load_dump
, prepare
, each corresponding to a specific command of the positional argument luna_prepare
.
To load an image from a VisionLabs registry, you must also fill in the imagePullSecrets
parameter in the storages/base/base.yaml
manifest (see "Create Docker Registry authentication secret" section).
To prepare the environment, run the following commands:
1) Create a Configmap to load the Storages settings and dump file:
kubectl create configmap storages-config --from-file=storages/files/storages_config.conf
kubectl create configmap storages-dump --from-file=storages/files/platform_settings.json
2) Perform environment preparation using the prepare
command:
kubectl apply -k storages/overlays/prepare
kubectl get pods
kubectl logs storages-prepare-xxxxx
By default, the environment for all entities is prepared (positional argument
all_entites
). To prepare individual entities, edit thestorages/overlays/prepare/overlay-prepare.yaml
file accordingly.
3) Load the user dump file using the load_dump
command:
kubectl apply -k storages/overlays/load_dump
kubectl get pods
kubectl logs storages-load-dump-xxxxx
Once executed, pods will have a
Completed
status and will not be automatically deleted. To correctly delete the manifest, you must run the commandkubectl delete -k storages/overlays/<storages_command>
.
If necessary, you can use the list
and check
commands similar to the above examples.
The manifest set does not include an example of using the logs
command.