1.4.x to 1.5.x
Here are the detailed instructions of the self hosted controller upgrade from 1.4.x to 1.5.x.
Prerequisites¶
- Make sure all the pods are up and running in the existing controller
- Check if all the clusters are healthy
Backup data from controller¶
DB backup¶
From postgres pods
kubectl exec -it -n rafay-core postgres-admin-0 bash
su - postgres
pg_dumpall -U postgres > /home/postgres/preupgrade_allDB.sql
From the controller copy it into the backup location
mkdir ~/backups
kubectl cp -n rafay-core postgres-admin-0:/home/postgres/preupgrade_allDB.sql ~/backups/preupgrade_allDB.sql
Secrets and Certificates backup¶
kubectl get secrets -A -o yaml > ~/backups/all_secrets.yaml
kubectl get certificates -A -o yaml > ~/backups/all_certificates.yaml
Take salt backup¶
Exec into the salt-master pod and backup the directories under it.
kubectl exec -it -n rafay-core <salt-master-pod> bash
kubectl cp -n rafay-core <salt-master-pod>:/etc/salt/pki ~/backups/salt-master
Download Software¶
-
Click [here][https://rafay.zendesk.com/]) to download v1.5.x of the self hosted controller software package
-
Untar the package using the command
tar -xf rafay-controller-v1.5.1.18.tar.gz
- Once the downloaded file is untarred, take a backup of the existing config file
sudo mv ./radm /usr/bin/
mv config.yaml config.yaml-1-4-back
cp -rp config.yaml-tmpl config.yaml
vi config.yaml
diff -y config.yaml-1-4-back config.yaml
- Customize config.yaml with required changes compared with the existing config.yaml
- After all the required changes are done to the config file save it and exit
- Delete the tsdb helm
helm delete rafay-tsdb -n rafay-core
- Check if there are any tsdb service’s running and delete them also
kubectl delete svc -n rafay-core rafay-tsdb-config
- Delete the kafka-core service
kubectl delete svc -n rafay-core kafka-core
- Edit the storage class and add allowVolumeExpansion: true
kubectl edit storageclass openebs-hostpath
allowVolumeExpansion: true
- Update the postgresql volume to 55G
kubectl edit postgresql -n rafay-core postgres-admin
volume:
size: 55Gi
storageClass: openebs-hostpath
- Upgrade the RADM dependencies to the controller
sudo radm dependency --config config.yaml
-
Check for pod status
kubectl get pod -A
-
Check if all pods are in running/completed state.
- Once they are ready, run the below command to refresh the DB with the latest configuration. This will not affect the data present in DB.
kubectl delete pods -n rafay-core -l spilo-role=master
-
Upgrade RADM applications to the controller
sudo radm application --config config.yaml
-
Check for pod status
kubectl get pod -A
Note: Verify if the workload is running on the cluster node
Post Upgrade Migration¶
- Clear all browser cache, cookies and login into below URL using the credentials passed in config.yaml under super-user section
https://ops-console.<controller-FQDN>
- After login, hit the below API which triggers the DB migrations
https://ops-console.<controller-FQDN>/edge/v1/migrations/
-
Just a plain screen without any error represents the migration is complete.
-
Check for pods
kubectl get po -A
Cluster Upgrade¶
-
Once the controller is upgraded, all the existing clusters can be upgraded via using blueprint sync
-
Edit the blueprint which is used for the existing clusters
- Create a new version of blueprint with existing addons
- Name the blueprint with a new version number
- Trigger the blueprint sync from the cluster settings
- Select the new version of the blueprint created above and Publish
- Once the Blueprint sync is complete, means that the cluster is completely upgraded to v1.5