Introduction
This article provides the prerequisites, recommendations, and necessary steps for migrating Xray from a virtual machine (VM) to a Helm installation.
Prerequisites:
- Artifactory must be fully migrated from the VM to a Helm installation. A Helm installation of Xray cannot operate with an Artifactory VM installation. Please refer to the guide on migrating Artifactory installation method.
- Confirm that the Xray system requirements for the Helm installation setup are met.
- The migration must only occur between the same version of Xray.
- Ensure that the versions of Artifactory on both the VM and Helm installations are identical to prevent potential compatibility issues.
Recommendations:
- It is advisable to execute the migration steps in a staging environment before applying them to production environments.
- Create a snapshot or backup of the current Xray and PostgreSQL database to facilitate restoration if necessary.
Migration Steps:
- Follow steps 1-5 for installing Xray on Helm.
- Stop the Xray service on the VM installation.
- Copy the master key from the VM installation, located at $XRAY_HOME/etc/security/master.key.
- Create a secret from the master key for the Helm installation and reference the secret in the values.yaml as follows:
global:
masterKeySecretName: master-key-secret
- Retrieve the connection details and credentials for the Xray PostgreSQL database from the system.yaml file found under $XRAY_HOME/var/etc and add them to the values.yaml, either directly or by referencing them as a secret. These details should be included in the database section in the values.yaml.
- Copy the system.yaml content from the Xray VM and place it under extraSystemYaml in the values.yaml. Ensure that the following configurations are edited:
- Remove the database details, as these have been relocated to the values.yaml in step 5.
- Remove the shared.node.ip configuration, as it is not needed in the Helm installation.
- Execute the Helm installation with the chart version that matches the Xray version in use on the VM installation:
helm upgrade --install xray --namespace xray -f values.yaml --version <YOUR_DESIRED_XRAY_CHART_VERSION>
- Verify in the UI that the Xray service is up and running.