making edits for air gap

This commit is contained in:
Mark Bishop
2018-09-18 19:29:26 -07:00
parent 4e3dc421ba
commit 9aee0adaf4
7 changed files with 74 additions and 27 deletions
@@ -5,15 +5,21 @@ aliases:
---
For the first part of your air gap install, you'll prepare your private registry for Rancher installation by downloading the Rancher release files, and then pushing them to your private registry.
<a id="step-1"></a>
1. Browse to the [Rancher releases page](https://github.com/rancher/rancher/releases) and download the following files from the build with the `Latest release` tag.
1. Browse to the [Rancher releases page](https://github.com/rancher/rancher/releases) and download the following files from the version of Rancher tagged with `Latest release`.
| Release File | Description |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rancher-images.txt` | Contains all images needed to deploy the release. |
| `rancher-load-images.sh` | This script loads images from `rancher-images.tar.gz` and pushes 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-images.txt` | This file contains all images needed to deploy the release. |
| `rancher-load-images.sh` | This script loads images from `rancher-images.tar.gz` and pushes them to your private registry. You must supply the hostname of your private registry as first argument to the script.<br/>`rancher-load-images.sh registry.yourdomain.com:5000` |
| `rancher-save-images.sh` | This script pulls all needed images from DockerHub and saves 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. |
>**Installing on a single node?**
>
>The next two steps don't apply to you. Skip to [step 4](#pop-reg).
1. **High Availablity Installs Only:** You need some additional software to complete installation in an air gap environment. Download the software in the table below.
@@ -22,8 +28,9 @@ For the first part of your air gap install, you'll prepare your private registry
| RKE | Rancher Kubernetes Engine (RKE) is Rancher's fast, light-weight Kubernetes installer. |
| Helm Image (tiller) | You can discover the tiller image compatible with your installed version of Helm.
| cert-manager | Rancher uses the [cert-manager](https://github.com/jetstack/cert-manager) project to issue self-singed certificates for Rancher GUI/Agent access.
1. From a system with internet access, use the shell script below to compile the images required by the latest Rancher release and write them to `images.txt` in the local directory.
1. **High Availablity Installs Only:** From a system with internet access, paste the sample below into an empty file and save it as a shell script. Run the script to compile the images required by the latest Rancher release and write them to `images.txt` in the local directory.
```bash
#!/bin/bash
@@ -57,32 +64,48 @@ For the first part of your air gap install, you'll prepare your private registry
# cleanup tmp file
rm tmp-images.txt
```
<br/>
1. Use the Rancher release that you just downloaded to populate your private registry with Rancher images. Use the scenario that best matches your use case.
<a id="pop-reg"></a>
1. Use the Rancher release files that you downloaded in [step 1](#step-1) to populate your private registry with Rancher images. Use the scenario that best matches your use case.
<br/>
{{% tabs %}}
{{% tab "Scenario 1" %}}
<br/>
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.
The architecture for this scenario is:
- A host that can access DockerHub, which pulls and saves Rancher images from the Internet.
- An on-premise host that acts as an intermediary between:
- The host that can access DockerHub.
- Your private registry.
- An on-premise private registry, which you'll use to deploy Rancher in your air gap environment.
<br/>
<br/>
![Scenario1]({{< baseurl >}}/img/rancher/airgap/privateregistry.svg)
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`.
1. From the host that can access DockerHub, run `rancher-save-images.sh`. 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.
1. Transfer the output file from the previous step (`rancher-images.tar.gz`) to the on-premise host that can access the private registry.
3. Transfer the output file from step 2 (`rancher-images.tar.gz`) to the host that can access the private registry.
4. Transfer and run `rancher-load-images.sh` on the host that can access the private registry. It should be run in the same directory as `rancher-images.tar.gz`.
1. Transfer and run `rancher-load-images.sh` on the host that can access the private registry. It should be run in the same directory as `rancher-images.tar.gz`.
{{% /tab %}}
{{% tab "Scenario 2" %}}
<br/>
You have node(s) that can access both DockerHub and your private registry.
The architecture for this scenario is:
- A host that can access both DockerHub and your private registry
- An on-premise private registry, which you'll use to deploy Rancher in your air gap environment.
<br/>
<br/>
![Scenario2]({{< baseurl >}}/img/rancher/airgap/privateregistrypushpull.svg)
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:
```
#!/bin/sh
IMAGES=`curl -s -L https://github.com/rancher/rancher/releases/download/v2.0.0/rancher-images.txt`
@@ -1,5 +1,5 @@
---
title: 1 - Create Nodes and Load Balancer
title: 1—Create Nodes and Load Balancer
weight: 185
---
@@ -13,6 +13,8 @@ Helm installs the `tiller` service on your cluster to manage charts. Since RKE e
* Create the `ClusterRoleBinding` to give the `tiller` account access to the cluster.
* Finally use `helm` to initialize the `tiller` service
>**Using Air Gap?** [Add the private registry's FQDN]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#initialize-helm-using-private-registry) to the command.
```
kubectl -n kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller \
@@ -23,6 +23,9 @@ Rancher relies on [cert-manager](https://github.com/kubernetes/charts/tree/maste
Install `cert-manager` from the Helm stable catalog.
>**Using Air Gap?** [Add the private registry's FQDN]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#install-cert-manager-using-private-registry) to the command.
```
helm install stable/cert-manager \
--name cert-manager \
@@ -47,6 +50,8 @@ The default is for Rancher to generate a CA and use the `cert-manager` to issue
The only requirement is to set the `hostname` to the DNS name you pointed at your Load Balancer.
>**Using Air Gap?** [Set the `rancherImage` option]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#install-rancher-using-private-registry) in your command, pointing toward your private registry.
```
helm install rancher-stable/rancher \
--name rancher \
@@ -60,6 +65,8 @@ Use [LetsEncrypt](https://letsencrypt.org/)'s free service to issue trusted SSL
Set `hostname`, `ingress.tls.source=letEncrypt` and LetsEncrypt options.
>**Using Air Gap?** [Set the `rancherImage` option]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#install-rancher-using-private-registry) in your command, pointing toward your private registry.
```
helm install rancher-stable/rancher \
--name rancher \
@@ -1,15 +1,19 @@
---
title: 2 - Install Kubernetes with RKE
title: 2—Install Kubernetes with RKE
weight: 190
---
Use RKE to install Kubernetes with a high-availability etcd configuration.
Use RKE to install Kubernetes with a high availability etcd configuration.
### Create the rancher-cluster.yml file
### Create the `rancher-cluster.yml` File
Using the sample below create the `rancher-cluster.yml` file. Replace the IP Addresses in the `nodes` list with the IP address or DNS names of the 3 Nodes you created.
> **Note:** If your node has public and internal addresses, it is recommended to set the `internal_address:` so Kubernetes will use it for intra-cluster communication. Some services like AWS EC2 require setting the `internal_address:` if you want to use self-referencing security groups or firewalls.
> **Notes:**
>
>- Air Gap User? [Add a private registry section]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#add-private-registry-to-rke-yaml) to the sample below.
>- If your node has public and internal addresses, it is recommended to set the `internal_address:` so Kubernetes will use it for intra-cluster communication. Some services like AWS EC2 require setting the `internal_address:` if you want to use self-referencing security groups or firewalls.
```yaml
nodes:
@@ -24,7 +28,7 @@ nodes:
role: [controlplane,worker,etcd]
```
#### Common RKE nodes: options
#### Common RKE Nodes: Options
| Option | Description |
| --- | --- |
@@ -34,9 +38,7 @@ nodes:
| `ssh_key_path` | (optional) Path to SSH private key used to authenticate to the node |
| `user` | (required) A user that can run docker commands |
<br/>
#### Advanced configurations
#### Advanced Configurations
RKE has many configuration options for customizing the install to suit your specific environment.
@@ -48,7 +50,7 @@ Please see the [RKE Documentation]({{< baseurl >}}/rke/v0.1.x/en/) for the full
rke up --config ./rancher-cluster.yml
```
### Testing your cluster
### Testing Your Cluster
RKE should have created a file `kube_config_rancher-cluster.yml`. This file has the credentials for `kubectl` and `helm`.
@@ -69,7 +71,7 @@ NAME STATUS ROLES AGE VER
165.227.127.226 Ready controlplane,etcd,worker 11m v1.10.1
```
### Check the health of your cluster pods
### Check the Health of Your Cluster Pods
Check that all the required pods and containers are healthy are ready to continue.
@@ -96,7 +98,7 @@ kube-system rke-metrics-addon-deploy-job-7ljkc 0/1 Completed
kube-system rke-network-plugin-deploy-job-6pbgj 0/1 Completed 0 30s
```
### Save your files
### Save Your Files
Save a copy of the `kube_config_rancher-cluster.yml` and `rancher-cluster.yml` files. You will need these files to maintain and upgrade your Rancher instance.
@@ -33,10 +33,13 @@ If you are installing Rancher in a development or testing environment where iden
Log into your Linux host, and then run the minimum installation command below.
>**Air Gap User?** [Add your private registry URL]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#add-private-registry-url-to-run-command) before the `rancher/rancher` image tag.
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
rancher/rancher:latest
{{% /accordion %}}
{{% accordion id="option-b" label="Option B-Bring Your Own Certificate: Self-Signed" %}}
In development or testing environments where your team will access your Rancher server, create a self-signed certificate for use with your install so that your team can verify they're connecting to your instance of Rancher.
@@ -52,6 +55,8 @@ After creating your certificate, run the Docker command below to install Rancher
- Replace `<CERT_DIRECTORY>` with the directory path to your certificate file.
- Replace `<FULL_CHAIN.pem>`,`<PRIVATE_KEY.pem>`, and `<CA_CERTS>` with your certificate names.
>**Air Gap User?** [Add your private registry URL]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#add-private-registry-url-to-run-command) before the `rancher/rancher` image tag.
```
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
@@ -76,6 +81,8 @@ After obtaining your certificate, run the Docker command below.
- Use the `--no-cacerts` as argument to the container to disable the default CA certificate generated by Rancher.
>**Air Gap User?** [Add your private registry URL]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#add-private-registry-url-to-run-command) before the `rancher/rancher` image tag.
```
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
@@ -97,6 +104,7 @@ For production environments, you also have the options of using [Let's Encrypt](
After you fulfill the prerequisites, you can install Rancher using a Let's Encrypt certificate by running the following command. Replace `<YOUR.DNS.NAME>` with your your domain.
>**Air Gap User?** [Add your private registry URL]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#add-private-registry-url-to-run-command) before the `rancher/rancher` image tag.
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
@@ -47,6 +47,9 @@ If you elect to use a self-signed certificate to encrypt communication, you must
1. While running the Docker command to deploy Rancher, point Docker toward your CA certificate file.
>**Air Gap User?** [Add your private registry URL]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#add-private-registry-url-to-run-command) before the `rancher/rancher` image tag.
```
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
@@ -68,6 +71,8 @@ If you use a certificate signed by a recognized CA, installing your certificate
1. Enter the following command.
>**Air Gap User?** [Add your private registry URL]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/install-rancher/#add-private-registry-url-to-run-command) before the `rancher/rancher` image tag.
```
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \