Migrating from Kubespray to RKE
  • 25 Jul 2022
  • 3 Minutes to read
  • Dark
    Light

Migrating from Kubespray to RKE

  • Dark
    Light

Migrating from Kubespray to RKE consists of the following phases:

  • Pre-upgrade steps
  • Uninstalling the cluster
  • Cleaning the environment
  • Installing Sisense with RKE
  • Restoring the application


Single Node Deployment
  1.  Pre-Upgrade Steps
    1. Create a backup. See Backing up and Restoring Sisense.
    2. From the CLI, execute the CLI activation command:
      source add_completion-ns-sisense.sh
    3. Create the backup:
      si system backup -include-farm true
    4. Ensure that your external plugins support the Sisense version to which you are upgrading.
  2.  Uninstalling the cluster
    1. Save all the scheduled builds of the application.
      kubectl -n sisense get cronjobs.batch -o json > cronjobs.json
    2. Download the Sisense tar.gz file.
       wget [sisense-linux-deployment-link-current-version]
    3. Extract the tar.gz file into the sisense-version folder.
      tar zxf [sisense-linux-deployment-package-name]
    4. Navigate to the sisense-version directory where you extracted the tar.gz file.
      cd sisense-[sisense-version]
    5. Edit the single_config.yaml file.
      vim single_config.yaml
      Set the following parameters:
      • uninstall_cluster: true
      • k8s_nodes
      • deployment_size
      • linux_user
      • ssh_key
    6. Uninstall the cluster.
      ./sisense.sh single_config.yaml -y
  3.  Cleaning the environment
    1. Free up the space of unused images. Caution: This command removes all unused images! Be sure you are not doing any development on this server.
      sudo docker image prune -a -f
    2. Remove Kubernetes installation leftovers.
      sudo reboot 

      for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do sudo umount $mount 2>/dev/null; done

      sudo rm -rf /etc/ceph \
       /etc/cni \
       /etc/kubernetes \
       /opt/cni \
       /opt/rke \
       /run/secrets/kubernetes.io \
       /run/calico \
       /run/flannel \
       /var/lib/calico \
       /var/lib/etcd \
       /var/lib/cni \
       /var/lib/kubelet \
       /var/lib/rancher/rke/log \
       /var/log/containers \
       /var/log/kube-audit \
       /var/log/pods \
       /var/run/calico
  4.  Installing Sisense with RKE
    1. Download the Sisense tar.gz file.
      wget [sisense-linux-deployment-link]
    2. Extract the tar.gz file into the {sisense-version} folder:
      tar zxf [sisense-linux-deployment-package-name]
    3. Navigate to the {sisense-version} directory where you extracted the tar.gz file.
      cd sisense-[sisense-version]
    4. Edit the single_config.yaml file.
      vim single_config.yaml
      Set the following parameters:
      • uninstall_cluster: false
      • uninstall_sisense: false
      • update: false
      • remove_user_data: false
      • k8s_nodes
      • deployment_size
      • linux_user
      • ssh_key
    5. Run the installation.
      ./sisense.sh single_config.yaml -y
    6. Create the scheduled builds you had previously.
      kubectl create -f cronjobs.json -o yaml | kubectl apply -f -

  5.  Restoring the application
    • If, in the single_config.yaml file, remove_user_data was set to true and your data was erased, you will need to restore the data from the backup. See Backing up and Restoring Sisense.

Multi-Node Deployment
  1.  Pre-Upgrade Steps
    1. Create a backup. This backup procedure is mandatory, or you will lose the configuration of your Sisense application. See Backing up and Restoring Sisense.
    2. From the CLI, execute the CLI activation command:
      source add_completion-ns-sisense.sh
    3. Create the backup in the management pod in the /opt/sisense/storage/system_backups/ directory.
      si system backup -include-farm true
    4. Extract the name of the management pod.
      kubectl get po -n sisense -l "app=management" -oname | awk -F '/' '{print $2}'
    5. Copy the backup file you created from the post into the host (VM) machine.
      kubectl cp <sisense namespace>/<managment pod>:/opt/sisense/storage/system_backups/<backup path> ~/<backup path>
      It is recommended to also store this file somewhere else, in case something happens to the VM.
    6. Ensure that your external plugins support the Sisense version to which you are upgrading.
  2.  Uninstalling the cluster
    1. Save the application's scheduled builds.
      kubectl -n sisense get cronjobs.batch -o json > cronjobs.json
    2. Download the Sisense tar.gz file.
      wget [sisense-linux-deployment-link-current-version]
    3. Extract the tar.gz file into the sisense-version folder:
      tar zxf [sisense-linux-deployment-package-name]
    4. Navigate to the sisense-version directory.
      cd sisense-[sisense-version]
    5. Edit the single_config.yaml file.
      vim single_config.yaml
      Set the following parameters:
      • uninstall_cluster: true
      • k8s_nodes
      • deployment_size
      • linux_user
      • ssh_key
    6. Run the installation.
      ./sisense.sh single_config.yaml -y
  3.  Cleaning the environment

    Run this cleanup process from within each of your machines.

    1. Cleanup the space of unused images. Caution: This command will remove all unused images, make sure you are not developing on this server. sudo docker image prune -a -f
    2. Remove Kubernetes installation leftovers.
      sudo reboot

      for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do 
      sudo umount $mount 2>/dev/null; done

      sudo rm -rf /etc/ceph \
       /etc/cni \
       /etc/kubernetes \
       /opt/cni \
       /opt/rke \
       /run/secrets/kubernetes.io \
       /run/calico \
       /run/flannel \
       /var/lib/calico \
       /var/lib/etcd \
       /var/lib/cni \
       /var/lib/kubelet \
       /var/lib/rancher/rke/log \
       /var/log/containers \
       /var/log/kube-audit \
       /var/log/pods \
       /var/run/calico 
  4.  Installing Sisense with RKE
    1. Download the Sisense tar.gz file.
      wget [sisense-linux-deployment-link]
    2. Extract the tar.gz file into the sisense-version folder:
      tar zxf [sisense-linux-deployment-package-name]
    3. Navigate to the sisense-version directory.
      cd sisense-[sisense-version]
    4. Edit the single_config.yaml file.
      vim single_config.yaml
      Set the following parameters:
      • uninstall_cluster: false
      • uninstall_sisense: false
      • update: false
      • k8s_nodes
      • deployment_size
      • linux_user
      • ssh_key
    5. Run the installation.
      ./sisense.sh single_config.yaml -y
    6. Save all the application's scheduled builds.
      kubectl create -f cronjobs.json -o yaml | kubectl apply -f -
  5.  Restoring the application
    1. From the CLI, execute the CLI activation command:
      source add_completion-ns-sisense.sh
    2. Extract the name of the new management pod.
      kubectl get po -n sisense -l "app=management" -oname | awk -F '/' '{print $2}'
    3. Store the backup in the management pod in the /opt/sisense/storage/system_backups/ directory.
      kubectl cp <backup path> <sisense namespace>/<managment pod>:/opt/sisense/storage/system_backups/<backup path> -c management
    4. Restore the application.
      si system restore -name <backup path>

Was this article helpful?