mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-25 12:38:05 +00:00
@@ -5,3 +5,6 @@ aliases:
|
||||
- /rancher/v2.x/en/installation/after-installation/
|
||||
---
|
||||
This section contains information about how to create backups of your Rancher data and how to restore them in a disaster scenario.
|
||||
|
||||
- For single node backup instructions, see
|
||||
- for high-availability backup instructions, see
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ Begin by gathering the files that you need to create backups of your Rancher ins
|
||||
- [High Availability Installation with External Load Balancer]({{< baseurl >}}/rancher/v2.x/en/installation/ha-server-install-external-lb)
|
||||
|
||||
<br/>
|
||||
### 2. Take Snapshots
|
||||
### 2. Take Snapshots of the `etcd` Database
|
||||
|
||||
Take snapshots of your `etcd` database. You can use these snapshots later to recover from a disaster scenario. There are two ways to take snapshots: recurringly, or as a one-off. Each option is better suited to a specific use case. Read the short description below each link to know when to use each option.
|
||||
|
||||
|
||||
@@ -9,60 +9,62 @@ This set of instructions creates a new Kubernetes cluster that's dedicated to ru
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
## Installation Outline
|
||||
|
||||
1. [Provision Linux Hosts](#part-1-provision-linux-hosts)
|
||||
Installation of Rancher in a high-availability configuration involves multiple procedures. Review this outline to learn about each procedure you need to complete.
|
||||
|
||||
1. [Provision Linux Hosts](#1-provision-linux-hosts)
|
||||
|
||||
Provision three Linux hosts to serve as your Kubernetes cluster.
|
||||
|
||||
2. [Configure Load Balancer](#part-2-configure-load-balancer)
|
||||
2. [Configure Load Balancer](#2-configure-load-balancer)
|
||||
|
||||
Configure your load balancer to have a highly available single point of entry to your Rancher cluster.
|
||||
|
||||
3. [Configure DNS](#part-3-configure-dns)
|
||||
3. [Configure DNS](#3-configure-dns)
|
||||
|
||||
Make your setup accessible using a DNS name by configuring the DNS to point to your loadbalancer.
|
||||
|
||||
4. [Download RKE](#part-4-download-rke)
|
||||
4. [Download RKE](#4-download-rke)
|
||||
|
||||
Rancher Kubernetes Engine (RKE) is a fast, versatile Kubernetes installer that you can use to install Kubernetes on your Linux hosts.
|
||||
[RKE](https://github.com/rancher/rke/releases) is a fast, versatile Kubernetes installer that you can use to install Kubernetes on your Linux hosts.
|
||||
|
||||
5. [Download Config File Template](#part-5-download-config-file-template)
|
||||
5. [Download RKE Config File Template](#5-download-config-file-template)
|
||||
|
||||
RKE uses a `.yml` config file to install and configure your Kubernetes cluster. Download one of our config file templates to get started.
|
||||
RKE uses a YAML config file to install and configure your Kubernetes cluster. Download one of our RKE config file templates to get started.
|
||||
|
||||
6. [Configure Nodes](#part-6-configure-nodes)
|
||||
6. [Configure Nodes](#6-configure-nodes)
|
||||
|
||||
Configure the **Nodes** section of the template.
|
||||
Configure the **Nodes** section of the RKE config template.
|
||||
|
||||
7. [Configure Certificates](#part-7-configure-certificates)
|
||||
7. [Configure Certificates](#7-configure-certificates)
|
||||
|
||||
Configure the **Certificates** part of the template too.
|
||||
|
||||
8. [Configure FQDN](#part-8-configure-fqdn)
|
||||
8. [Configure FQDN](#8-configure-fqdn)
|
||||
|
||||
You guessed it. Configure the **FQDN** part of the template.
|
||||
And the **FQDN** part.
|
||||
|
||||
9. [Backup Your YAML File](#part-9-backup-your-yaml-file)
|
||||
9. [Back Up Your RKE Config File](#9-back-up-your-rke-config-file)
|
||||
|
||||
After you've completed configuration of the config file template, back the config file up in a safe place. You can reuse this file for upgrades later.
|
||||
After you've completed configuration of the RKE config file: 1. it's no longer a template since you'll be using it, and 2. you should back up the RKE config file to a safe place. You will reuse this file for upgrades later.
|
||||
|
||||
10. [Run RKE](#part-10-run-rke)
|
||||
10. [Run RKE](#10-run-rke)
|
||||
|
||||
Run RKE to deploy Rancher to your cluster.
|
||||
|
||||
11. [Backup Config File](#part-11-backup-config-file)
|
||||
11. [Back Up Auto-Generated Config File](#11-back-up-auto-generated-config-file)
|
||||
|
||||
During installation, RKE generates a config file that you'll use later for upgrades. Back it up to a safe location.
|
||||
|
||||
12. **For those using a certificate signed by a recognized CA:**
|
||||
|
||||
[Remove Default Certificates](#part-12-remove-default-certificates)
|
||||
[Remove Default Certificates](#12-remove-default-certificates)
|
||||
|
||||
If you chose [Option B](#option-b-bring-your-own-certificate-signed-by-recognized-ca) as your SSL option, log into the Rancher UI and remove the certificates that Rancher automatically generates.
|
||||
|
||||
|
||||
## Part 1-Provision Linux Hosts
|
||||
<br/>
|
||||
## 1. Provision Linux Hosts
|
||||
|
||||
Before you install Rancher, confirm you meet the host requirements. Provision 3 new Linux hosts using the requirements below.
|
||||
|
||||
@@ -76,7 +78,7 @@ Before you install Rancher, confirm you meet the host requirements. Provision 3
|
||||
|
||||
{{< requirements_ports >}}
|
||||
|
||||
## Part 2-Configure Load Balancer
|
||||
## 2. Configure Load Balancer
|
||||
|
||||
When using a load balancer in front of Rancher, there's no need for the container to redirect port communication from port 80 or port 443. By passing the header `X-Forwarded-Proto: https`, this redirect is disabled. This is the expected configuration when terminating SSL externally.
|
||||
|
||||
@@ -99,222 +101,246 @@ We have example configurations for the following load balancers:
|
||||
|
||||
* [Amazon ALB]({{< baseurl >}}/rancher/v2.x/en/installation/ha-server-install-external-lb/alb)
|
||||
|
||||
## Part 3-Configure DNS
|
||||
## 3. Configure DNS
|
||||
|
||||
Choose a fully qualified domain name (FQDN) you want to use to access Rancher (something like `rancher.yourdomain.com`).<br/><br/>You need to create a DNS A record, pointing to the IP address of your [Load Balancer](#part-2-configure-load-balancer). If the DNS A record is created, you can validate if it's setup correctly by running `nslookup rancher.yourdomain.com`. It should return the IP address of your [Load Balancer](#part-2-configure-load-balancer) like in the example below.
|
||||
Choose a fully qualified domain name (FQDN) that you want to use to access Rancher (e.g., `rancher.yourdomain.com`).<br/><br/>
|
||||
|
||||
```
|
||||
$ nslookup rancher.yourdomain.com
|
||||
Server: your_nameserver_ip
|
||||
Address: your_nameserver_ip#53
|
||||
1. Log into your DNS server a create a `DNS A` record that points to the IP address of your [load balancer](#2-configure-load-balancer).
|
||||
|
||||
Non-authoritative answer:
|
||||
Name: rancher.yourdomain.com
|
||||
Address: ip_of_loadbalancer
|
||||
```
|
||||
2. Validate that the `DNS A` is working correctly. Run the following command from any terminal, replacing `HOSTNAME.DOMAIN.COM` with your chosen FQDN:
|
||||
|
||||
## Part 4-Download RKE
|
||||
`nslookup HOSTNAME.DOMAIN.COM`
|
||||
|
||||
Rancher Kubernetes Engine (RKE) is a fast, versatile Kubernetes installer that you can use to install Kubernetes on your Linux hosts. We will be using RKE to setup our cluster and run Rancher.
|
||||
**Step Result:** Terminal displays output similar to the following:
|
||||
|
||||
From your workstation, open a web browser and navigate to our [RKE Releases](https://github.com/rancher/rke/releases/latest) page. Download the latest RKE installer applicable to your Operating System:
|
||||
```
|
||||
$ nslookup rancher.yourdomain.com
|
||||
Server: YOUR_HOSTNAME_IP_ADDRESS
|
||||
Address: YOUR_HOSTNAME_IP_ADDRESS#53
|
||||
|
||||
* **MacOS**: `rke_darwin-amd64`
|
||||
* **Linux**: `rke_linux-amd64`
|
||||
Non-authoritative answer:
|
||||
Name: rancher.yourdomain.com
|
||||
Address: HOSTNAME.DOMAIN.COM
|
||||
```
|
||||
|
||||
Make the RKE binary that you just downloaded executable. Open Terminal, change directory to the location of the RKE binary, and then run the following command:
|
||||
<br/>
|
||||
|
||||
```
|
||||
# MacOS
|
||||
$ chmod +x rke_darwin-amd64
|
||||
# Linux
|
||||
$ chmod +x rke_linux-amd64
|
||||
```
|
||||
## 4. Download RKE
|
||||
|
||||
Confirm that RKE is now executable by running the following command:
|
||||
RKE is a fast, versatile Kubernetes installer that you can use to install Kubernetes on your Linux hosts. We will be using RKE to setup our cluster and run Rancher.
|
||||
|
||||
```
|
||||
# MacOS
|
||||
$ ./rke_darwin-amd64 -version
|
||||
# Linux
|
||||
$ ./rke_linux-amd64 -version
|
||||
```
|
||||
1. From your workstation, open a web browser and navigate to our [RKE Releases](https://github.com/rancher/rke/releases/latest) page. Download the latest RKE installer applicable to your Operating System:
|
||||
|
||||
**Result:** You receive output similar to what follows:
|
||||
```
|
||||
rke version v<N.N.N>
|
||||
```
|
||||
- **MacOS**: `rke_darwin-amd64`
|
||||
- **Linux**: `rke_linux-amd64`
|
||||
- **Windows**: `rke_windows-amd64.exe`
|
||||
|
||||
## Part 5-Download Config File Template
|
||||
2. Make the RKE binary that you just downloaded executable. Open Terminal, change directory to the location of the RKE binary, and then run one of the commands below.
|
||||
|
||||
RKE uses a `.yml` config file to install and configure your Kubernetes cluster. There are 2 templates to choose from, depending on the SSL certificate you want to use.
|
||||
>**Using Windows?**
|
||||
>The file is already an executable. Skip to [Download Config File Template](#5-download-config-file-template).
|
||||
|
||||
```
|
||||
# MacOS
|
||||
$ chmod +x rke_darwin-amd64
|
||||
# Linux
|
||||
$ chmod +x rke_linux-amd64
|
||||
```
|
||||
|
||||
3. Confirm that RKE is now executable by running the following command:
|
||||
|
||||
```
|
||||
# MacOS
|
||||
$ ./rke_darwin-amd64 --version
|
||||
# Linux
|
||||
$ ./rke_linux-amd64 --version
|
||||
```
|
||||
|
||||
**Step Result:** You receive output similar to what follows:
|
||||
```
|
||||
rke version v<N.N.N>
|
||||
```
|
||||
|
||||
## 5. Download RKE Config File Template
|
||||
|
||||
RKE uses a YAML config file to install and configure your Kubernetes cluster. There are 2 templates to choose from, depending on the SSL certificate you want to use.
|
||||
|
||||
1. Download one of following templates, depending on the SSL certificate you're using.
|
||||
|
||||
- [Template for using Self Signed Certificate (3-node-externalssl-certificate.yml)](https://raw.githubusercontent.com/rancher/rancher/58e695b51096b1f404188379cea6f6a35aea9e4c/rke-templates/3-node-externalssl-certificate.yml)
|
||||
- [Template for using Certificate Signed By A Recognized Certificate Authority (3-node-externalssl-recognizedca.yml)](https://raw.githubusercontent.com/rancher/rancher/58e695b51096b1f404188379cea6f6a35aea9e4c/rke-templates/3-node-externalssl-recognizedca.yml)
|
||||
- [Template for self-signed certificate<br/> `3-node-externalssl-certificate.yml`](https://raw.githubusercontent.com/rancher/rancher/58e695b51096b1f404188379cea6f6a35aea9e4c/rke-templates/3-node-externalssl-certificate.yml)
|
||||
- [Template for certificate signed by recognized CA<br/> `3-node-externalssl-recognizedca.yml`](https://raw.githubusercontent.com/rancher/rancher/58e695b51096b1f404188379cea6f6a35aea9e4c/rke-templates/3-node-externalssl-recognizedca.yml)
|
||||
|
||||
2. Rename the file to `rancher-cluster.yml`.
|
||||
|
||||
## Part 6-Configure Nodes
|
||||
## 6. Configure Nodes
|
||||
|
||||
Once you have the `rancher-cluster.yml` config file template, edit the nodes section to point toward your Linux hosts.
|
||||
|
||||
Open `rancher-cluster.yml` in your favorite text editor.
|
||||
1. Open `rancher-cluster.yml` in your favorite text editor.
|
||||
|
||||
Update the `nodes` section with the information of your [Linux hosts](#provision-linux-hosts)
|
||||
2. Update the `nodes` section with the information of your [Linux hosts](#provision-linux-hosts).
|
||||
|
||||
For each node in your cluster, update the following placeholders:
|
||||
|
||||
- `<IP>`: The IP address or hostname of the node.
|
||||
- `<USER>`: The username to use to setup a SSH connection to the node. If the user is not the `root` user, make sure the user has access to the Docker socket. This can be tested by logging in on the node as the configured user and run `docker ps`.
|
||||
- `<SSHKEY_FILE>`: The path of the SSH private key file used to authenticate to the node.
|
||||
|
||||
**Example nodes section YAML**
|
||||
For each node in your cluster, update the following placeholders: `IP_ADDRESS_X` and `USER`.
|
||||
|
||||
```
|
||||
nodes:
|
||||
- address: 1.1.1.1
|
||||
user: root
|
||||
- address: IP_ADDRESS_1
|
||||
# THE IP ADDRESS OR HOSTNAME OF THE NODE
|
||||
user: USER
|
||||
# USER WITH ADMIN ACCESS. USUALLY `root`
|
||||
role: [controlplane,etcd,worker]
|
||||
ssh_key_path: ~/.ssh/id_rsa
|
||||
- address: 2.2.2.2
|
||||
user: root
|
||||
# PATH TO SSH KEY THAT AUTHENTICATES ON YOUR WORKSTATION
|
||||
# USUALLY THE VALUE ABOVE
|
||||
- address: IP_ADDRESS_2
|
||||
user: USER
|
||||
role: [controlplane,etcd,worker]
|
||||
ssh_key_path: ~/.ssh/id_rsa
|
||||
- address: 3.3.3.3
|
||||
user: root
|
||||
- address: IP_ADDRESS_3
|
||||
user: USER
|
||||
role: [controlplane,etcd,worker]
|
||||
ssh_key_path: ~/.ssh/id_rsa
|
||||
```
|
||||
|
||||
## Part 7-Configure certificates
|
||||
## 7. Configure Certificates
|
||||
|
||||
Certificates can be configured by using base64 encoded strings in the config file. The base64 encoded string can be generated using the following command:
|
||||
For security purposes, SSL (Secure Sockets Layer) is required when using Rancher. SSL secures all Rancher network communication, like when you login or interact with a cluster.
|
||||
|
||||
- **MacOS**: `cat FILENAME| base64`
|
||||
- **Linux**: `cat FILENAME | base64 -w0`
|
||||
- **Windows**: `certutil -encode FILENAME FILENAME.base64`
|
||||
Choose from the following options:
|
||||
|
||||
### Option A-Self Signed Certificate
|
||||
- [Option A—Bring Your Own Certificate: Self-Signed](#option-a-bring-your-own-certificate-self-signed)
|
||||
- [Option B—Bring Your Own Certificate: Signed by Recognized CA](#option-b-bring-your-own-certificate-signed-by-recognized-ca)
|
||||
|
||||
>**Note:**
|
||||
> If you are using Certificate Signed By A Recognized Certificate Authority, [click here](#option-b-certificate-signed-by-a-recognized-certificate-authority) to proceed.
|
||||
### Option A—Bring Your Own Certificate: Self-Signed
|
||||
|
||||
If you are using a Self Signed Certificate, you will need to generate a base64 encoded string for your CA certificate file.
|
||||
>**Prerequisites:**
|
||||
>Create a self-signed certificate.
|
||||
>
|
||||
>- The certificate files must be in [PEM format](#pem).
|
||||
>- The certificate files must be encoded in [base64](#base64).
|
||||
>- In your certificate file, include all intermediate certificates in the chain. Order your certificates with your certificate first, followed by the intermediates. For an example, see [SSL FAQ / Troubleshooting](#cert-order).
|
||||
|
||||
In the `kind: Secret` with `name: cattle-keys-server`:
|
||||
1. In `kind: Secret` with `name: cattle-keys-ingress`:
|
||||
|
||||
* Replace `<BASE64_CA>` with the base64 encoded string of the CA Certificate file (usually called `ca.pem` or `ca.crt`)
|
||||
* Replace `<BASE64_CA>` with the base64 encoded string of the CA Certificate file (usually called `ca.pem` or `ca.crt`)
|
||||
|
||||
After replacing the value, the file should look like the example below (the base64 encoded string should be different):
|
||||
>**Note:**
|
||||
> The base64 encoded string should be on the same line as `cacerts.pem`, without any newline at the beginning, in between or at the end.
|
||||
|
||||
>**Note:**
|
||||
> The base64 encoded string should be on the same line as `cacerts.pem`, without any newline at the beginning, in between or at the end.
|
||||
**Result:** After replacing the values, the file should look like the example below (the base64 encoded strings should be different):
|
||||
|
||||
```
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cattle-keys-server
|
||||
namespace: cattle-system
|
||||
type: Opaque
|
||||
data:
|
||||
cacerts.pem: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNvRENDQVlnQ0NRRHVVWjZuMEZWeU16QU5CZ2txaGtpRzl3MEJBUXNGQURBU01SQXdEZ1lEVlFRRERBZDAKWlhOMExXTmhNQjRYRFRFNE1EVXdOakl4TURRd09Wb1hEVEU0TURjd05USXhNRFF3T1Zvd0VqRVFNQTRHQTFVRQpBd3dIZEdWemRDMWpZVENDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFNQmpBS3dQCndhRUhwQTdaRW1iWWczaTNYNlppVmtGZFJGckJlTmFYTHFPL2R0RUdmWktqYUF0Wm45R1VsckQxZUlUS3UzVHgKOWlGVlV4Mmo1Z0tyWmpwWitCUnFiZ1BNbk5hS1hocmRTdDRtUUN0VFFZdGRYMVFZS0pUbWF5NU45N3FoNTZtWQprMllKRkpOWVhHWlJabkdMUXJQNk04VHZramF0ZnZOdmJ0WmtkY2orYlY3aWhXanp2d2theHRUVjZlUGxuM2p5CnJUeXBBTDliYnlVcHlad3E2MWQvb0Q4VUtwZ2lZM1dOWmN1YnNvSjhxWlRsTnN6UjVadEFJV0tjSE5ZbE93d2oKaG41RE1tSFpwZ0ZGNW14TU52akxPRUc0S0ZRU3laYlV2QzlZRUhLZTUxbGVxa1lmQmtBZWpPY002TnlWQUh1dApuay9DMHpXcGdENkIwbkVDQXdFQUFUQU5CZ2txaGtpRzl3MEJBUXNGQUFPQ0FRRUFHTCtaNkRzK2R4WTZsU2VBClZHSkMvdzE1bHJ2ZXdia1YxN3hvcmlyNEMxVURJSXB6YXdCdFJRSGdSWXVtblVqOGo4T0hFWUFDUEthR3BTVUsKRDVuVWdzV0pMUUV0TDA2eTh6M3A0MDBrSlZFZW9xZlVnYjQrK1JLRVJrWmowWXR3NEN0WHhwOVMzVkd4NmNOQQozZVlqRnRQd2hoYWVEQmdma1hXQWtISXFDcEsrN3RYem9pRGpXbi8walI2VDcrSGlaNEZjZ1AzYnd3K3NjUDIyCjlDQVZ1ZFg4TWpEQ1hTcll0Y0ZINllBanlCSTJjbDhoSkJqa2E3aERpVC9DaFlEZlFFVFZDM3crQjBDYjF1NWcKdE03Z2NGcUw4OVdhMnp5UzdNdXk5bEthUDBvTXl1Ty82Tm1wNjNsVnRHeEZKSFh4WTN6M0lycGxlbTNZQThpTwpmbmlYZXc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
||||
```
|
||||
```
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cattle-keys-server
|
||||
namespace: cattle-system
|
||||
type: Opaque
|
||||
data:
|
||||
cacerts.pem: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNvRENDQVlnQ0NRRHVVWjZuMEZWeU16QU5CZ2txaGtpRzl3MEJBUXNGQURBU01SQXdEZ1lEVlFRRERBZDAKWlhOMExXTmhNQjRYRFRFNE1EVXdOakl4TURRd09Wb1hEVEU0TURjd05USXhNRFF3T1Zvd0VqRVFNQTRHQTFVRQpBd3dIZEdWemRDMWpZVENDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFNQmpBS3dQCndhRUhwQTdaRW1iWWczaTNYNlppVmtGZFJGckJlTmFYTHFPL2R0RUdmWktqYUF0Wm45R1VsckQxZUlUS3UzVHgKOWlGVlV4Mmo1Z0tyWmpwWitCUnFiZ1BNbk5hS1hocmRTdDRtUUN0VFFZdGRYMVFZS0pUbWF5NU45N3FoNTZtWQprMllKRkpOWVhHWlJabkdMUXJQNk04VHZramF0ZnZOdmJ0WmtkY2orYlY3aWhXanp2d2theHRUVjZlUGxuM2p5CnJUeXBBTDliYnlVcHlad3E2MWQvb0Q4VUtwZ2lZM1dOWmN1YnNvSjhxWlRsTnN6UjVadEFJV0tjSE5ZbE93d2oKaG41RE1tSFpwZ0ZGNW14TU52akxPRUc0S0ZRU3laYlV2QzlZRUhLZTUxbGVxa1lmQmtBZWpPY002TnlWQUh1dApuay9DMHpXcGdENkIwbkVDQXdFQUFUQU5CZ2txaGtpRzl3MEJBUXNGQUFPQ0FRRUFHTCtaNkRzK2R4WTZsU2VBClZHSkMvdzE1bHJ2ZXdia1YxN3hvcmlyNEMxVURJSXB6YXdCdFJRSGdSWXVtblVqOGo4T0hFWUFDUEthR3BTVUsKRDVuVWdzV0pMUUV0TDA2eTh6M3A0MDBrSlZFZW9xZlVnYjQrK1JLRVJrWmowWXR3NEN0WHhwOVMzVkd4NmNOQQozZVlqRnRQd2hoYWVEQmdma1hXQWtISXFDcEsrN3RYem9pRGpXbi8walI2VDcrSGlaNEZjZ1AzYnd3K3NjUDIyCjlDQVZ1ZFg4TWpEQ1hTcll0Y0ZINllBanlCSTJjbDhoSkJqa2E3aERpVC9DaFlEZlFFVFZDM3crQjBDYjF1NWcKdE03Z2NGcUw4OVdhMnp5UzdNdXk5bEthUDBvTXl1Ty82Tm1wNjNsVnRHeEZKSFh4WTN6M0lycGxlbTNZQThpTwpmbmlYZXc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
||||
```
|
||||
|
||||
### Option B-Certificate Signed By A Recognized Certificate Authority
|
||||
### Option B—Bring Your Own Certificate: Signed by Recognized CA
|
||||
|
||||
If you are using a Certificate Signed By A Recognized Certificate Authority, you don't need to perform any step in this part.
|
||||
|
||||
## Part 8-Configure FQDN
|
||||
## 8. Configure FQDN
|
||||
|
||||
There is 1 reference to `<FQDN>` in the config file. This needs to be replaced with the FQDN chosen in [Configure DNS](#part-3-configure-dns).
|
||||
There is one reference to `<FQDN>` in the RKE config file. Replace this reference with the FQDN you chose in in [3. Configure DNS](#part-3-configure-dns).
|
||||
|
||||
In the `kind: Ingress` with `name: cattle-ingress-http`:
|
||||
1. Open `rancher-cluster.yml`.
|
||||
|
||||
* Replace `<FQDN>` with the FQDN chosen in [Configure DNS](#part-3-configure-dns).
|
||||
2. In the `kind: Ingress` with `name: cattle-ingress-http:`
|
||||
|
||||
After replacing `<FQDN>` with the FQDN chosen in [Configure DNS](#part-3-configure-dns), the file should look like the example below (`rancher.yourdomain.com` is the FQDN used in this example):
|
||||
Replace `<FQDN>` with the FQDN chosen in [3. Configure DNS](#3-configure-dns).
|
||||
|
||||
```
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
namespace: cattle-system
|
||||
name: cattle-ingress-http
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
|
||||
nginx.ingress.kubernetes.io/proxy-read-timeout: "1800" # Max time in seconds for ws to remain shell window open
|
||||
nginx.ingress.kubernetes.io/proxy-send-timeout: "1800" # Max time in seconds for ws to remain shell window open
|
||||
spec:
|
||||
rules:
|
||||
- host: rancher.yourdomain.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: cattle-service
|
||||
servicePort: 80
|
||||
```
|
||||
**Step Result:** After replacing the values, the file should look like the example below (the base64 encoded strings should be different):
|
||||
|
||||
Save the `.yml` file and close it.
|
||||
```
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
namespace: cattle-system
|
||||
name: cattle-ingress-http
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
|
||||
nginx.ingress.kubernetes.io/proxy-read-timeout: "1800" # Max time in seconds for ws to remain shell window open
|
||||
nginx.ingress.kubernetes.io/proxy-send-timeout: "1800" # Max time in seconds for ws to remain shell window open
|
||||
spec:
|
||||
rules:
|
||||
- host: rancher.yourdomain.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: cattle-service
|
||||
servicePort: 80
|
||||
```
|
||||
|
||||
## Part 9-Backup Your YAML File
|
||||
|
||||
After you close your `.yml` file, back it up to a secure location. You can use this file again when it's time to upgrade Rancher.
|
||||
3. Save the file and close it.
|
||||
|
||||
## Part 10-Run RKE
|
||||
## 9. Back Up Your RKE Config File
|
||||
|
||||
All configuration is in place to run RKE. You can do this by running the `rke up` command and using the `--config` parameter to point to your config file.
|
||||
After you close your RKE config file, `rancher-cluster.yml`, back it up to a secure location. You can use this file again when it's time to upgrade Rancher.
|
||||
|
||||
From your workstation, make sure `rancher-cluster.yml` and the downloaded `rke` binary are in the same directory.
|
||||
## 10. Run RKE
|
||||
|
||||
Open a Terminal instance. Change to the directory that contains your config file and `rke`.
|
||||
With all configuration in place, use RKE to launch Rancher. You can complete this action by running the `rke up` command and using the `--config` parameter to point toward your config file.
|
||||
|
||||
**Example:**
|
||||
1. From your workstation, make sure `rancher-cluster.yml` and the downloaded `rke` binary are in the same directory.
|
||||
|
||||
```
|
||||
# MacOS
|
||||
./rke_darwin-amd64 up --config rancher-cluster.yml
|
||||
# Linux
|
||||
./rke_linux-amd64 up --config rancher-cluster.yml
|
||||
```
|
||||
2. Open a Terminal instance. Change to the directory that contains your config file and `rke`.
|
||||
|
||||
The output should be similar to the snippet below:
|
||||
3. Enter one of the `rke up` commands listen below.
|
||||
|
||||
```
|
||||
INFO[0000] Building Kubernetes cluster
|
||||
INFO[0000] [dialer] Setup tunnel for host [1.1.1.1]
|
||||
INFO[0000] [network] Deploying port listener containers
|
||||
INFO[0000] [network] Pulling image [alpine:latest] on host [1.1.1.1]
|
||||
...
|
||||
INFO[0101] Finished building Kubernetes cluster successfully
|
||||
```
|
||||
```
|
||||
# MacOS
|
||||
./rke_darwin-amd64 up --config rancher-cluster.yml
|
||||
# Linux
|
||||
./rke_linux-amd64 up --config rancher-cluster.yml
|
||||
```
|
||||
|
||||
## Part 11-Backup Config File
|
||||
**Step Result:** The output should be similar to the snippet below:
|
||||
|
||||
During installation, RKE generates a config file named `kube_config_rancher-cluster.yml` in the same directory as the RKE binary. Copy this file and back it up to a safe location. You'll use this file later when upgrading Rancher Server.
|
||||
```
|
||||
INFO[0000] Building Kubernetes cluster
|
||||
INFO[0000] [dialer] Setup tunnel for host [1.1.1.1]
|
||||
INFO[0000] [network] Deploying port listener containers
|
||||
INFO[0000] [network] Pulling image [alpine:latest] on host [1.1.1.1]
|
||||
...
|
||||
INFO[0101] Finished building Kubernetes cluster successfully
|
||||
```
|
||||
|
||||
## Part 12-Remove Default Certificates
|
||||
## 11. Back Up Auto-Generated Config File
|
||||
|
||||
During installation, RKE automatically generates a config file named `kube_config_rancher-cluster.yml` in the same directory as the RKE binary. Copy this file and back it up to a safe location. You'll use this file later when upgrading Rancher Server.
|
||||
|
||||
## 12. Remove Default Certificates
|
||||
|
||||
**For those using a certificate signed by a recognized CA:**
|
||||
|
||||
>**Note:** If you're using a self-signed certificate, you don't have to complete this part. Continue to [What's Next?](#what-s-next).
|
||||
>**Note:** If you're using a self-signed certificate, you don't have to complete this procedure. Continue to [What's Next?](#what-s-next)
|
||||
|
||||
By default, Rancher automatically generates self-signed certificates for itself after installation. However, since you've provided your own certificates, you must disable the certificates that Rancher generated for itself.
|
||||
|
||||
**To Remove the Default Certificates:**
|
||||
|
||||
1. Log into Rancher.
|
||||
|
||||
2. Select **Settings** > **cacerts**.
|
||||
|
||||
3. Choose `Edit` and remove the contents. Then click `Save`.
|
||||
|
||||
## What's Next?
|
||||
|
||||
- Log in to Rancher to make sure it deployed successfully. Open a web browser and navigate to the FQDN chosen in [Configure DNS](#part-3-configure-dns).
|
||||
- Configure RKE to take snapshots of etcd that you can use as a backup in a disaster scenario. For more information, see [etcd recurring snapshots]({{< baseurl >}}/rancher/v2.x/en/installation/after-installation/etcd-backup-and-restoration/#etcd-recurring-snapshots).
|
||||
You have a couple of options:
|
||||
|
||||
## SSL FAQ / Troubleshooting
|
||||
- Create a backup of your Rancher Server in case of a disaster scenario: [High Availablility Back Up and Restoration]({{< baseurl >}}/rancher/v2.x/en/installation/backups-and-restoration/ha-backup-and-restoration).
|
||||
- Create a Kubernettes cluster: [Creating a Cluster]({{ <baseurl> }}/rancher/v2.x/en/tasks/clusters/creating-a-cluster/).
|
||||
|
||||
<br/>
|
||||
|
||||
## FAQ and Troubleshooting
|
||||
|
||||
{{< ssl_faq >}}
|
||||
|
||||
@@ -4,65 +4,67 @@ weight: 275
|
||||
---
|
||||
This set of instructions creates a new Kubernetes cluster that's dedicated to running Rancher in a high-availability (HA) configuration. This procedure walks you through setting up a 3-node cluster using the Rancher Kubernetes Engine (RKE). The cluster's sole purpose is running pods for Rancher. The setup is based on:
|
||||
|
||||
- Layer 4 Loadbalancer (TCP)
|
||||
- NGINX Ingress controller with SSL termination (HTTPS)
|
||||
- Layer 4 load balancer (TCP)
|
||||
- Nginx ingress controller with SSL termination (HTTPS)
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
## Installation Outline
|
||||
|
||||
1. [Provision Linux Hosts](#part-1-provision-linux-hosts)
|
||||
Installation of Rancher in a high-availability configuration involves multiple procedures. Review this outline to learn about each procedure you need to complete.
|
||||
|
||||
1. [Provision Linux Hosts](#1-provision-linux-hosts)
|
||||
|
||||
Provision three Linux hosts to serve as your Kubernetes cluster.
|
||||
|
||||
2. [Configure Load Balancer](#part-2-configure-load-balancer)
|
||||
2. [Configure Load Balancer](#2-configure-load-balancer)
|
||||
|
||||
Configure your load balancer to have a highly available single point of entry to your Rancher cluster.
|
||||
|
||||
3. [Configure DNS](#part-3-configure-dns)
|
||||
3. [Configure DNS](#3-configure-dns)
|
||||
|
||||
Make your setup accessible using a DNS name by configuring the DNS to point to your loadbalancer.
|
||||
|
||||
4. [Download RKE](#part-4-download-rke)
|
||||
4. [Download RKE](#4-download-rke)
|
||||
|
||||
Rancher Kubernetes Engine (RKE) is a fast, versatile Kubernetes installer that you can use to install Kubernetes on your Linux hosts.
|
||||
[RKE](https://github.com/rancher/rke/releases) is a fast, versatile Kubernetes installer that you can use to install Kubernetes on your Linux hosts.
|
||||
|
||||
5. [Download Config File Template](#part-5-download-config-file-template)
|
||||
5. [Download RKE Config File Template](#5-download-config-file-template)
|
||||
|
||||
RKE uses a `.yml` config file to install and configure your Kubernetes cluster. Download one of our config file templates to get started.
|
||||
RKE uses a YAML config file to install and configure your Kubernetes cluster. Download one of our RKE config file templates to get started.
|
||||
|
||||
6. [Configure Nodes](#part-6-configure-nodes)
|
||||
6. [Configure Nodes](#6-configure-nodes)
|
||||
|
||||
Configure the **Nodes** section of the template.
|
||||
Configure the **Nodes** section of the RKE config template.
|
||||
|
||||
7. [Configure Certificates](#part-7-configure-certificates)
|
||||
7. [Configure Certificates](#7-configure-certificates)
|
||||
|
||||
Configure the **Certificates** part of the template too.
|
||||
|
||||
8. [Configure FQDN](#part-8-configure-fqdn)
|
||||
8. [Configure FQDN](#8-configure-fqdn)
|
||||
|
||||
You guessed it. Configure the **FQDN** part of the template.
|
||||
And the **FQDN** part.
|
||||
|
||||
9. [Backup Your YAML File](#part-9-backup-your-yaml-file)
|
||||
9. [Back Up Your RKE Config File](#9-back-up-your-rke-config-file)
|
||||
|
||||
After you've completed configuration of the config file template, back the config file up in a safe place. You can reuse this file for upgrades later.
|
||||
After you've completed configuration of the RKE config file: 1. it's no longer a template since you'll be using it, and 2. you should back up the RKE config file to a safe place. You will reuse this file for upgrades later.
|
||||
|
||||
10. [Run RKE](#part-10-run-rke)
|
||||
10. [Run RKE](#10-run-rke)
|
||||
|
||||
Run RKE to deploy Rancher to your cluster.
|
||||
|
||||
11. [Backup Config File](#part-11-backup-config-file)
|
||||
11. [Back Up Auto-Generated Config File](#11-back-up-auto-generated-config-file)
|
||||
|
||||
During installation, RKE generates a config file that you'll use later for upgrades. Back it up to a safe location.
|
||||
|
||||
12. **For those using a certificate signed by a recognized CA:**
|
||||
|
||||
[Remove Default Certificates](#part-12-remove-default-certificates)
|
||||
[Remove Default Certificates](#12-remove-default-certificates)
|
||||
|
||||
If you chose [Option B](#option-b-bring-your-own-certificate-signed-by-recognized-ca) as your SSL option, log into the Rancher UI and remove the certificates that Rancher automatically generates.
|
||||
|
||||
|
||||
## Part 1-Provision Linux Hosts
|
||||
<br/>
|
||||
## 1. Provision Linux Hosts
|
||||
|
||||
Before you install Rancher, confirm you meet the host requirements. Provision 3 new Linux hosts using the requirements below.
|
||||
|
||||
@@ -76,55 +78,70 @@ Before you install Rancher, confirm you meet the host requirements. Provision 3
|
||||
|
||||
{{< requirements_ports >}}
|
||||
|
||||
## Part 2-Configure Load Balancer
|
||||
## 2. Configure Load Balancer
|
||||
|
||||
We will be using Nginx as our Layer 4 Load Balancer (TCP). Nginx will forward all connections to one of your Rancher nodes.
|
||||
|
||||
>**Note:**
|
||||
> The Load Balancer is in front of your Linux hosts. This can be any other host you have available, capable of running NGINX. Do not use one of your Rancher nodes to install the Load Balancer.
|
||||
> In this configuration, the load balancer is positioned in front of your Linux hosts. The load balancer can be any host that you have available that's capable of running Nginx.
|
||||
>
|
||||
>One caveat: do not use one of your Rancher nodes as the load balancer.
|
||||
|
||||
We will be using NGINX as our Layer 4 Load Balancer (TCP). NGINX will forward all connections to one of your Rancher nodes.
|
||||
### A. Install Nginx
|
||||
|
||||
### Install NGINX
|
||||
Start by installing Nginx on your load balancer host. Nginx has packages available for all known operating systems.
|
||||
|
||||
NGINX has packages available for all the known operating systems. You can check out the [NGINX install documentation](https://www.nginx.com/resources/wiki/start/topics/tutorials/install/) to see how to install it for your operating system.
|
||||
For help installing Nginx, refer to their [install documentation](https://www.nginx.com/resources/wiki/start/topics/tutorials/install/).
|
||||
|
||||
### Create NGINX configuration
|
||||
### B. Create Nginx Configuration
|
||||
|
||||
Below you can find an example configuration for NGINX. You will need to replace `ip_of_node1`, `ip_of_node2` and `ip_of_node3` with the IPs of your [Linux hosts](#part-1-provision-linux-hosts)
|
||||
After installing Nginx, you need to update the Nginx config file, `nginx.conf`, with the IP addresses for your nodes.
|
||||
|
||||
1. Copy and paste the code sample below into your favorite text editor. Save it as `nginx.conf`.
|
||||
|
||||
**Example NGINX config:**
|
||||
```
|
||||
worker_processes 4;
|
||||
worker_rlimit_nofile 40000;
|
||||
2. From `nginx.conf`, replace `IP_NODE_1`, `IP_NODE_2`, and `IP_NODE_3` with the IPs of your [Linux hosts](#1-provision-linux-hosts).
|
||||
|
||||
events {
|
||||
worker_connections 8192;
|
||||
}
|
||||
**Example Nginx config:**
|
||||
```
|
||||
worker_processes 4;
|
||||
worker_rlimit_nofile 40000;
|
||||
|
||||
http {
|
||||
server {
|
||||
listen 80;
|
||||
return 301 https://$host$request_uri;
|
||||
events {
|
||||
worker_connections 8192;
|
||||
}
|
||||
}
|
||||
|
||||
stream {
|
||||
upstream rancher_servers {
|
||||
least_conn;
|
||||
server ip_of_node1:443 max_fails=3 fail_timeout=5s;
|
||||
server ip_of_node2:443 max_fails=3 fail_timeout=5s;
|
||||
server ip_of_node3:443 max_fails=3 fail_timeout=5s;
|
||||
http {
|
||||
server {
|
||||
listen 80;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 443;
|
||||
proxy_pass rancher_servers;
|
||||
|
||||
stream {
|
||||
upstream rancher_servers {
|
||||
least_conn;
|
||||
server IP_NODE_1:443 max_fails=3 fail_timeout=5s;
|
||||
server IP_NODE_2:443 max_fails=3 fail_timeout=5s;
|
||||
server IP_NODE_3:443 max_fails=3 fail_timeout=5s;
|
||||
}
|
||||
server {
|
||||
listen 443;
|
||||
proxy_pass rancher_servers;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
### Run NGINX as Docker container
|
||||
3. Save `nginx.conf` to your load balancer at the following path: `/etc/nginx/nginx.conf`.
|
||||
|
||||
Besides installing NGINX as a package on the operating system, you can also run it as a Docker container. Save the edited **Example NGINX config** as `/etc/nginx.conf` and run the following command to launch the NGINX container:
|
||||
4. Load the updates to your Nginx configuration by running the following command:
|
||||
|
||||
```
|
||||
# nginx -s reload
|
||||
```
|
||||
|
||||
### Option—Run Nginx as Docker container
|
||||
|
||||
Instead of installing Nginx as a package on the operating system, you can rather run it as a Docker container. Save the edited **Example Nginx config** as `/etc/nginx.conf` and run the following command to launch the Nginx container:
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
@@ -133,154 +150,168 @@ docker run -d --restart=unless-stopped \
|
||||
nginx:1.14
|
||||
```
|
||||
|
||||
## Part 3-Configure DNS
|
||||
## 3. Configure DNS
|
||||
|
||||
Choose a fully qualified domain name (FQDN) you want to use to access Rancher (something like `rancher.yourdomain.com`).<br/><br/>You need to create a DNS A record, pointing to the IP address of your [Load Balancer](#part-2-configure-load-balancer). If the DNS A record is created, you can validate if it's setup correctly by running `nslookup rancher.yourdomain.com`. It should return the IP address of your [Load Balancer](#part-2-configure-load-balancer) like in the example below.
|
||||
Choose a fully qualified domain name (FQDN) that you want to use to access Rancher (e.g., `rancher.yourdomain.com`).<br/><br/>
|
||||
|
||||
```
|
||||
$ nslookup rancher.yourdomain.com
|
||||
Server: your_nameserver_ip
|
||||
Address: your_nameserver_ip#53
|
||||
1. Log into your DNS server a create a `DNS A` record that points to the IP address of your [load balancer](#2-configure-load-balancer).
|
||||
|
||||
Non-authoritative answer:
|
||||
Name: rancher.yourdomain.com
|
||||
Address: ip_of_loadbalancer
|
||||
```
|
||||
2. Validate that the `DNS A` is working correctly. Run the following command from any terminal, replacing `HOSTNAME.DOMAIN.COM` with your chosen FQDN:
|
||||
|
||||
## Part 4-Download RKE
|
||||
`nslookup HOSTNAME.DOMAIN.COM`
|
||||
|
||||
Rancher Kubernetes Engine (RKE) is a fast, versatile Kubernetes installer that you can use to install Kubernetes on your Linux hosts. We will be using RKE to setup our cluster and run Rancher.
|
||||
**Step Result:** Terminal displays output similar to the following:
|
||||
|
||||
From your workstation, open a web browser and navigate to our [RKE Releases](https://github.com/rancher/rke/releases/latest) page. Download the latest RKE installer applicable to your Operating System:
|
||||
```
|
||||
$ nslookup rancher.yourdomain.com
|
||||
Server: YOUR_HOSTNAME_IP_ADDRESS
|
||||
Address: YOUR_HOSTNAME_IP_ADDRESS#53
|
||||
|
||||
* **MacOS**: `rke_darwin-amd64`
|
||||
* **Linux**: `rke_linux-amd64`
|
||||
Non-authoritative answer:
|
||||
Name: rancher.yourdomain.com
|
||||
Address: HOSTNAME.DOMAIN.COM
|
||||
```
|
||||
|
||||
Make the RKE binary that you just downloaded executable. Open Terminal, change directory to the location of the RKE binary, and then run the following command:
|
||||
<br/>
|
||||
|
||||
```
|
||||
# MacOS
|
||||
$ chmod +x rke_darwin-amd64
|
||||
# Linux
|
||||
$ chmod +x rke_linux-amd64
|
||||
```
|
||||
## 4. Download RKE
|
||||
|
||||
Confirm that RKE is now executable by running the following command:
|
||||
RKE is a fast, versatile Kubernetes installer that you can use to install Kubernetes on your Linux hosts. We will be using RKE to setup our cluster and run Rancher.
|
||||
|
||||
```
|
||||
# MacOS
|
||||
$ ./rke_darwin-amd64 -version
|
||||
# Linux
|
||||
$ ./rke_linux-amd64 -version
|
||||
```
|
||||
1. From your workstation, open a web browser and navigate to our [RKE Releases](https://github.com/rancher/rke/releases/latest) page. Download the latest RKE installer applicable to your Operating System:
|
||||
|
||||
**Result:** You receive output similar to what follows:
|
||||
```
|
||||
rke version v<N.N.N>
|
||||
```
|
||||
- **MacOS**: `rke_darwin-amd64`
|
||||
- **Linux**: `rke_linux-amd64`
|
||||
- **Windows**: `rke_windows-amd64.exe`
|
||||
|
||||
## Part 5-Download Config File Template
|
||||
2. Make the RKE binary that you just downloaded executable. Open Terminal, change directory to the location of the RKE binary, and then run one of the commands below.
|
||||
|
||||
>**Using Windows?**
|
||||
>The file is already an executable. Skip to [Download Config File Template](#5-download-config-file-template).
|
||||
|
||||
```
|
||||
# MacOS
|
||||
$ chmod +x rke_darwin-amd64
|
||||
# Linux
|
||||
$ chmod +x rke_linux-amd64
|
||||
```
|
||||
|
||||
3. Confirm that RKE is now executable by running the following command:
|
||||
|
||||
```
|
||||
# MacOS
|
||||
$ ./rke_darwin-amd64 ---version
|
||||
# Linux
|
||||
$ ./rke_linux-amd64 --version
|
||||
```
|
||||
|
||||
**Step Result:** You receive output similar to what follows:
|
||||
```
|
||||
rke version v<N.N.N>
|
||||
```
|
||||
|
||||
## 5. Download RKE Config File Template
|
||||
|
||||
RKE uses a `.yml` config file to install and configure your Kubernetes cluster. There are 2 templates to choose from, depending on the SSL certificate you want to use.
|
||||
|
||||
1. Download one of following templates, depending on the SSL certificate you're using.
|
||||
|
||||
- [Template for using Self Signed Certificate (3-node-certificate.yml)](https://raw.githubusercontent.com/rancher/rancher/e9d29b3f3b9673421961c68adf0516807d1317eb/rke-templates/3-node-certificate.yml)
|
||||
- [Template for using Certificate Signed By A Recognized Certificate Authority (3-node-certificate-recognizedca.yml)](https://raw.githubusercontent.com/rancher/rancher/e9d29b3f3b9673421961c68adf0516807d1317eb/rke-templates/3-node-certificate-recognizedca.yml)
|
||||
- [Template for self-signed certificate<br/> `3-node-certificate.yml`](https://raw.githubusercontent.com/rancher/rancher/e9d29b3f3b9673421961c68adf0516807d1317eb/rke-templates/3-node-certificate.yml)
|
||||
- [Template for certificate signed by recognized CA<br/> `3-node-certificate-recognizedca.yml`](https://raw.githubusercontent.com/rancher/rancher/e9d29b3f3b9673421961c68adf0516807d1317eb/rke-templates/3-node-certificate-recognizedca.yml)
|
||||
|
||||
2. Rename the file to `rancher-cluster.yml`.
|
||||
|
||||
## Part 6-Configure Nodes
|
||||
## 6. Configure Nodes
|
||||
|
||||
Once you have the `.yml` config file template, edit the nodes section to point toward your Linux hosts.
|
||||
Once you have the `rancher-cluster.yml` config file template, edit the nodes section to point toward your Linux hosts.
|
||||
|
||||
Open `rancher-cluster.yml` in your favorite text editor.
|
||||
1. Open `rancher-cluster.yml` in your favorite text editor.
|
||||
|
||||
Update the `nodes` section with the information of your [Linux hosts](#provision-linux-hosts)
|
||||
2. Update the `nodes` section with the information of your [Linux hosts](#provision-linux-hosts).
|
||||
|
||||
For each node in your cluster, update the following placeholders:
|
||||
|
||||
- `<IP>`: The IP address or hostname of the node.
|
||||
- `<USER>`: The username to use to setup a SSH connection to the node. If the user is not the `root` user, make sure the user has access to the Docker socket. This can be tested by logging in on the node as the configured user and run `docker ps`.
|
||||
- `<SSHKEY_FILE>`: The path of the SSH private key file used to authenticate to the node.
|
||||
|
||||
**Example nodes section YAML**
|
||||
For each node in your cluster, update the following placeholders: `IP_ADDRESS_X` and `USER`.
|
||||
|
||||
```
|
||||
nodes:
|
||||
- address: 1.1.1.1
|
||||
user: root
|
||||
- address: IP_ADDRESS_1
|
||||
# THE IP ADDRESS OR HOSTNAME OF THE NODE
|
||||
user: USER
|
||||
# USER WITH ADMIN ACCESS. USUALLY `root`
|
||||
role: [controlplane,etcd,worker]
|
||||
ssh_key_path: ~/.ssh/id_rsa
|
||||
- address: 2.2.2.2
|
||||
user: root
|
||||
# PATH TO SSH KEY THAT AUTHENTICATES ON YOUR WORKSTATION
|
||||
# USUALLY THE VALUE ABOVE
|
||||
- address: IP_ADDRESS_2
|
||||
user: USER
|
||||
role: [controlplane,etcd,worker]
|
||||
ssh_key_path: ~/.ssh/id_rsa
|
||||
- address: 3.3.3.3
|
||||
user: root
|
||||
- address: IP_ADDRESS_3
|
||||
user: USER
|
||||
role: [controlplane,etcd,worker]
|
||||
ssh_key_path: ~/.ssh/id_rsa
|
||||
```
|
||||
|
||||
## Part 7-Configure certificates
|
||||
## 7. Configure Certificates
|
||||
|
||||
Certificates can be configured by using base64 encoded strings in the config file. The base64 encoded string can be generated using the following command:
|
||||
For security purposes, SSL (Secure Sockets Layer) is required when using Rancher. SSL secures all Rancher network communication, like when you login or interact with a cluster.
|
||||
|
||||
- **MacOS**: `cat FILENAME| base64`
|
||||
- **Linux**: `cat FILENAME | base64 -w0`
|
||||
- **Windows**: `certutil -encode FILENAME FILENAME.base64`
|
||||
Choose from the following options:
|
||||
|
||||
### Option A-Self Signed Certificate
|
||||
- [Option A—Bring Your Own Certificate: Self-Signed](#option-a-bring-your-own-certificate-self-signed)
|
||||
- [Option B—Bring Your Own Certificate: Signed by Recognized CA](#option-b-bring-your-own-certificate-signed-by-recognized-ca)
|
||||
|
||||
>**Note:**
|
||||
> If you are using Certificate Signed By A Recognized Certificate Authority, [click here](#option-b-certificate-signed-by-a-recognized-certificate-authority) to proceed.
|
||||
### Option A—Bring Your Own Certificate: Self-Signed
|
||||
|
||||
If you are using a Self Signed Certificate, you will need to generate base64 encoded strings for each of your files (Certificate file, Certificate Key file, and CA certificate file). Make sure that your certificate file includes all the [intermediate certificates](#ssl-faq-troubleshooting) in the chain, the order of certificates in this case is first your own certificate, followed by the intermediates.
|
||||
>**Prerequisites:**
|
||||
>Create a self-signed certificate.
|
||||
>
|
||||
>- The certificate files must be in [PEM format](#pem).
|
||||
>- The certificate files must be encoded in [base64](#base64).
|
||||
>- In your certificate file, include all intermediate certificates in the chain. Order your certificates with your certificate first, followed by the intermediates. For an example, see [Intermediate Certificates](#cert-order).
|
||||
|
||||
In the `kind: Secret` with `name: cattle-keys-ingress`:
|
||||
1. In `kind: Secret` with `name: cattle-keys-ingress`:
|
||||
|
||||
* Replace `<BASE64_CRT>` with the base64 encoded string of the Certificate file (usually called `cert.pem` or `domain.crt`)
|
||||
* Replace `<BASE64_KEY>` with the base64 encoded string of the Certificate Key file (usually called `key.pem` or `domain.key`)
|
||||
* Replace `<BASE64_CRT>` with the base64 encoded string of the Certificate file (usually called `cert.pem` or `domain.crt`)
|
||||
* Replace `<BASE64_KEY>` with the base64 encoded string of the Certificate Key file (usually called `key.pem` or `domain.key`)
|
||||
|
||||
After replacing the values, the file should look like the example below (the base64 encoded strings should be different):
|
||||
>**Note:**
|
||||
> The base64 encoded string should be on the same line as `tls.crt` or `tls.key`, without any newline at the beginning, in between or at the end.
|
||||
|
||||
>**Note:**
|
||||
> The base64 encoded string should be on the same line as `tls.crt` or `tls.key`, without any newline at the beginning, in between or at the end.
|
||||
**Result:** After replacing the values, the file should look like the example below (the base64 encoded strings should be different):
|
||||
|
||||
```
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cattle-keys-ingress
|
||||
namespace: cattle-system
|
||||
type: Opaque
|
||||
data:
|
||||
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1RENDQWN5Z0F3SUJBZ0lKQUlHc25NeG1LeGxLTUEwR0NTcUdTSWIzRFFFQkN3VUFNQkl4RURBT0JnTlYKQkFNTUIzUmxjM1F0WTJFd0hoY05NVGd3TlRBMk1qRXdOREE1V2hjTk1UZ3dOekExTWpFd05EQTVXakFXTVJRdwpFZ1lEVlFRRERBdG9ZUzV5Ym1Ob2NpNXViRENDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DCmdnRUJBTFJlMXdzekZSb2Rib2pZV05DSHA3UkdJaUVIMENDZ1F2MmdMRXNkUUNKZlcrUFEvVjM0NnQ3bSs3TFEKZXJaV3ZZMWpuY2VuWU5JSGRBU0VnU0ducWExYnhUSU9FaE0zQXpib3B0WDhjSW1OSGZoQlZETGdiTEYzUk0xaQpPM1JLTGdIS2tYSTMxZndjbU9zWGUwaElYQnpUbmxnM20vUzlXL3NTc0l1dDVwNENDUWV3TWlpWFhuUElKb21lCmpkS3VjSHFnMTlzd0YvcGVUalZrcVpuMkJHazZRaWFpMU41bldRV0pjcThTenZxTTViZElDaWlwYU9hWWQ3RFEKYWRTejV5dlF0YkxQNW4wTXpnOU43S3pGcEpvUys5QWdkWDI5cmZqV2JSekp3RzM5R3dRemN6VWtLcnZEb05JaQo0UFJHc01yclFNVXFSYjRSajNQOEJodEMxWXNDQXdFQUFhTTVNRGN3Q1FZRFZ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kc0NnWUVBcVJLYWNweWZKSXlMZEJjZ0JycGkKQTRFalVLMWZsSjR3enNjbGFKUDVoM1NjZUFCejQzRU1YT0kvSXAwMFJsY3N6em83N3cyMmpud09mOEJSM0RBMwp6ZTRSWDIydWw4b0hGdldvdUZOTTNOZjNaNExuYXpVc0F0UGhNS2hRWGMrcEFBWGthUDJkZzZ0TU5PazFxaUNHCndvU212a1BVVE84b1ViRTB1NFZ4ZmZFQ2dZQUpPdDNROVNadUlIMFpSSitIV095enlOQTRaUEkvUkhwN0RXS1QKajVFS2Y5VnR1OVMxY1RyOTJLVVhITXlOUTNrSjg2OUZPMnMvWk85OGg5THptQ2hDTjhkOWN6enI5SnJPNUFMTApqWEtBcVFIUlpLTFgrK0ZRcXZVVlE3cTlpaHQyMEZPb3E5OE5SZDMzSGYxUzZUWDNHZ3RWQ21YSml6dDAxQ3ZHCmR4VnVnd0tCZ0M2Mlp0b0RLb3JyT2hvdTBPelprK2YwQS9rNDJBOENiL29VMGpwSzZtdmxEWmNYdUF1QVZTVXIKNXJCZjRVYmdVYndqa1ZWSFR6LzdDb1BWSjUvVUxJWk1Db1RUNFprNTZXWDk4ZE93Q3VTVFpZYnlBbDZNS1BBZApTZEpuVVIraEpnSVFDVGJ4K1dzYnh2d0FkbWErWUhtaVlPRzZhSklXMXdSd1VGOURLUEhHCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
|
||||
```
|
||||
```
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cattle-keys-ingress
|
||||
namespace: cattle-system
|
||||
type: Opaque
|
||||
data:
|
||||
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1RENDQWN5Z0F3SUJBZ0lKQUlHc25NeG1LeGxLTUEwR0NTcUdTSWIzRFFFQkN3VUFNQkl4RURBT0JnTlYKQkFNTUIzUmxjM1F0WTJFd0hoY05NVGd3TlRBMk1qRXdOREE1V2hj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YSml6dDAxQ3ZHCmR4VnVnd0tCZ0M2Mlp0b0RLb3JyT2hvdTBPelprK2YwQS9rNDJBOENiL29VMGpwSzZtdmxEWmNYdUF1QVZTVXIKNXJCZjRVYmdVYndqa1ZWSFR6LzdDb1BWSjUvVUxJWk1Db1RUNFprNTZXWDk4ZE93Q3VTVFpZYnlBbDZNS1BBZApTZEpuVVIraEpnSVFDVGJ4K1dzYnh2d0FkbWErWUhtaVlPRzZhSklXMXdSd1VGOURLUEhHCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
|
||||
```
|
||||
|
||||
In the `kind: Secret` with `name: cattle-keys-server`:
|
||||
2. In `kind: Secret` with `name: cattle-keys-server`, replace `<BASE64_CA>` with the base64 encoded string of the CA Certificate file (usually called `ca.pem` or `ca.crt`).
|
||||
|
||||
* Replace `<BASE64_CA>` with the base64 encoded string of the CA Certificate file (usually called `ca.pem` or `ca.crt`)
|
||||
>**Note:**
|
||||
> The base64 encoded string should be on the same line as `cacerts.pem`, without any newline at the beginning, in between or at the end.
|
||||
|
||||
After replacing the value, the file should look like the example below (the base64 encoded string should be different):
|
||||
|
||||
>**Note:**
|
||||
> The base64 encoded string should be on the same line as `cacerts.pem`, without any newline at the beginning, in between or at the end.
|
||||
**Result:** The file should look like the example below (the base64 encoded string should be different):
|
||||
```
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cattle-keys-server
|
||||
namespace: cattle-system
|
||||
type: Opaque
|
||||
data:
|
||||
cacerts.pem: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNvRENDQVlnQ0NRRHVVWjZuMEZWeU16QU5CZ2txaGtpRzl3MEJBUXNGQURBU01SQXdEZ1lEVlFRRERBZDAKWlhOMExXTmhNQjRYRFRFNE1EVXdOakl4TURRd09Wb1hEVEU0TURjd05USXhNRFF3T1Zvd0VqRVFNQTRHQTFVRQpBd3dIZEdWemRDMWpZVENDQVNJd0R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tCg==
|
||||
```
|
||||
|
||||
```
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cattle-keys-server
|
||||
namespace: cattle-system
|
||||
type: Opaque
|
||||
data:
|
||||
cacerts.pem: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNvRENDQVlnQ0NRRHVVWjZuMEZWeU16QU5CZ2txaGtpRzl3MEJBUXNGQURBU01SQXdEZ1lEVlFRRERBZDAKWlhOMExXTmhNQjRYRFRFNE1EVXdOakl4TURRd09Wb1hEVEU0TURjd05USXhNRFF3T1Zvd0VqRVFNQTRHQTFVRQpBd3dIZEdWemRDMWpZVENDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFNQmpBS3dQCndhRUhwQTdaRW1iWWczaTNYNlppVmtGZFJGckJlTmFYTHFPL2R0RUdmWktqYUF0Wm45R1VsckQxZUlUS3UzVHgKOWlGVlV4Mmo1Z0tyWmpwWitCUnFiZ1BNbk5hS1hocmRTdDRtUUN0VFFZdGRYMVFZS0pUbWF5NU45N3FoNTZtWQprMllKRkpOWVhHWlJabkdMUXJQNk04VHZramF0ZnZOdmJ0WmtkY2orYlY3aWhXanp2d2theHRUVjZlUGxuM2p5CnJUeXBBTDliYnlVcHlad3E2MWQvb0Q4VUtwZ2lZM1dOWmN1YnNvSjhxWlRsTnN6UjVadEFJV0tjSE5ZbE93d2oKaG41RE1tSFpwZ0ZGNW14TU52akxPRUc0S0ZRU3laYlV2QzlZRUhLZTUxbGVxa1lmQmtBZWpPY002TnlWQUh1dApuay9DMHpXcGdENkIwbkVDQXdFQUFUQU5CZ2txaGtpRzl3MEJBUXNGQUFPQ0FRRUFHTCtaNkRzK2R4WTZsU2VBClZHSkMvdzE1bHJ2ZXdia1YxN3hvcmlyNEMxVURJSXB6YXdCdFJRSGdSWXVtblVqOGo4T0hFWUFDUEthR3BTVUsKRDVuVWdzV0pMUUV0TDA2eTh6M3A0MDBrSlZFZW9xZlVnYjQrK1JLRVJrWmowWXR3NEN0WHhwOVMzVkd4NmNOQQozZVlqRnRQd2hoYWVEQmdma1hXQWtISXFDcEsrN3RYem9pRGpXbi8walI2VDcrSGlaNEZjZ1AzYnd3K3NjUDIyCjlDQVZ1ZFg4TWpEQ1hTcll0Y0ZINllBanlCSTJjbDhoSkJqa2E3aERpVC9DaFlEZlFFVFZDM3crQjBDYjF1NWcKdE03Z2NGcUw4OVdhMnp5UzdNdXk5bEthUDBvTXl1Ty82Tm1wNjNsVnRHeEZKSFh4WTN6M0lycGxlbTNZQThpTwpmbmlYZXc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
||||
```
|
||||
|
||||
### Option B-Certificate Signed By A Recognized Certificate Authority
|
||||
### Option B—Bring Your Own Certificate: Signed by Recognized CA
|
||||
|
||||
>**Note:**
|
||||
> If you are using Self Signed Certificate, [click here](#option-a-self-signed-certificate) to proceed.
|
||||
@@ -310,15 +341,15 @@ data:
|
||||
tls.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBdEY3WEN6TVZHaDF1aU5oWTBJZW50RVlpSVFmUUlLQkMvYUFzU3gxQUlsOWI0OUQ5ClhmanEzdWI3c3RCNnRsYTlqV09keDZkZzBnZDBCSVNCSWFlcHJWdkZNZzRTRXpjRE51aW0xZnh3aVkwZCtFRlUKTXVCc3NYZEV6V0k3ZEVvdUFjcVJjamZWL0J5WTZ4ZDdTRWhjSE5PZVdEZWI5TDFiK3hLd2k2M21uZ0lKQjdBeQpLSmRlYzhnbWlaNk4wcTV3ZXFEWDJ6QVgrbDVPTldTcG1mWUVhVHBDSnFMVTNtZFpCWWx5cnhMTytvemx0MGdLCktLbG81cGgzc05CcDFMUG5LOUMxc3MvbWZRek9EMDNzck1Xa21oTDcwQ0IxZmIydCtOWnRITW5BYmYwYkJETnoKTlNRcXU4T2cwaUxnOUVhd3l1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0kvSXAwMFJsY3N6em83N3cyMmpud09mOEJSM0RBMwp6ZTRSWDIydWw4b0hGdldvdUZOTTNOZjNaNExuYXpVc0F0UGhNS2hRWGMrcEFBWGthUDJkZzZ0TU5PazFxaUNHCndvU212a1BVVE84b1ViRTB1NFZ4ZmZFQ2dZQUpPdDNROVNadUlIMFpSSitIV095enlOQTRaUEkvUkhwN0RXS1QKajVFS2Y5VnR1OVMxY1RyOTJLVVhITXlOUTNrSjg2OUZPMnMvWk85OGg5THptQ2hDTjhkOWN6enI5SnJPNUFMTApqWEtBcVFIUlpLTFgrK0ZRcXZVVlE3cTlpaHQyMEZPb3E5OE5SZDMzSGYxUzZUWDNHZ3RWQ21YSml6dDAxQ3ZHCmR4VnVnd0tCZ0M2Mlp0b0RLb3JyT2hvdTBPelprK2YwQS9rNDJBOENiL29VMGpwSzZtdmxEWmNYdUF1QVZTVXIKNXJCZjRVYmdVYndqa1ZWSFR6LzdDb1BWSjUvVUxJWk1Db1RUNFprNTZXWDk4ZE93Q3VTVFpZYnlBbDZNS1BBZApTZEpuVVIraEpnSVFDVGJ4K1dzYnh2d0FkbWErWUhtaVlPRzZhSklXMXdSd1VGOURLUEhHCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
|
||||
```
|
||||
|
||||
## Part 8-Configure FQDN
|
||||
## 8. Configure FQDN
|
||||
|
||||
There are 2 references to `<FQDN>` in the config file. Both need to be replaced with the FQDN chosen in [Configure DNS](#part-3-configure-dns).
|
||||
There are two references to `<FQDN>` in the config file (one in this step and one in the next). Both need to be replaced with the FQDN chosen in [Configure DNS](#3-configure-dns).
|
||||
|
||||
In the `kind: Ingress` with `name: cattle-ingress-http`:
|
||||
|
||||
* Replace `<FQDN>` with the FQDN chosen in [Configure DNS](#part-3-configure-dns).
|
||||
* Replace `<FQDN>` with the FQDN chosen in [Configure DNS](#3-configure-dns).
|
||||
|
||||
After replacing `<FQDN>` wit the FQDN chosen in [Configure DNS](#part-3-configure-dns), the file should look like the example below (`rancher.yourdomain.com` is the FQDN used in this example):
|
||||
After replacing `<FQDN>` with the FQDN chosen in [Configure DNS](#3-configure-dns), the file should look like the example below (`rancher.yourdomain.com` is the FQDN used in this example):
|
||||
|
||||
```
|
||||
---
|
||||
@@ -347,19 +378,19 @@ After replacing `<FQDN>` wit the FQDN chosen in [Configure DNS](#part-3-configur
|
||||
|
||||
Save the `.yml` file and close it.
|
||||
|
||||
## Part 9-Backup Your YAML File
|
||||
## 9. Back Up Your RKE Config File
|
||||
|
||||
After you close your `.yml` file, back it up to a secure location. You can use this file again when it's time to upgrade Rancher.
|
||||
After you close your `.yml` file, back it up to a secure location. You can use this file again when it's time to upgrade Rancher.
|
||||
|
||||
## Part 10-Run RKE
|
||||
## 10. Run RKE
|
||||
|
||||
All configuration is in place to run RKE. You can do this by running the `rke up` command and using the `--config` parameter to point to your config file.
|
||||
With all configuration in place, use RKE to launch Rancher. You can complete this action by running the `rke up` command and using the `--config` parameter to point toward your config file.
|
||||
|
||||
From your workstation, make sure `rancher-cluster.yml` and the downloaded `rke` binary are in the same directory.
|
||||
1. From your workstation, make sure `rancher-cluster.yml` and the downloaded `rke` binary are in the same directory.
|
||||
|
||||
Open a Terminal instance. Change to the directory that contains your config file and `rke`.
|
||||
2. Open a Terminal instance. Change to the directory that contains your config file and `rke`.
|
||||
|
||||
**Example:**
|
||||
3. Enter one of the `rke up` commands listen below.
|
||||
|
||||
```
|
||||
# MacOS
|
||||
@@ -368,7 +399,7 @@ Open a Terminal instance. Change to the directory that contains your config file
|
||||
./rke_linux-amd64 up --config rancher-cluster.yml
|
||||
```
|
||||
|
||||
The output should be similar to the snippet below:
|
||||
**Step Result:** The output should be similar to the snippet below:
|
||||
|
||||
```
|
||||
INFO[0000] Building Kubernetes cluster
|
||||
@@ -379,29 +410,35 @@ INFO[0000] [network] Pulling image [alpine:latest] on host [1.1.1.1]
|
||||
INFO[0101] Finished building Kubernetes cluster successfully
|
||||
```
|
||||
|
||||
## Part 11-Backup Config File
|
||||
## 11. Back Up Auto-Generated Config File
|
||||
|
||||
During installation, RKE generates a config file named `kube_config_rancher-cluster.yml` in the same directory as the RKE binary. Copy this file and back it up to a safe location. You'll use this file later when upgrading Rancher Server.
|
||||
During installation, RKE automatically generates a config file named `kube_config_rancher-cluster.yml` in the same directory as the RKE binary. Copy this file and back it up to a safe location. You'll use this file later when upgrading Rancher Server.
|
||||
|
||||
## Part 12-Remove Default Certificates
|
||||
## 12. Remove Default Certificates
|
||||
|
||||
**For those using a certificate signed by a recognized CA:**
|
||||
|
||||
>**Note:** If you're using a self-signed certificate, you don't have to complete this part. Continue to [What's Next?](#what-s-next).
|
||||
>**Note:** If you're using a self-signed certificate, you don't have to complete this procedure. Continue to [What's Next?](#what-s-next)
|
||||
|
||||
By default, Rancher automatically generates self-signed certificates for itself after installation. However, since you've provided your own certificates, you must disable the certificates that Rancher generated for itself.
|
||||
|
||||
**To Remove the Default Certificates:**
|
||||
|
||||
1. Log into Rancher.
|
||||
|
||||
2. Select **Settings** > **cacerts**.
|
||||
|
||||
3. Choose `Edit` and remove the contents. Then click `Save`.
|
||||
|
||||
## What's Next?
|
||||
|
||||
- Log in to Rancher to make sure it deployed successfully. Open a web browser and navigate to the FQDN chosen in [Configure DNS](#part-3-configure-dns).
|
||||
- Configure RKE to take snapshots of etcd that you can use as a backup in a disaster scenario. For more information, see [etcd recurring snapshots]({{< baseurl >}}/rancher/v2.x/en/installation/after-installation/etcd-backup-and-restoration/#etcd-recurring-snapshots).
|
||||
You have a couple of options:
|
||||
|
||||
## SSL FAQ / Troubleshooting
|
||||
- Create a backup of your Rancher Server in case of a disaster scenario: [High Availablility Back Up and Restoration]({{< baseurl >}}/rancher/v2.x/en/installation/backups-and-restoration/ha-backup-and-restoration).
|
||||
- Create a Kubernettes cluster: [Creating a Cluster]({{ <baseurl> }}/rancher/v2.x/en/tasks/clusters/creating-a-cluster/).
|
||||
|
||||
<br/>
|
||||
|
||||
## FAQ and Troubleshooting
|
||||
|
||||
{{< ssl_faq >}}
|
||||
|
||||
@@ -4,33 +4,36 @@ weight: 260
|
||||
---
|
||||
For development environments, we recommend installing Rancher by running a single Docker container. In this installation scenario, you'll deploy Rancher to a Linux host using a single Docker container. Then you will configure an external load balancer to work with Rancher.
|
||||
|
||||
>**Note:**
|
||||
> If you want don't want to use an external load balancer, see [Single Node Installation]({{< baseurl >}}/rancher/v2.x/en/installation/single-node-install/).
|
||||
|
||||
## Overview
|
||||
>**Want to skip the external load balancer?**
|
||||
> See [Single Node Installation]({{< baseurl >}}/rancher/v2.x/en/installation/single-node-install) instead.
|
||||
|
||||
Installation of Rancher on a single node with an external load balancer involves multiple procedures. Review this overview to learn about each procedure you need to complete.
|
||||
|
||||
1. [Provision Linux Host](#part-1-provision-linux-host)
|
||||
|
||||
## Installation Outline
|
||||
|
||||
Installation of Rancher on a single node with an external load balancer involves multiple procedures. Review this outline to learn about each procedure you need to complete.
|
||||
|
||||
1. [Provision Linux Host](#1-provision-linux-host)
|
||||
|
||||
Provision a single Linux host to launch your {{< product >}} Server.
|
||||
|
||||
2. [Choose an SSL Option and Install Rancher](#part-2-choose-an-ssl-option-and-install-rancher)
|
||||
2. [Choose an SSL Option and Install Rancher](#2-choose-an-ssl-option-and-install-rancher)
|
||||
|
||||
Choose an SSL option for Rancher communication encryption. After choosing an option, run the command that accompanies it to deploy Rancher.
|
||||
|
||||
3. [Configure Load Balancer](#part-3-configure-load-balancer)
|
||||
3. [Configure Load Balancer](#3-configure-load-balancer)
|
||||
|
||||
Setup a load balancer to direct communications with Rancher and your Kubernetes cluster.
|
||||
|
||||
4. **For those using a certificate signed by a recognized CA:**
|
||||
|
||||
[Remove Default Certificates](#part-4-remove-default-certificates)
|
||||
[Remove Default Certificates](#4-remove-default-certificates)
|
||||
|
||||
If you chose [Option B](#option-b-bring-your-own-certificate-signed-by-recognized-ca) as your SSL option, log into the Rancher UI and remove the certificates that Rancher automatically generates.
|
||||
|
||||
|
||||
## Part 1-Provision Linux Host
|
||||
## 1. Provision Linux Host
|
||||
|
||||
Provision a single Linux host to launch your {{< product >}} Server.
|
||||
|
||||
@@ -42,15 +45,23 @@ Provision a single Linux host to launch your {{< product >}} Server.
|
||||
|
||||
{{< requirements_software >}}
|
||||
|
||||
<a id="port-requirements"></a>
|
||||
|
||||
{{< requirements_ports >}}
|
||||
|
||||
{{< note_server-tags >}}
|
||||
|
||||
## Part 2-Choose an SSL Option and Install Rancher
|
||||
## 2. Choose an SSL Option and Install Rancher
|
||||
|
||||
For security purposes, SSL (Secure Sockets Layer) is required when using Rancher. SSL secures all Rancher network communication, like when you login or interact with a cluster.
|
||||
|
||||
You can choose from the following scenarios:
|
||||
>**Attention Air Gap Users:**
|
||||
> If you are visiting this page to complete [Air Gap Installation]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/), you must prepend your private registry URL to the server tag when running the installation command in the option that you choose. Replace `<REGISTRY.DOMAIN.COM:PORT>` with your private registry URL.
|
||||
>
|
||||
> Example:
|
||||
```
|
||||
<REGISTRY.DOMAIN.COM:PORT>/rancher/rancher:latest
|
||||
```
|
||||
|
||||
- [Option A-Bring Your Own Certificate: Self-Signed](#option-a-bring-your-own-certificate-self-signed)
|
||||
- [Option B-Bring Your Own Certificate: Signed by Recognized CA](#option-b-bring-your-own-certificate-signed-by-recognized-ca)
|
||||
@@ -67,14 +78,14 @@ If you elect to use a self-signed certificate to encrypt communication, you must
|
||||
|
||||
**To Install Rancher Using a Self-Signed Cert:**
|
||||
|
||||
While running the Docker command to deploy Rancher, point Docker toward your CA certificate file.
|
||||
1. While running the Docker command to deploy Rancher, point Docker toward your CA certificate file.
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
-v /etc/your_certificate_directory/cacerts.pem:/etc/rancher/ssl/cacerts.pem \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
-v /etc/your_certificate_directory/cacerts.pem:/etc/rancher/ssl/cacerts.pem \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
|
||||
### Option B-Bring Your Own Certificate: Signed by Recognized CA
|
||||
|
||||
@@ -82,20 +93,22 @@ If your cluster is public facing, it's best to use a certificate signed by a rec
|
||||
|
||||
>**Prerequisites:**
|
||||
>
|
||||
>- The certificate files must be in [PEM format](#ssl-faq-troubleshooting).
|
||||
>- The certificate files must be in base64.
|
||||
>- The certificate files must be in [PEM format](#pem).
|
||||
>- The certificate files must be encoded in [base64](#base64).
|
||||
|
||||
**To Install Rancher Using a Cert Signed by a Recognized CA:**
|
||||
|
||||
If you use a certificate signed by a recognized CA, installing your certificate in the Rancher container isn't necessary. Just run the basic install command below.
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
1. Enter the following command.
|
||||
|
||||
## Part 3-Configure Load Balancer
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
|
||||
## 3. Configure Load Balancer
|
||||
|
||||
When using a load balancer in front of your Rancher container, there's no need for the container to redirect port communication from port 80 or port 443. By passing the header `X-Forwarded-Proto:
|
||||
https` header, this redirect is disabled.
|
||||
@@ -106,16 +119,17 @@ The load balancer or proxy has to be configured to support the following:
|
||||
* **SPDY** / **HTTP/2** protocols
|
||||
* Passing / setting the following headers:
|
||||
|
||||
| Header | Value | Description |
|
||||
|---------------------|----------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `Host` | Hostname used to reach Rancher. | To identify the server requested by the client. |
|
||||
| `X-Forwarded-Proto` | `https` | To identify the protocol that a client used to connect to the load balancer or proxy.<br /><br/>**Note:** If this header is present, `rancher/rancher` does not redirect HTTP to HTTPS. |
|
||||
| `X-Forwarded-Port` | Port used to reach Rancher. | To identify the protocol that client used to connect to the load balancer or proxy. |
|
||||
| `X-Forwarded-For` | IP of the client connection. | To identify the originating IP address of a client. |
|
||||
| Header | Value | Description |
|
||||
|--------|-------|-------------|
|
||||
| `Host` | Hostname used to reach Rancher. | To identify the server requested by the client.
|
||||
| `X-Forwarded-Proto` | `https` | To identify the protocol that a client used to connect to the load balancer or proxy.<br /><br/>**Note:** If this header is present, `rancher/rancher` does not redirect HTTP to HTTPS.
|
||||
| `X-Forwarded-Port` | Port used to reach Rancher. | To identify the protocol that client used to connect to the load balancer or proxy.
|
||||
| `X-Forwarded-For` | IP of the client connection. | To identify the originating IP address of a client.
|
||||
|
||||
|
||||
### Example Nginx configuration
|
||||
|
||||
This Nginx configuration is tested on Nginx 1.13 (mainline) and 1.14 (stable).
|
||||
This Nginx configuration is tested on Nginx version 1.13 (mainline) and 1.14 (stable).
|
||||
|
||||
```
|
||||
upstream rancher {
|
||||
@@ -154,28 +168,36 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
## Part 4-Remove Default Certificates
|
||||
## 4. Remove Default Certificates
|
||||
|
||||
**For those using a certificate signed by a recognized CA:**
|
||||
|
||||
>**Note:** If you're using a self-signed certificate, you don't have to complete this part.
|
||||
>**Note:** If you're using a self-signed certificate, don't complete this procedure. Continue to [What's Next?](#what-s-next)
|
||||
|
||||
By default, Rancher automatically generates self-signed certificates for itself after installation. However, since you've provided your own certificates, you must disable the certificates that Rancher generated for itself.
|
||||
|
||||
**To Remove the Default Certificates:**
|
||||
|
||||
1. Log into Rancher.
|
||||
|
||||
2. Select **Settings** > **cacerts**.
|
||||
|
||||
3. Choose `Edit` and remove the contents. Then click `Save`.
|
||||
|
||||
<br/>
|
||||
|
||||
## What's Next?
|
||||
You have a couple of options:
|
||||
|
||||
Create a backup of your Rancher Server in case of a disaster scenario. For more information, see [Backing Up Your Rancher Server]({{< baseurl >}}/rancher/v2.x/en/installation/after-installation/single-node-backup-and-restoration/#backing-up-your-rancher-server).
|
||||
- Create a backup of your Rancher Server in case of a disaster scenario: [Single Node Backup and Restoration]({{< baseurl >}}/rancher/v2.x/en/installation/backups-and-restoration/single-node-backup-and-restoration/).
|
||||
- Create a Kubernettes cluster: [Creating a Cluster]({{ <baseurl> }}/rancher/v2.x/en/tasks/clusters/creating-a-cluster/).
|
||||
|
||||
## SSL FAQ / Troubleshooting
|
||||
<br/>
|
||||
|
||||
## FAQ and Troubleshooting
|
||||
|
||||
{{< ssl_faq >}}
|
||||
|
||||
## Persistent data
|
||||
## Persistent Data
|
||||
|
||||
{{< persistentdata >}}
|
||||
|
||||
@@ -5,24 +5,24 @@ weight: 250
|
||||
For development environments, we recommend installing Rancher by running a single Docker container. In this installation scenario, you'll install Docker on a single Linux host, and then install Rancher on your host using a single Docker container.
|
||||
|
||||
|
||||
>**Note:**
|
||||
> If you want to use an external load balancer, see [Single Node Installation with an External Loadbalancer]({{< baseurl >}}/rancher/v2.x/en/installation/single-node-install-external-lb)
|
||||
>
|
||||
>**Want to use an external load balancer?**
|
||||
> See [Single Node Installation with an External Load Balancer]({{< baseurl >}}/rancher/v2.x/en/installation/single-node-install-external-lb) instead.
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
Installation of Rancher on a single node involves multiple procedures. Review this overview to learn about each procedure you need to complete.
|
||||
## Installation Outline
|
||||
|
||||
1. [Provision Linux Host](#part-1-provision-linux-host)
|
||||
Installation of Rancher on a single node involves multiple procedures. Review this outline to learn about each procedure you need to complete.
|
||||
|
||||
1. [Provision Linux Host](#1-provision-linux-host)
|
||||
|
||||
Provision a single Linux host to launch your {{< product >}} Server.
|
||||
|
||||
2. [Choose an SSL Option and Install Rancher](#part-2-choose-an-ssl-option-and-install-rancher)
|
||||
2. [Choose an SSL Option and Install Rancher](#2-choose-an-ssl-option-and-install-rancher)
|
||||
|
||||
Choose an SSL option for Rancher communication encryption. After choosing an option, run the command that accompanies it to deploy Rancher.
|
||||
|
||||
## Part 1-Provision Linux Host
|
||||
## 1. Provision Linux Host
|
||||
|
||||
Provision a single Linux host to launch your {{< product >}} Server.
|
||||
|
||||
@@ -40,47 +40,58 @@ Provision a single Linux host to launch your {{< product >}} Server.
|
||||
|
||||
{{< note_server-tags >}}
|
||||
|
||||
## Part 2-Choose an SSL Option and Install Rancher
|
||||
## 2. Choose an SSL Option and Install Rancher
|
||||
|
||||
For security purposes, SSL (Secure Sockets Layer) is required when using Rancher. SSL secures all Rancher network communication, like when you login or interact with a cluster.
|
||||
|
||||
>**Attention Air Gap Users:**
|
||||
> If you are visiting this page to complete [Air Gap Installation]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/), you must prepend your private registry URL to the server tag when running the installation command in the option that you choose. Replace `<REGISTRY.DOMAIN.COM:PORT>` with your private registry URL.
|
||||
>
|
||||
> Example:
|
||||
```
|
||||
<REGISTRY.DOMAIN.COM:PORT>/rancher/rancher:latest
|
||||
```
|
||||
|
||||
Choose from the following options:
|
||||
|
||||
>**Attention Air Gap Users:**
|
||||
> If you are visiting this page to complete [Air Gap Installation]({{< baseurl >}}/rancher/v2.x/en/installation/air-gap-installation/), you must prepend your private registry URL to the server tag when running the installation command in the option that you choose.
|
||||
>
|
||||
> Example: `<registry.yourdomain.com:port>/rancher/rancher:latest`
|
||||
>
|
||||
- [Installation Outline](#installation-outline)
|
||||
- [1. Provision Linux Host](#1-provision-linux-host)
|
||||
- [Requirements](#requirements)
|
||||
- [2. Choose an SSL Option and Install Rancher](#2-choose-an-ssl-option-and-install-rancher)
|
||||
- [Option A—Default Self-Signed Certificate](#option-adefault-self-signed-certificate)
|
||||
- [Option B—Bring Your Own Certificate: Self-Signed](#option-bbring-your-own-certificate--self-signed)
|
||||
- [Option C—Bring Your Own Certificate: Signed by Recognized CA](#option-cbring-your-own-certificate--signed-by-recognized-ca)
|
||||
- [Option D-Let's Encrypt Certificate](#option-d-lets-encrypt-certificate)
|
||||
- [What's Next?](#whats-next)
|
||||
- [FAQ and Troubleshooting](#faq-and-troubleshooting)
|
||||
- [Persistent Data](#persistent-data)
|
||||
|
||||
- [Option A-Default Self-Signed Certificate](#option-a-default-self-signed-certificate)
|
||||
- [Option B-Bring Your Own Certificate: Self-Signed](#option-b-bring-your-own-certificate-self-signed)
|
||||
- [Option C-Bring Your Own Certificate: Signed by Recognized CA](#option-c-bring-your-own-certificate-signed-by-recognized-ca)
|
||||
- [Option D-Let's Encrypt Certificates](#option-d-let-s-encrypt-certificate)
|
||||
### Option A—Default Self-Signed Certificate
|
||||
|
||||
### Option A-Default Self-Signed Certificate
|
||||
|
||||
If you install Rancher without specifying your own certificate, Rancher generates a self-signed certificate that's used for encryption. If you're satisfied with this certificate, there's no need to obtain your own.
|
||||
If you install Rancher without using your own certificate, Rancher generates a self-signed certificate that's used for encryption. If you're satisfied with this certificate, there's no need to obtain your own.
|
||||
|
||||
**To Install Rancher Using the Default Certificate:**
|
||||
|
||||
1. From your Linux host, run the Docker command to install Rancher without any additional parameters:
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
|
||||
### Option B-Bring Your Own Certificate: Self-Signed
|
||||
|
||||
|
||||
### Option B—Bring Your Own Certificate: Self-Signed
|
||||
|
||||
Your Rancher install can use a self-signed certificate that you provide to encrypt communications.
|
||||
|
||||
>**Prerequisites:**
|
||||
>Create a self-signed certificate.
|
||||
>
|
||||
>- The certificate files must be in [PEM format](#ssl-faq-troubleshooting).
|
||||
>- The certificate files must be in base64.
|
||||
>- Make sure that your certificate file includes all the intermediate certificates in the chain. The order of certificates in this case is your own certificate first, followed by the intermediates. For an example, refer to the [SSL FAQ / Troubleshooting](#ssl-faq-troubleshooting).
|
||||
>- The certificate files must be in [PEM format](#pem).
|
||||
>- The certificate files must be encoded in [base64](#base64).
|
||||
>- In your certificate file, include all intermediate certificates in the chain. Order your certificates with your certificate first, followed by the intermediates. For an example, see [SSL FAQ / Troubleshooting](#cert-order).
|
||||
|
||||
|
||||
**To Install Rancher Using a Self-Signed Cert:**
|
||||
@@ -89,38 +100,37 @@ Your Rancher install can use a self-signed certificate that you provide to encry
|
||||
|
||||
1. After creating your certificate, run the Docker command to install Rancher, pointing toward your certificate files.
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
-v /etc/<CERT_DIRECTORY>/fullchain.pem:/etc/rancher/ssl/cert.pem \
|
||||
-v /etc/<CERT_DIRECTORY>/privkey.pem:/etc/rancher/ssl/key.pem \
|
||||
-v /etc/<CERT_DIRECTORY>/cacerts.pem:/etc/rancher/ssl/cacerts.pem \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
-v /etc/<CERT_DIRECTORY>/<FULL_CHAIN.pem>:/etc/rancher/ssl/cert.pem \
|
||||
-v /etc/<CERT_DIRECTORY>/<PRIVATE_KEY.pem>:/etc/rancher/ssl/key.pem \
|
||||
-v /etc/<CERT_DIRECTORY>/<CA_CERTS.pem>:/etc/rancher/ssl/cacerts.pem \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
|
||||
### Option C-Bring Your Own Certificate: Signed by Recognized CA
|
||||
|
||||
If you're publishing your app publically, you should ideally be using a certificate signed by a recognized CA.
|
||||
### Option C—Bring Your Own Certificate: Signed by Recognized CA
|
||||
|
||||
**Before You Start:**
|
||||
If you're publishing your app publicly, you should ideally be using a certificate signed by a recognized CA.
|
||||
|
||||
>**Prerequisites:**
|
||||
>
|
||||
>- The certificate files must be in [PEM format](#ssl-faq-troubleshooting).
|
||||
>- The certificate files must be in base64.
|
||||
>- Make sure that the container includes your certificate file and the key file. In this case, mounting an additional CA certificate file is unnecessary because the cert is signed by a recognized CA.
|
||||
>- The certificate files must be in [PEM format](#pem).
|
||||
>- The certificate files must be encoded in [base64](#base64).
|
||||
>- Make sure that the container includes your certificate file and the key file. Because your certificate is signed by a recognized CA, mounting an additional CA certificate file is unnecessary.
|
||||
|
||||
**To Install Rancher Using a Certificate Signed by a Recognized CA:**
|
||||
|
||||
After obtaining your certificate, run the Docker command to deploy Rancher, pointing toward your certificate files.
|
||||
1. After obtaining your certificate, run the Docker command to deploy Rancher while pointing toward your certificate files.
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
-v /etc/your_certificate_directory/fullchain.pem:/etc/rancher/ssl/cert.pem \
|
||||
-v /etc/your_certificate_directory/privkey.pem:/etc/rancher/ssl/key.pem \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
-v /etc/your_certificate_directory/fullchain.pem:/etc/rancher/ssl/cert.pem \
|
||||
-v /etc/your_certificate_directory/privkey.pem:/etc/rancher/ssl/key.pem \
|
||||
rancher/rancher:latest
|
||||
```
|
||||
|
||||
By default, Rancher automatically generates self-signed certificates for itself after installation. However, since you've provided your own certificates, you must disable the certificates that Rancher generated for itself.
|
||||
|
||||
@@ -132,11 +142,11 @@ By default, Rancher automatically generates self-signed certificates for itself
|
||||
|
||||
### Option D-Let's Encrypt Certificate
|
||||
|
||||
Rancher supports Let's Encrypt certificates. Let's Encrypt uses an http-01 challenge to verify that you have control over your domain. You can confirm that you control the domain by pointing the hostname that you want to use for Rancher access (for example, `rancher.mydomain.com`) to the IP of the machine it is running on. You can bind the hostname to the IP address by creating an A record in DNS.
|
||||
Rancher supports Let's Encrypt certificates. Let's Encrypt uses an `http-01 challenge` to verify that you have control over your domain. You can confirm that you control the domain by pointing the hostname that you want to use for Rancher access (for example, `rancher.mydomain.com`) to the IP of the machine it is running on. You can bind the hostname to the IP address by creating an A record in DNS.
|
||||
|
||||
>**Prerequisites:**
|
||||
>
|
||||
>- Let's Encrypt is an internet service, this cannot be used out of the box on an internal/airgapped network.
|
||||
>- Let's Encrypt is an Internet service. Therefore, this option cannot be used in an internal/air gapped network.
|
||||
>- Create a record in your DNS that binds your Linux host IP address to the hostname that you want to use for Rancher access (`rancher.mydomain.com` for example).
|
||||
>- Open port `TCP/80` on your Linux host. The Let's Encrypt http-01 challenge can come from any source IP address, so port `TCP/80` must be open to all IP addresses.
|
||||
|
||||
@@ -145,26 +155,32 @@ Rancher supports Let's Encrypt certificates. Let's Encrypt uses an http-01 chall
|
||||
|
||||
Run the following commands from your Linux host.
|
||||
|
||||
1. Run the Docker command
|
||||
1. Run the Docker command.
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
rancher/rancher:latest \
|
||||
--acme-domain rancher.mydomain.com
|
||||
```
|
||||
```
|
||||
docker run -d --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 \
|
||||
rancher/rancher:latest \
|
||||
--acme-domain rancher.mydomain.com
|
||||
```
|
||||
|
||||
|
||||
>
|
||||
>**Remember:** Let's Encrypt provides rate limits for requesting new certificates. Therefore, limit how often you create or destroy the container. For more information, see [Let's Encrypt documentation on rate limits](https://letsencrypt.org/docs/rate-limits/).
|
||||
|
||||
## What's Next?
|
||||
|
||||
Create a backup of your Rancher Server in case of a disaster scenario. For more information, see [Backing Up Your Rancher Server]({{< baseurl >}}/rancher/v2.x/en/installation/after-installation/single-node-backup-and-restoration/#backing-up-your-rancher-server).
|
||||
You have a couple of options:
|
||||
|
||||
## SSL FAQ / Troubleshooting
|
||||
- Create a backup of your Rancher Server in case of a disaster scenario: [Single Node Backup and Restoration]({{< baseurl >}}/rancher/v2.x/en/installation/backups-and-restoration/single-node-backup-and-restoration/).
|
||||
- Create a Kubernetes cluster: [Creating a Cluster]({{ <baseurl> }}/rancher/v2.x/en/tasks/clusters/creating-a-cluster/).
|
||||
|
||||
<br/>
|
||||
|
||||
## FAQ and Troubleshooting
|
||||
|
||||
{{< ssl_faq >}}
|
||||
|
||||
|
||||
## Persistent data
|
||||
## Persistent Data
|
||||
|
||||
{{< persistentdata >}}
|
||||
|
||||
@@ -41,4 +41,6 @@ Coming Soon
|
||||
|
||||
Coming Soon
|
||||
|
||||
<!-- ## Launching a Catalog App -->
|
||||
## Launching a Catalog App
|
||||
|
||||
Coming Soon
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div>
|
||||
<p>Rancher uses etcd as datastore. When using the Single Node Install, the embedded etcd will be used. The persistent data will be stored in <code>/var/lib/rancher</code> inside the container. You can bind mount a host volume to this location to preserve data on the host it is running on.</p>
|
||||
<p>Rancher uses <code>etcd</code> as datastore. When using the Single Node Install, the embedded <code>etcd</code> is be used. The persistent data is at the following path in the container: <code>/var/lib/rancher</code>. You can bind mount a host volume to this location to preserve data on the host it is running on.</p>
|
||||
|
||||
<p><b>Command</b></p>
|
||||
|
||||
|
||||
@@ -251,4 +251,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<p>The following image depicts the minimum ports you need open for Rancher to communicate. You may need to open more ports, per the table above.</p>
|
||||
<img src="/img/rancher/port-communications.png"></img>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h3>How do I know if my certificates are in PEM format?</h3>
|
||||
<h3 id="pem">How Do I Know if My Certificates are in PEM Format?</h3>
|
||||
|
||||
<p>You can recognize the PEM format by the following traits:</p>
|
||||
<ul>
|
||||
@@ -17,7 +17,25 @@ VWQqljhfacYPgp8KJUJENQ9h5hZ2nSCrI+W00Jcw4QcEdCI8HL5wmg==
|
||||
-----END CERTIFICATE-----
|
||||
</pre>
|
||||
|
||||
<h3>What is the order of certificates if I want to add my intermediate(s)?</h3>
|
||||
<h3 id="base64">How Can I Encode My PEM Files in base64?</h3>
|
||||
|
||||
<p>To encode your certificates in base64:</p>
|
||||
|
||||
<ol>
|
||||
<li>Change directory to where the PEM file resides.</li>
|
||||
<li>Run one of the following commands. Replace <code>FILENAME</code> with the name of your certificate.
|
||||
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
|
||||
# MacOS
|
||||
cat FILENAME | base64
|
||||
# Linux
|
||||
cat FILENAME | base64 -w0
|
||||
# Windows
|
||||
certutil -encode FILENAME FILENAME.base64
|
||||
</pre>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="cert-order">What is the Order of Certificates if I Want to Add My Intermediate(s)?</h3>
|
||||
|
||||
<p>The order of adding certificates is as follows:</p>
|
||||
|
||||
@@ -30,7 +48,7 @@ VWQqljhfacYPgp8KJUJENQ9h5hZ2nSCrI+W00Jcw4QcEdCI8HL5wmg==
|
||||
-----END CERTIFICATE-----
|
||||
</pre>
|
||||
|
||||
<h3>How do I validate my certificate chain?</h3>
|
||||
<h3 id="validate-cert-chain">How Do I Validate My Vertificate Chain?</h3>
|
||||
|
||||
<p>You can validate the certificate chain by using the <code>openssl</code> binary. If the output of the command (see the command example below) ends with <code>Verify return code: 0 (ok)</code>, your certificate chain is valid. The <code>ca.pem</code> file must be the same as you added to the <code>rancher/rancher</code> container. When using a certificate signed by a recognized Certificate Authority, you can omit the <code>-CAfile</code> parameter.</p>
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 371 KiB |
Reference in New Issue
Block a user