Merge pull request #698 from MBishop17/helm-upgrade

Helm upgrade
This commit is contained in:
Denise
2018-08-27 15:46:43 -07:00
committed by GitHub
6 changed files with 64 additions and 57 deletions
@@ -6,26 +6,26 @@ Rancher supports installing from a private registry. In every [release](https://
>**Prerequisite:** It is assumed you either have your own private registry or other means of distributing docker images to your machine. If you need help with creating a private registry, please refer to the [Docker documentation for private registries](https://docs.docker.com/registry/). >**Prerequisite:** It is assumed you either have your own private registry or other means of distributing docker images to your machine. If you need help with creating a private registry, please refer to the [Docker documentation for private registries](https://docs.docker.com/registry/).
>**Note:** In Rancher v2.0.0, registries with authentication are not supported for installing from a private registry. The Docker images can only be pulled from a registry without authentication enabled. This limitation only applies to Docker images. >**Note:** In Rancher v2.0.x, registries with authentication are not supported for installing from a private registry. The Docker images can only be pulled from a registry without authentication enabled. This limitation only applies to Docker images.
## Release files ## Release Files
* **rancher-images.txt**: Contains all images needed for that release. * **rancher-images.txt**: Contains all images needed for that release.
* **rancher-save-images.sh**: This script will pull all needed images from DockerHub, and save all of the images as a compressed file called `rancher-images.tar.gz`. This file can be transferred to your on-premise host that can access your private registry. * **rancher-save-images.sh**: This script will pull all needed images from DockerHub, and save all of the images as a compressed file called `rancher-images.tar.gz`. This file can be transferred to your on-premise host that can access your private registry.
* **rancher-load-images.sh**: This script will load images from rancher-images.tar.gz and push them to your private registry. You have to supply the hostname of your private registry as first argument to the script.<br/>`rancher-load-images.sh registry.yourdomain.com:5000` * **rancher-load-images.sh**: This script will load images from rancher-images.tar.gz and push them to your private registry. You have to supply the hostname of your private registry as first argument to the script.<br/>`rancher-load-images.sh registry.yourdomain.com:5000`
## Making the Rancher images available ## Making the Rancher Images Available
We will cover two scenarios: We will cover two scenarios:
* **Scenario 1**: You have a node that can access DockerHub to pull and save the images, and a separate node(s) that access your private registry to push the images. * **Scenario 1**: You have a node that can access DockerHub to pull and save the images, and a separate node(s) that access your private registry to push the images.
* **Scenario 2**: You have node(s) that can access both DockerHub and your private registry. * **Scenario 2**: You have node(s) that can access both DockerHub and your private registry.
### Scenario 1: A node that can access DockerHub, separate node(s) that can access the private registry ### Scenario 1: A Node that Can Access DockerHub, Separate Node(s) That Can Access the Private Registry
![Scenario1]({{< baseurl >}}/img/rancher/airgap/privateregistry.svg) ![Scenario1]({{< baseurl >}}/img/rancher/airgap/privateregistry.svg)
1. Browse to the release page of your version (i.e. `https://github.com/rancher/rancher/releases/tag/v2.0.0`) and download `rancher-save-images.sh` and `rancher-load-images.sh` 1. Browse to the release page of your version of Rancher (e.g. `https://github.com/rancher/rancher/releases/tag/v2.0.0`) and download `rancher-save-images.sh` and `rancher-load-images.sh`.
2. Transfer and run `rancher-save-images.sh` on the host the can access DockerHub. This will require at least 20GB of disk space. 2. Transfer and run `rancher-save-images.sh` on the host the can access DockerHub. This will require at least 20GB of disk space.
@@ -37,7 +37,7 @@ We will cover two scenarios:
![Scenario2]({{< baseurl >}}/img/rancher/airgap/privateregistrypushpull.svg) ![Scenario2]({{< baseurl >}}/img/rancher/airgap/privateregistrypushpull.svg)
1. Browse to the release page of your version (i.e. `https://github.com/rancher/rancher/releases/tag/v2.0.0`) and download `rancher-images.txt` 1. Browse to the release page of your version of Rancher (e.g. `https://github.com/rancher/rancher/releases/tag/v2.0.0`) and download `rancher-images.txt`.
2. Pull all the images present in `rancher-images.txt`, re-tag each image with the location of your registry, and push the image to the registry. This will require at least 20GB of disk space. See an example script below: 2. Pull all the images present in `rancher-images.txt`, re-tag each image with the location of your registry, and push the image to the registry. This will require at least 20GB of disk space. See an example script below:
``` ```
@@ -52,7 +52,7 @@ We will cover two scenarios:
done done
``` ```
## Completing the Rancher installation ## Completing the Rancher Installation
After your private registry is setup on all node(s) for your Rancher installation, complete your Rancher installation. After your private registry is setup on all node(s) for your Rancher installation, complete your Rancher installation.
@@ -65,21 +65,26 @@ Complete installation of Rancher using the instructions in [Single Node Install]
> >
> Example: > Example:
> ``` > ```
docker run -d --restart=unless-stopped \ > docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \ > -p 80:80 -p 443:443 \
<registry.yourdomain.com:port>/rancher/rancher:latest > <registry.yourdomain.com:port>/rancher/rancher:latest
``` ```
## Configuring Rancher to use the private registry ## Configuring Rancher to Use the Private Registry
Rancher needs to be configured to use the private registry as source for the needed images. Rancher needs to be configured to use the private registry as source for the needed images.
1. Go into the Settings view. 1. Go into the **Settings** view.
![Settings]({{< baseurl >}}/img/rancher/airgap/settings.png)
![Settings]({{< baseurl >}}/img/rancher/airgap/settings.png)
2. Look for the setting called `system-default-registry` and choose **Edit**. 2. Look for the setting called `system-default-registry` and choose **Edit**.
![Edit]({{< baseurl >}}/img/rancher/airgap/edit-system-default-registry.png)
3. Change the value to your registry, e.g. `registry.yourdomain.com:port`. Do not prefix the registry with `http://` or `https://` ![Edit]({{< baseurl >}}/img/rancher/airgap/edit-system-default-registry.png)
![Save]({{< baseurl >}}/img/rancher/airgap/enter-system-default-registry.png)
3. Change the value to your registry (e.g. `registry.yourdomain.com:port`). Do not prefix the registry with `http://` or `https://`.
![Save]({{< baseurl >}}/img/rancher/airgap/enter-system-default-registry.png)
>**Note:** If you want to configure the setting when starting the rancher/rancher container, you can use the environment variable `CATTLE_SYSTEM_DEFAULT_REGISTRY`. >**Note:** If you want to configure the setting when starting the rancher/rancher container, you can use the environment variable `CATTLE_SYSTEM_DEFAULT_REGISTRY`.
@@ -9,10 +9,12 @@ This section contains information about how to upgrade your Rancher server to a
- [Upgrading a Single Node Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/) - [Upgrading a Single Node Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/)
- [Upgrading an Air Gapped Single Node Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/single-node-air-gap-upgrade/) - [Upgrading an Air Gapped Single Node Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/single-node-air-gap-upgrade/)
### HA Install with Helm Chart ### Upgrading to an HA Helm Chart
- [Upgrading a High Availability Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/ha-server-upgrade-helm/)
### HA Install with RKE Add-On yaml - [Upgrading from an HA Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/ha-server-upgrade-helm/)
- [Migrating from a RKE Add-On Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/migrating-from-rke-add-on/)
### Upgrading an RKE Add-on Install
- [Upgrading a High Availability Install - RKE Add-On Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/ha-server-upgrade/)
- [Migrating from a High Availability RKE Add-on Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/migrating-from-rke-add-on/)
- [Upgrading a High Availability Install - RKE Add-On Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/ha-server-upgrade/)
@@ -3,63 +3,63 @@ title: High Availability (HA) Upgrade
weight: 1020 weight: 1020
--- ---
The following instructions will help guide you through upgrading Rancher server [HA installed with the Helm package manager]({{< baseurl >}}/rancher/v2.x/en/installation/ha/). The following instructions will guide you through upgrading a high-availability Rancher Server that was [installed using Helm package manager]({{< baseurl >}}/rancher/v2.x/en/installation/ha/).
If you installed Rancher using the RKE Add-On yaml, see these docs to migrate or upgrade. >**Note:** If you installed Rancher using the RKE Add-on yaml, see the following documents to migrate or upgrade.
>
>* [Migrating from RKE Add-On Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/migrating-from-rke-add-on)
* [Migrating from RKE Add-On Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/migrating-from-rke-add-on) As of release v2.0.8, Rancher supports installation and upgrade by Helm chart, although RKE installs/upgrades are still supported as well. If you want to change upgrade method from RKE Add-on to Helm chart, follow this procedure.
* [High Availability (HA) Upgrade - RKE Add-On Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/ha-server-upgrade)
>* [High Availability (HA) Upgrade - RKE Add-On Install]({{< baseurl >}}/rancher/v2.x/en/upgrades/ha-server-upgrade)
If you want to continue using RKE for upgrades, follow this procedure.
## Prerequisites ## Prerequisites
### kubectl - **Backup your Rancher cluster**
Follow the `kubectl` configuration instructions and confirm that you can connect to the Kubernetes cluster running Rancher server. [Take a one-time snapshot]({{< baseurl >}}/rancher/v2.x/en/backups/backups/ha-backups/#option-b-one-time-snapshots)
of your Rancher Server cluster. You'll use the snapshot as a restoration point if something goes wrong during upgrade.
* [kubectl Installation and Config]({{< baseurl >}}/rancher/v2.x/en/faq/kubectl) - **kubectl**
### helm Follow the kubectl [configuration instructions]({{< baseurl >}}/rancher/v2.x/en/faq/kubectl) and confirm that you can connect to the Kubernetes cluster running Rancher server.
Install or update `helm` to the latest version. - **Helm**
* [Installing helm](https://docs.helm.sh/using_helm/#installing-helm) [Install or update](https://docs.helm.sh/using_helm/#installing-helm) Helm to the latest version.
### tiller - **Tiller**
Update the helm agent, `tiller` on your cluster. Update the helm agent, Tiller, on your cluster.
``` ```
helm init --upgrade --service-account tiller helm init --upgrade --service-account tiller
``` ```
## Backup Your Rancher Cluster
Follow the instructions to take a one-time snapshot of your Rancher server cluster.
* [HA Backups: Take a One-Time Snapshot]({{< baseurl >}}/rancher/v2.x/en/backups/backups/ha-backups/#option-b-one-time-snapshots)
## Upgrade Rancher ## Upgrade Rancher
Update your local helm repo cache. 1. Update your local helm repo cache.
``` ```
helm repo update helm repo update
``` ```
Get the set values from current Rancher release. 2. Get the set values from current Rancher release.
``` ```
helm get values rancher helm get values rancher
hostname: rancher.my.org hostname: rancher.my.org
``` ```
Take the values above and use `helm` with `--set` options to upgrade Rancher to the latest version. 3. Take the values above and use `helm` with `--set` options to upgrade Rancher to the latest version.
``` ```
helm upgrade rancher rancher-stable/rancher --set hostname=rancher.my.org helm upgrade rancher rancher-stable/rancher --set hostname=rancher.my.org
``` ```
## Rolling Back ## Rolling Back
Should something go wrong, follow the [HA Rollback]({{< baseurl >}}/rancher/v2.x/en/upgrades/rollbacks/ha-server-rollbacks/) instructions to restore the snapshot you took before you preformed the upgrade. Should something go wrong, follow the [HA Rollback]({{< baseurl >}}/rancher/v2.x/en/upgrades/rollbacks/ha-server-rollbacks/) instructions to restore the snapshot you took before you preformed the upgrade.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 20 KiB