Upgrading Anaconda Enterprise¶
This page describes how to update your Anaconda Enterprise to its latest version.
NOTE: Before you begin any upgrade, you must back up and test your Anaconda Enterprise configuration and data files. Also, ensure all users have saved their work and logged out.
In-place Upgrade Anaconda Enterprise from 5.1.0 to 5.1.2¶
This is the recommended upgrade path, requiring nearly no downtime.
Download the 5.1.2 installer file.
Add OS settings required for 5.1.2:
sudo sysctl -w fs.may_detach_mounts=1 sudo sysctl -w net.bridge.bridge-nf-call-iptables=1 sudo sysctl -w net.ipv4.ip_forward=1
Add settings to
/etc/sysctl.conf:net.ipv4.ip_forward = 1 net.bridge.bridge-nf-call-iptables = 1 fs.may_detach_mounts = 1
Run
sudo ./upgradeUpdate the version of the app images in the configmap.
First, edit the configmap:
sudo gravity enter kubectl edit cm
Next, in the configmap, update the app images to the new version of the images in the installer:
data: anaconda-platform.yml images: app: apiserver:5000/ap-app:5.1.2-O app_proxy: apiserver:5000/ap-app-proxy:5.1.2-O editor: apiserver:5000/ap-editor:5.1.2-O
Restart all Anaconda Enterprise pods:
kubectl get pods | grep ap- | cut -d' ' -f1 | xargs kubectl delete pods
Upgrading Anaconda Enterprise from 5.0.X to 5.1.x¶
Upgrading your Anaconda Enterprise (AE) installation from version 5.0.x to a newer version of Anaconda Enterprise requires the uninstallation of the current version and installation of the new version of the platform. The steps include backing up data, uninstalling AE, and installing the newer version of AE.
Stage 1 - Backup Anaconda Enterprise¶
NOTE: All of the following commands should be run on the master node.
Back up the Anaconda Enterprise configuration:
sudo gravity backup anaconda-enterprise-backup.tar.gz
Ensure all users have saved their work and logged out. To prevent any database transactions, stop the AE database with:
sudo gravity enter kubectl delete deploy postgres
Exit the Anaconda Enterprise environment by typing
exit.All of the persistent data in AE is stored on the master node in
/opt/anaconda/storage, you can backup your data by running the following command:sudo tar -zcvf anaconda-data.tar.gz /opt/anaconda/
Restart the AE database:
sudo gravity enter kubectl apply -f /var/lib/gravity/local/packages/unpacked/gravitational.io/AnacondaEnterprise/*/resources/postgres.yaml # Restart service pods kubectl get pods | grep ap- | cut -d' ' -f1 | xargs kubectl delete pods
Exit the Anaconda Enterprise environment by typing
exit.
Stage 2 - Uninstall Anaconda Enterprise¶
To uninstall Anaconda Enterprise on a healthy master node, run:
sudo gravity system uninstall sudo killall gravity sudo killall planet sudo rm -rf /var/lib/gravity
If
/var/lib/gravityis present after the uninstallation, you should reboot your machine and retry thesudo gravity system uninstallcommand.Reboot.
This ensures that any Anaconda Enterprise state is flushed from your system.
Stage 3 - Install Anaconda Enterprise¶
Download the installer file for the newer AE version that you want to upgrade to.
Follow the installation instructions to install the newer version of Anaconda Enterprise, which will use the existing data in
/opt/anaconda.Update the Anaconda Enterprise configuration to match the latest configuration schema. Note that we do not currently version the schema of the
anaconda-platform.yml, so there may be breaking changes between versions.Check the logs for each service for errors about new or missing fields. If you see any errors, manually update the configuration to match the new schema.
Significant known schema changes, with the version they were added in, are detailed below:
5.1.x
The field format for specifying passive license information has changed. The field
license.client-idis nowlicense.number, and the fieldlicense.client-certificateis nowlicense.key.Ensure that your SSL certificate filenames are correct.
In Anaconda Enterprise 5.1.0 and newer, the default SSL certificate filenames provided by the installer are different than in previous versions. It is recommended that you update any Kubernetes secrets you created and update the Anaconda Enterprise configuration to match the new filenames.
Previous Updated rootca.pemrootca.crtcert.pemserver.crtprivkey.pemserver.keytls.crtwildcard.crttls.keywildcard.keyNOTE: the
keystore.jksfilename is unchanged.Add roles and associate them with the appropriate users (if upgrading from 5.0.x):
ae-admin ae-creator ae-deployer ae-uploader
Restart all Anaconda Enterprise pods:
kubectl get pods | grep ap- | cut -d' ' -f1 | xargs kubectl delete pods
Troubleshooting¶
In-place upgrades from a version other than 5.1.0 to 5.1.2¶
If an attempt was made to perform an in-place upgrade from a version other than 5.1.0 to 5.1.2, the service pods will be in the ImagePullBackOff state. To recover, execute the following command with the correct original version:
kubectl get deployments -n default -o yaml | sed \"s/:original-version/:5.1.2-0/g\" | kubectl replace -f - && kubectl get pods -n default | grep ap- | cut -d' ' -f1 | xargs kubectl delete pods -n default