Prepare environment#
Environment preparation consists of 3 stages:
- Uploading/migrating all LUNA Vinder Module settings to the Configurator service
- Uploading a dump file with user LUNA Vinder Module settings using the Storages utility to the Configurator service
- Creating a database for the Projector service
Make sure you are in the working directory with the Kubernetes files:
cd /var/lib/luna/lvm-current/extras/k8s/
The following settings must be set according to the user logic:
storages/files/lvm_settings.json— Dump file to override the default settings using theload_dumpcommand.storages/files/lvm_config.conf— A service configuration file required to create the Projector service database and load settings. Contains the Configurator service address and the Postgres address.storages/files/storages_config.conf— Storages settings to allowing the utility to get the Postgres address for loading the dump filestorages/overlays/<command_name>— Storages positional arguments
Environment preparation is performed with the Kustomize tool without using Helm. The files storages/base/base.yaml, storages/lvm/configs/base-configs.yaml, storages/lvm/db/base-db.yaml define templates on which layers from the storages/overlays directory are superimposed. 3 layers available:
prepare_configs_lvm- the layer responsible for loading/migrating settingsload_dump_lvm- the layer responsible for loading a custom dump file using the Storages utilityprepare_db_lvm- the layer responsible for creating a database for the Projector service
To load an image from a VisionLabs registry, you must also fill in the imagePullSecrets parameter in the storages/base/base.yaml, storages/lvm/configs/base-configs.yaml, storages/lvm/db/base-db.yaml manifests (see "Create Docker Registry authentication secret" section).
To prepare the environment, run the following commands:
1) Create a Configmap to load the Storages configuration file, dump file, and service configuration file:
kubectl create configmap lvm-config --from-env-file=storages/files/lvm_config.conf
kubectl create configmap lvm-storages-config --from-file=storages/files/storages_config.conf
kubectl create configmap lvm-storages-dump --from-file=storages/files/lvm_settings.json
2) Perform a settings download/migration and verify that the process was successful:
kubectl apply -k storages/overlays/prepare_configs_lvm
kubectl get pods
kubectl logs lvm-configs-prepare-xxxxx
3) Load settings from a custom dump file and verify that the process was successful:
kubectl apply -k storages/overlays/load_dump_lvm
kubectl get pods
kubectl logs storages-load-dump-lvm-xxxxx
4) Create a database for the Projector service and verify that the process was successful:
kubectl apply -k storages/overlays/prepare_db_lvm
kubectl get pods
kubectl logs lvm-db-projector-prepare-xxxxx