Merge pull request #407 from chrisurwin/master

Quickstart rewrite
This commit is contained in:
Denise
2018-07-26 16:33:19 -07:00
committed by GitHub
8 changed files with 442 additions and 211 deletions
@@ -1,222 +1,18 @@
---
title: Quick Start Guide
short title: Quick Start
title: Quick Start Guides
short title: Quick Start Index
weight: 25
---
>**Note:** This Quick Start Guide's intent is to get you up and running in a sandbox environment. It is not intended for a production environment. For more comprehensive instructions, see [Installation]({{< baseurl >}}/rancher/v2.x/en/installation/).
>**Note:** The intent of these quick start guides is to get you up and running in a sandbox environment quickly. It is not intended for a production environment. For more comprehensive instructions, see [Installation]({{< baseurl >}}/rancher/v2.x/en/installation/).
Howdy Partner! This tutorial walks you through:
- Installation of {{< product >}} {{< version >}}
- Creation of your first cluster
- Deployment of an application, Nginx
We are going to continue to grow the content of these quick starts to give you a jump start in deploying and testing Rancher 2.0!
## Quick Start Outline
The current areas covered by quick starts are:
This Quick Start Guide is divided into different tasks for easier consumption.
- **[Deploying Rancher Server]({{< baseurl >}}/rancher/v2.x/en/quick-start-guide/deployment/)**: Guides to get you running Rancher via different methods.
1. [Provision a Linux Host](#provision-a-linux-host)
- **[Deploying Workloads]({{< baseurl >}}/rancher/v2.x/en/quick-start-guide//workload/)**: Guides for deploying workloads and exposing it to be accessed externally.
Begin by provisioning a Linux host.
2. [Install Rancher](#install-rancher)
From your Linux host, run the Docker command for installing Rancher.
3. [Log In](#log-in)
Browse to your Linux host to access the Rancher UI.
4. [Create the Cluster](#create-the-cluster)
Use the versatile **Custom** option to add your Linux host into a new Kubernetes cluster.
5. [Deploy a Workload](#deploy-a-workload)
Create a workload so that Kubernetes can distribute Nginx among your cluster nodes.
6. [View Your Application](#view-your-application)
When your workload finishes deployment, browse to your node IP to make sure Nginx is running.
### Provision a Linux Host
Begin creation of a custom cluster by provisioning a Linux host. Your host can be:
- A cloud-host virtual machine (VM)
- An on-premise VM
- A bare-metal server
>**Note:**
> When using a cloud-hosted virtual machine you need to allow inbound TCP communication to ports 80 and 443. Please see your cloud-host's documentation for information regarding port configuration.
>
> For a full list of port requirements, refer to [Single Node Installation]({{< baseurl >}}/rancher/v2.x/en/installation/single-node-install/#port-requirements).
Provision the host according to the requirements below.
{{< requirements_os >}}
**Hardware Requirements**
- Memory: 4GB
**Software Requirements**
- Software: Docker
<a name="node-requirements"></a>**Supported Docker versions:**
- `1.12.6`
- `1.13.1`
- `17.03.2`
>**Notes:**
>
> - For Docker installation instructions, visit their [documentation](https://docs.docker.com/install/).
> - Docker requirements apply to both your Linux host and your cluster nodes.
### Install Rancher
To install Rancher on your host, connect to it and then use a shell to install.
1. Log in to your Linux host using your preferred shell, such as PuTTy or a remote Terminal connection.
2. From your shell, enter the following command:
```
$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
```
**Result:** Rancher is installed.
### Log In
Log in to Rancher to begin using the application. After you log in, you'll make some one-time configurations.
1. Open a web browser and enter the IP address of your host: `https://<SERVER_IP>`.<br/><br/>
Replace `<SERVER_IP>` with your host IP address.
2. When prompted, create a password for the default `admin` account there cowpoke!
3. Set the **Rancher Server URL**. The URL can either be an IP address or a host name. However, each node added to your cluster must be able to connect to this URL.<br/><br/>If you use a hostname in the URL, this hostname must be resolvable by DNS on the nodes you want to add to you cluster.
### Create the Cluster
Welcome to Rancher! You are now able to create your first Kubernetes cluster.
In this task, you can use the versatile **Custom** option. This option lets you add _any_ Linux host (cloud-hosted VM, on-premise VM, or bare-metal) to be used in a cluster.
1. From the **Clusters** page, click **Add Cluster**.
2. Choose **Custom**.
3. Enter a **Cluster Name**.
4. Skip **Member Roles** and **Cluster Options**. We'll tell you about them later.
5. Click **Next**.
6. From **Node Role**, select _all_ the roles: **etcd**, **Control**, and **Worker**.
7. **Optional**: Rancher auto-detects the IP addresses used for Rancher communication and cluster communication. You can override these using `Public Address` and `Internal Address` in the **Node Address** section.
8. Skip the **Labels** stuff. It's not important for now.
9. Copy the command displayed on screen to your clipboard.
10. Log in to your Linux host using your preferred shell, such as PuTTy or a remote Terminal connection. Run the command copied to your clipboard.
11. When you finish running the command on your Linux host, click **Done**.
{{< result_create-cluster >}}
### Deploy a Workload
You're ready to create your first _workload_. A workload is an object that includes pods along with other files and info needed to deploy your application.
For this workload, you'll be deploying the application Nginx.
1. From the **Clusters** page, open the cluster that you just created.
2. From the main menu of the **Dashboard**, select **Projects**.
3. Open the **Default** project.
4. Click **+ Deploy**.
**Step Result:** The **Deploy Workload** page opens.
5. Enter a **Name** for your workload.
6. From the **Docker Image** field, enter `nginx`. This field is case-sensitive.
7. From **Port Mapping**, click **Add Port**.
8. From the **As a** drop-down, make sure that **NodePort (On every node)** is selected.
![As a dropdown, NodePort (On every node selected)]({{< baseurl >}}/img/rancher/nodeport-dropdown.png)
9. From the **On Listening Port** field, leave the **Random** value in place.
![On Listening Port, Random selected]({{< baseurl >}}/img/rancher/listening-port-field.png)
10. From the **Publish the container port** field, enter port `80`.
![Publish the container port, 80 entered]({{< baseurl >}}/img/rancher/container-port-field.png)
11. Leave the remaining options on their default setting. We'll tell you about them later.
12. Click **Launch**.
**Result:**
* Your workload is deployed. This process might take a few minutes to complete.
* When your workload completes deployment, it's assigned a state of **Active**. You can view this status from the project's **Workloads** page.
### View Your Application
When your workload completes deployment, browse to its IP to confirm that your application is working.
From the **Workloads** page, click the link underneath your workload. If your deployment succeeded, your application opens.
>**Note**
> When using a cloud-hosted virtual machine, you may not have access to the port running the container. In this event, you can test Nginx in an ssh session on the local machine. Use the port number after the `:` in the link under your workload, which is 31568 in this example.
>
>```sh
gettingstarted@rancher:~$ curl http://localhost:31568
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to Nginx!</h1>
<p>If you see this page, the Nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://Nginx.org/">Nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using Nginx.</em></p>
</body>
</html>
gettingstarted@rancher:~$
```
## Finished
Congratulations! You have:
- Created your first cluster.
- Deployed Nginx to your cluster using a workload.
@@ -0,0 +1,12 @@
---
title: Deploying Rancher Server
weight: 100
---
The following are the current guides for provisioning Rancher Server and a cluster:
- [Digital Ocean Quick Start](./digital-ocean-qs) - We provide you with a Terraform script that completely automates the set up of the Rancher Server and registers a cluster for you to get started with.
- [Vagrant Quick Start](./quickstart-vagrant) - We provide you with a Vagrant configuration that again completely automates the set up of the Rancher Server and registers a 3 node cluster.
- [Manual Quick Start](./quickstart-manual-setup) - This will guide you through the process and requirements of manually setting up Rancher in any environment.
@@ -0,0 +1,46 @@
---
title: Digital Ocean Quick Start
weight: 100
---
The following steps will allow you to quickly deploy a Rancher Server with a 3-node cluster attached.
>**Note**
>Deploying to Digital Ocean will incur charges.
## Prerequisites
- [Digital Ocean Account](https://www.digitalocean.com) - You will require an account on Digital Ocean as this is where the server and cluster will run.
- [Digital Ocean Access Key](https://www.digitalocean.com/community/tutorials/how-to-create-a-digitalocean-space-and-api-key) - Use this link to create a Digital Ocean Access Key if you don't have one.
- [Terraform](https://www.terraform.io/downloads.html) - Used to provision the server and cluster to Digital Ocean.
## Getting Going
1. Clone [Rancher Quickstart](https://github.com/rancher/quickstart) to a folder using `git clone https://github.com/rancher/quickstart`.
2. Go into the folder containing the terraform file by executing `cd quickstart/do`.
3. Rename file `terraform.tfvars.example` to `terraform.tfvars`.
4. Edit `terraform.tfvars` to include your Digital Ocean Access Key.
5. For the first time run you will need to run `terraform init`.
6. To initiate the creation of the environment run `terraform apply`.
>**Wait for the the following**
> ```
Apply complete! Resources: 4 added, 0 changed, 0 destroyed.
Outputs:
rancher-url = [
https://xxx.xxx.xxx.xxx
]
```
6. Paste the URL into the browser and log in (default password is `admin`).
## Destroying the Environment
1. From the `quickstart/do` folder execute `terraform destroy --force` .
2. Wait for confirmation that all resources have been destroyed.
@@ -0,0 +1,124 @@
---
title: Manual Quick Start
weight: 300
---
Howdy Partner! This tutorial walks you through:
- Installation of {{< product >}} {{< version >}}
- Creation of your first cluster
- Deployment of an application, Nginx
## Quick Start Outline
This Quick Start Guide is divided into different tasks for easier consumption.
1. [Provision a Linux Host](#provision-a-linux-host)
Begin by provisioning a Linux host.
2. [Install Rancher](#install-rancher)
From your Linux host, run the Docker command for installing Rancher.
3. [Log In](#log-in)
Browse to your Linux host to access the Rancher UI.
4. [Create the Cluster](#create-the-cluster)
Use the versatile **Custom** option to add your Linux host into a new Kubernetes cluster.
### Provision a Linux Host
Begin creation of a custom cluster by provisioning a Linux host. Your host can be:
- A cloud-host virtual machine (VM)
- An on-premise VM
- A bare-metal server
>**Note:**
> When using a cloud-hosted virtual machine you need to allow inbound TCP communication to ports 80 and 443. Please see your cloud-host's documentation for information regarding port configuration.
>
> For a full list of port requirements, refer to [Single Node Installation]({{< baseurl >}}/rancher/v2.x/en/installation/references).
Provision the host according to the requirements below.
{{< requirements_os >}}
**Hardware Requirements**
- Memory: 4GB
**Software Requirements**
- Software: Docker
<a name="node-requirements"></a>**Supported Docker versions:**
- `1.12.6`
- `1.13.1`
- `17.03.2`
>**Notes:**
>
> - For Docker installation instructions, visit their [documentation](https://docs.docker.com/install/).
> - Docker requirements apply to both your Linux host and your cluster nodes.
### Install Rancher
To install Rancher on your host, connect to it and then use a shell to install.
1. Log in to your Linux host using your preferred shell, such as PuTTy or a remote Terminal connection.
2. From your shell, enter the following command:
```
$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
```
**Result:** Rancher is installed.
### Log In
Log in to Rancher to begin using the application. After you log in, you'll make some one-time configurations.
1. Open a web browser and enter the IP address of your host: `https://<SERVER_IP>`.<br/><br/>
Replace `<SERVER_IP>` with your host IP address.
2. When prompted, create a password for the default `admin` account there cowpoke!
3. Set the **Rancher Server URL**. The URL can either be an IP address or a host name. However, each node added to your cluster must be able to connect to this URL.<br/><br/>If you use a hostname in the URL, this hostname must be resolvable by DNS on the nodes you want to add to you cluster.
### Create the Cluster
Welcome to Rancher! You are now able to create your first Kubernetes cluster.
In this task, you can use the versatile **Custom** option. This option lets you add _any_ Linux host (cloud-hosted VM, on-premise VM, or bare-metal) to be used in a cluster.
1. From the **Clusters** page, click **Add Cluster**.
2. Choose **Custom**.
3. Enter a **Cluster Name**.
4. Skip **Member Roles** and **Cluster Options**. We'll tell you about them later.
5. Click **Next**.
6. From **Node Role**, select _all_ the roles: **etcd**, **Control**, and **Worker**.
7. **Optional**: Rancher auto-detects the IP addresses used for Rancher communication and cluster communication. You can override these using `Public Address` and `Internal Address` in the **Node Address** section.
8. Skip the **Labels** stuff. It's not important for now.
9. Copy the command displayed on screen to your clipboard.
10. Log in to your Linux host using your preferred shell, such as PuTTy or a remote Terminal connection. Run the command copied to your clipboard.
11. When you finish running the command on your Linux host, click **Done**.
{{< result_create-cluster >}}
## Finished
Congratulations! You have created your first cluster.
@@ -0,0 +1,30 @@
---
title: Vagrant Quick Start
weight: 200
---
The following steps will allow you to quickly deploy a Rancher Server with a 3-node cluster attached.
## Prerequisites
- [Vagrant](https://www.vagrantup.com) - Vagrant is required as this is used to provision the machine based on the Vagrantfile.
- [Virtualbox](https://www.virtualbox.org) - The Virtual Machines that Vagrant provisions need to be provisioned to VirtualBox.
- At least 6GB of free RAM.
## Getting Going
1. Clone [Rancher Quickstart](https://github.com/rancher/quickstart) to a folder using `git clone https://github.com/rancher/quickstart`.
2. Go into the folder containing the terraform file by executing `cd quickstart/vagrant`.
3. Edit the config.yaml if required (you can change the number of nodes and the memory allocations if required).
4. To initiate the creation of the environment run `vagrant up`.
5. Once provisioning has finished go to `https://172.22.101.100` in the browser (default user/password is `admin/password1` you can change this in the config.yaml prior to running the `vagrant up` command).
## Destroying the environment
1. From the `quickstart/vagrant` folder execute `vagrant destroy -f` .
2. Wait for the confirmation that all resources have been destroyed.
@@ -0,0 +1,8 @@
---
title: Deploying Workloads
weight: 200
---
1. [Deploying a workload exposed via an Ingress](./quickstart-deploy-workload-ingress) - This will guide you through creating a workload and exposing it via an Ingress
2. [Deploying a workload exposed via a Nodeport](./quickstart-deploy-workload-nodeport) - This will guide you through creating a workload and exposing it via a Nodeport
@@ -0,0 +1,71 @@
---
title: Workload with Ingress Quick Start
weight: 100
---
### Assumptions
- You have a running cluster with at least 1 node.
### Deploy a Workload
You're ready to create your first _workload_. A workload is an object that includes pods along with other files and info needed to deploy your application.
For this workload, you'll be deploying the application Rancher Hello-World.
1. From the **Clusters** page, open the cluster that you just created.
2. From the main menu of the **Dashboard**, select **Projects**.
3. Open the **Project: Default** project.
4. Click **Deploy**.
**Step Result:** The **Deploy Workload** page opens.
5. Enter a **Name** for your workload.
6. From the **Docker Image** field, enter `rancher/hello-world`. This field is case-sensitive.
7. Leave the remaining options on their default setting. We'll tell you about them later.
8. Click **Launch**.
**Result:**
* Your workload is deployed. This process might take a few minutes to complete.
* When your workload completes deployment, it's assigned a state of **Active**. You can view this status from the project's **Workloads** page.
### Expose The Application Via An Ingress
Now that the application is up and running it needs to be exposed so that otther services can connect.
1. From the **Clusters** page, open the cluster that you just created.
2. From the main menu of the **Dashboard**, select **Projects**.
3. Open the **Default** project.
4. Click on the **Load Balancing** tab.
5. Click **Add Ingress**.
6. Enter a name i.e. **hello**.
7. In the **Target** field, drop down the list and choose the name that you set for your service.
8. Enter `80` in the **Port** field.
9. Leave everything else as default and click **Save**.
10. This will create a `xip.io` address that may take a minute or two to populate.
### View Your Application
From the **Load Balancing** page, click the target link which will look something like **hello.default.xxx.xxx.xxx.xxx.xip.io > hello-world**.
Your application will open in a seperate window.
## Finished
Congratulations! You have successfully deployed a workload exposed via an ingress.
@@ -0,0 +1,144 @@
---
title: Workload with NodePort Quick Start
weight: 200
---
### Assumptions
- You have a running cluster with at least 1 node.
### Deploy a Workload
You're ready to create your first _workload_. A workload is an object that includes pods along with other files and info needed to deploy your application.
For this workload, you'll be deploying the application Rancher Hello-World.
1. From the **Clusters** page, open the cluster that you just created.
2. From the main menu of the **Dashboard**, select **Projects**.
3. Open the **Project: Default** project.
4. Click **Deploy**.
**Step Result:** The **Deploy Workload** page opens.
5. Enter a **Name** for your workload.
6. From the **Docker Image** field, enter `rancher/hello-world`. This field is case-sensitive.
7. From **Port Mapping**, click **Add Port**.
8. From the **As a** drop-down, make sure that **NodePort (On every node)** is selected.
![As a dropdown, NodePort (On every node selected)]({{< baseurl >}}/img/rancher/nodeport-dropdown.png)
9. From the **On Listening Port** field, leave the **Random** value in place.
![On Listening Port, Random selected]({{< baseurl >}}/img/rancher/listening-port-field.png)
10. From the **Publish the container port** field, enter port `80`.
![Publish the container port, 80 entered]({{< baseurl >}}/img/rancher/container-port-field.png)
11. Leave the remaining options on their default setting. We'll tell you about them later.
12. Click **Launch**.
**Result:**
* Your workload is deployed. This process might take a few minutes to complete.
* When your workload completes deployment, it's assigned a state of **Active**. You can view this status from the project's **Workloads** page.
### View Your Application
From the **Workloads** page, click the link underneath your workload. If your deployment succeeded, your application opens.
>**Note**
> When using a cloud-hosted virtual machine, you may not have access to the port running the container. In this event, you can test Nginx in an ssh session on the local machine. Use the port number after the `:` in the link under your workload, which is 31568 in this example.
>
>```sh
gettingstarted@rancher:~$ curl http://localhost:31568
<!DOCTYPE html>
<html>
<head>
<title>Rancher</title>
<link rel="icon" href="img/favicon.png">
<style>
body {
background-color: white;
text-align: center;
padding: 50px;
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
}
button {
background-color: #0075a8;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
#logo {
margin-bottom: 40px;
}
</style>
</head>
<body>
<img id="logo" src="img/rancher-logo.svg" alt="Rancher logo" width=400 />
<h1>Hello world!</h1>
<h3>My hostname is hello-world-66b4b9d88b-78bhx</h3>
<div id='Services'>
<h3>k8s services found 2</h3>
<b>INGRESS_D1E1A394F61C108633C4BD37AEDDE757</b> tcp://10.43.203.31:80<br />
<b>KUBERNETES</b> tcp://10.43.0.1:443<br />
</div>
<br />
<div id='rancherLinks' class="row social">
<a class="p-a-xs" href="https://rancher.com/docs"><img src="img/favicon.png" alt="Docs" height="25" width="25"></a>
<a class="p-a-xs" href="https://slack.rancher.io/"><img src="img/icon-slack.svg" alt="slack" height="25" width="25"></a>
<a class="p-a-xs" href="https://github.com/rancher/rancher"><img src="img/icon-github.svg" alt="github" height="25" width="25"></a>
<a class="p-a-xs" href="https://twitter.com/Rancher_Labs"><img src="img/icon-twitter.svg" alt="twitter" height="25" width="25"></a>
<a class="p-a-xs" href="https://www.facebook.com/rancherlabs/"><img src="img/icon-facebook.svg" alt="facebook" height="25" width="25"></a>
<a class="p-a-xs" href="https://www.linkedin.com/groups/6977008/profile"><img src="img/icon-linkedin.svg" height="25" alt="linkedin" width="25"></a>
</div>
<br />
<button class='button' onclick='myFunction()'>Show request details</button>
<div id="reqInfo" style='display:none'>
<h3>Request info</h3>
<b>Host:</b> 172.22.101.111:31411 <br />
<b>Pod:</b> hello-world-66b4b9d88b-78bhx </b><br />
<b>Accept:</b> [*/*]<br />
<b>User-Agent:</b> [curl/7.47.0]<br />
</div>
<br />
<script>
function myFunction() {
var x = document.getElementById("reqInfo");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
</body>
</html>
gettingstarted@rancher:~$
```
## Finished
Congratulations! You have successfully deployed a workload exposed via a NodePort.