DEV Community

Cover image for Rancher 101 - Upgrade Rancher(Docker)
Muhammad Abdur Rofi
Muhammad Abdur Rofi

Posted on

Rancher 101 - Upgrade Rancher(Docker)

Upgrading Rancher

The upgrade procedure for Rancher running in a Docker container is similar to the procedure for making and restoring a backup, except that instead of starting the existing Rancher container, we'll start a new one with the new version. Rancher will perform any upgrades on the data itself when it starts.

Docker Volume

  1. Stop the Rancher container
  2. Create a data container that uses the same volume
  3. Launch a temporary container that extracts /var/lib/rancher to a local tarball
  4. Pull the latest or desired version of the Rancher server container image
  5. Start a new container with the same certificate options as the original container, adding a --volumes-from directive that points to the data container.
  6. Verify the upgrade by logging into the new Rancher server and confirming that it is operating correctly.
  7. Delete the stopped Rancher container so that it doesn't restart if the host is rebooted.

Bind-Mounted Volume

  1. Stop the Rancher container
  2. Create a tarball from the bind-mount directory
  3. Pull the latest or desired version of the Rancher server container image
  4. Start a new container with the same certificate options as the original container, mounting the bind-mounthost directory to /var/lib/rancher
  5. Verify the upgrade by logging into the new Rancher server and confirming that it is operating correctly.
  6. Delete the stopped Rancher container so that it doesn't restart if the host is rebooted.

If the upgraded Rancher server does not operate as expected, stop it, follow the steps to restore the backup, and start the old container to return to the previous state. Once Rancher is back up and running, delete the failed upgrade container from the host.

References

Discussion (0)