Rancher on the AWS Cloud

Quick Start Reference Deployment

QS

February 2021
Nelson Roberts, Rancher Labs
Andrew Park, Keith Andruch, and Dave May, AWS Quick Start team

Visit our GitHub repository for source files and to post feedback, report bugs, or submit feature ideas for this Quick Start.

This Quick Start was created by Rancher Labs in collaboration with Amazon Web Services (AWS). Quick Starts are automated reference deployments that use AWS CloudFormation templates to deploy key technologies on AWS, following AWS best practices.

Overview

This guide provides instructions for deploying the Rancher Quick Start reference architecture on the AWS Cloud.

This Quick Start is for users who want to deploy Rancher to manage Kubernetes clusters.

Amazon may share user-deployment information with the AWS Partner that collaborated with AWS on the Quick Start.

Rancher on AWS

Rancher is a software stack for teams that want to adopt containers. It addresses the operational and security challenges of managing multiple Kubernetes clusters while providing DevOps teams with integrated tools for running containerized workloads.

AWS customers can deploy Rancher into a new VPC and new Amazon EKS cluster, an existing VPC and a new EKS cluster, or an existing VPC and existing EKS cluster.

AWS costs

You are responsible for the cost of the AWS services and any third-party licenses used while running this Quick Start. There is no additional cost for using the Quick Start.

The AWS CloudFormation templates for Quick Starts include configuration parameters that you can customize. Some of the settings, such as the instance type, affect the cost of deployment. For cost estimates, see the pricing pages for each AWS service you use. Prices are subject to change.

After you deploy the Quick Start, create AWS Cost and Usage Reports to deliver billing metrics to an Amazon Simple Storage Service (Amazon S3) bucket in your account. These reports provide cost estimates based on usage throughout each month and aggregate the data at the end of the month. For more information, see What are AWS Cost and Usage Reports?

Software licenses

Rancher is open-source software and does not require a license.

Architecture

Deploying this Quick Start for a new virtual private cloud (VPC) and new Amazon EKS cluster using default parameters builds the following Rancher environment in the AWS Cloud:

Architecture
Figure 1. Quick Start architecture for Rancher on AWS

As shown in Figure 1, the Quick Start sets up the following:

  • A highly available architecture that spans three Availability Zones.*

  • A VPC configured with public and private subnets, according to AWS best practices, to provide you with your own virtual network on AWS.*

  • In the public subnets:

    • Managed network address translation (NAT) gateways to allow outbound internet access for resources.*

    • Linux bastion hosts in an Auto Scaling group to allow inbound Secure Shell (SSH) access to Amazon Elastic Compute Cloud (Amazon EC2) instances in public and private subnets.*

  • In the private subnets:

    • Kubernetes nodes in an Auto Scaling group.*

    • A Network Load Balancer (not shown) for accessing the Rancher console.

  • Rancher deployment using AWS Systems Manager automation.

  • Amazon EKS service for the EKS cluster, which provides the Kubernetes control plane.*

  • An Amazon Route 53 DNS record for accessing the Rancher deployment.

*The template that deploys the Quick Start into an existing Amazon EKS cluster skips the components marked by asterisks and prompts you for your existing VPC configuration.

Planning the deployment

Specialized knowledge

This deployment requires a moderate level of familiarity with AWS services. If you’re new to AWS, see Getting Started Resource Center and AWS Training and Certification. These sites provide materials for learning how to design, deploy, and operate your infrastructure and applications on the AWS Cloud.

This Quick Start assumes that you are familiar with Kubernetes.

AWS account

If you don’t already have an AWS account, create one at https://aws.amazon.com by following the on-screen instructions. Part of the sign-up process involves receiving a phone call and entering a PIN using the phone keypad.

Your AWS account is automatically signed up for all AWS services. You are charged only for the services you use.

Technical requirements

Before you launch the Quick Start, review the following information and ensure that your account is properly configured. Otherwise, deployment might fail.

Resource quotas

If necessary, request service quota increases for the following resources. You might request quota increases to avoid exceeding the default limits for any resources that are shared across multiple deployments. The Service Quotas console displays your usage and quotas for some aspects of some services. For more information, see What is Service Quotas? and AWS service quotas.

Resource This deployment uses

Elastic IP addresses

1

IAM roles

2

Network Load Balancers

1

EC2 instances

1

Route 53 private hosted zone

1

Route 53 private hosted zone entry

1

Supported Regions

This Quick Start is supported in any AWS Region in which Amazon Elastic Kubernetes Service (EKS) is supported. For a list of supported Regions, see Amazon Elastic Kubernetes Service endpoints and quotas.

Certain Regions are available on an opt-in basis. For more information, see Managing AWS Regions.

IAM permissions

Before launching the Quick Start, you must sign in to the AWS Management Console with IAM permissions for the resources that the templates deploy. The AdministratorAccess managed policy within IAM provides sufficient permissions, although your organization may choose to use a custom policy with more restrictions. For more information, see AWS managed policies for job functions.

Deployment options

This Quick Start provides three deployment options:

  • Deploy Rancher into a new VPC and new Amazon EKS cluster. This option builds a new AWS environment consisting of the VPC, subnets, NAT gateways, security groups, bastion hosts, Amazon EKS cluster, and other infrastructure components. It then deploys Rancher into this new EKS cluster.

  • Deploy Rancher into an existing VPC and a new Amazon EKS cluster. This option provisions Rancher in your existing AWS infrastructure.

  • Deploy Rancher into an existing VPC and existing Amazon EKS cluster. This option provisions Rancher in your existing AWS infrastructure.

When deploying into a new EKS cluster, the Amazon EKS Quick Start deploys with the option to deploy this Rancher Quick Start, a new cluster is selected by default.

Deployment steps

Sign in to your AWS account

  1. Sign in to your AWS account at https://aws.amazon.com with an IAM user role that has the necessary permissions. For more information, see Planning the deployment, earlier in this guide.

  2. Ensure that your AWS account is configured correctly, as discussed in the Technical requirements section.

Launch the Quick Start

You are responsible for the cost of the AWS services used while running this Quick Start reference deployment. There is no additional cost for using this Quick Start. For full details, see the pricing pages for each AWS service used by this Quick Start. Prices are subject to change.
  1. Sign in to your AWS account, and choose one of the following options to launch the AWS CloudFormation template. For help with choosing an option, see Deployment options, earlier in this guide.

Deploy Rancher into a new VPC and new Amazon EKS cluster

View template

Deploy Rancher into an existing VPC and a new Amazon EKS cluster

View template

Deploy Rancher into an existing VPC and existing Amazon EKS cluster

View template

Each deployment takes about 0.5–2.5 hours to complete.

  1. Check the AWS Region displayed in the upper-right corner of the navigation bar, and change it if necessary. This is where the network infrastructure for Rancher is built. The template launches in the us-east-1 Region by default.

  1. On the Create stack page, keep the default setting for the template URL, and then choose Next.

  2. On the Specify stack details page, change the stack name if needed. Review the parameters for the template, and provide values for any parameters that require input. For all other parameters, review the default settings, and customize them as necessary.

  1. On the Configure stack options page, you can specify tags (key-value pairs) for resources in your stack and set advanced options. When you’re finished, choose Next.

  2. On the Review page, review and confirm the template settings. Under Capabilities, select the two check boxes to acknowledge that the template creates IAM resources and might require the ability to automatically expand macros.

  3. Choose Create stack to deploy the stack.

  4. Monitor the status of the stack. When the status is CREATE_COMPLETE, the Rancher deployment is ready.

  5. Use the values displayed in the Outputs tab for the stack, as shown in Figure 2, to view the created resources.

cfn_outputs
Figure 2. Rancher outputs after successful deployment

Test the deployment

  • If a DNS domain option was specified, log in to the Amazon EKS bastion host, and run curl -k https://rancher.[domain specified]/

  • If a DNS domain option was not specified, log in to the Amazon EKS bastion host, and run curl -k https://rancher.aws.private/

The output should look like the following:

[ec2-user@ip-10-10-10-10 ~]$ curl -k  https://rancher.aws.private/
{"type":"collection","links":{"self":"https://rancher.aws.private/"},"actions":{},"pagination":{"limit":1000,"total":4},"sort":{"order":"asc","reverse":"https://rancher.aws.private/?order=desc"},"resourceType":"apiRoot","data":[{"apiVersion":{"group":"meta.cattle.io","path":"/me
ta","version":"v1"},"baseType":"apiRoot","links":{"apiRoots":"https://rancher.aws.private/meta/apiroots","root":"https://rancher.aws.private/meta","schemas":"https://rancher.aws.private/meta/schemas","self":"https://rancher.aws.private/meta" ... [snipped]

Post-deployment steps

Rancher verification and initial configuration
  1. Deploy an RDP bastion host into a public subnet of the VPC that hosts the EKS worker nodes.

  2. Open a browser, and navigate to the Rancher console URL.

  3. Complete the initial configurations, such as creating an administrator password.

Uninstalling Rancher
  1. An uninstall script is included in the git repository. It requires parameters for AWS Region and domain name. If you want to uninstall rancher, download the script to the Amazon EKS bastion host.

  2. From the bastion host, as ec2-user, run kubectl edit namespace cattle-system, and remove the finalizer called controller.cattle.io/namespace-auth.

  3. Run the uninstall script (that is, sh rancher_uninstall.sh us-east-2 my.domain).

FAQ

Q. I encountered a CREATE_FAILED error when I launched the Quick Start.

A. If AWS CloudFormation fails to create the stack, we recommend that you relaunch the template with Rollback on failure set to Disabled. (This setting is under Advanced in the AWS CloudFormation console, Options page.) With this setting, the stack’s state is retained, and the instance remains running so you can troubleshoot the issue. (For Windows, look at the log files in %ProgramFiles%\Amazon\EC2ConfigService and C:\cfn\log.)

When you set Rollback on failure to Disabled, you continue to incur AWS charges for the stack. Ensure to delete the stack when you finish troubleshooting.

For more information, see Troubleshooting AWS CloudFormation.

Q. I encountered a size limitation error when I deployed the AWS CloudFormation templates.

A. We recommend that you launch the Quick Start templates from the links in this guide or from another S3 bucket. If you deploy the templates from a local copy on your computer, or from a location other than an S3 bucket, you might encounter template size limitations. For more information, see AWS CloudFormation quotas.

Parameter reference

Unless you are customizing the Quick Start templates for your own deployment projects, we recommend that you keep the default settings for the parameters labeled Quick Start S3 bucket name, Quick Start S3 bucket Region, and Quick Start S3 key prefix. Changing these parameter settings automatically updates code references to point to a new Quick Start location. For more information, see the AWS Quick Start Contributor’s Guide.

Launch into an existing EKS cluster

Table 1. Network configuration
Parameter label (name) Default value Description

Private Subnet 1 ID (PrivateSubnet1ID)

Requires input

ID of the private subnet 1 in Availability Zone 1 (e.g., subnet-a0246dcd)

Table 2. EKS configuration
Parameter label (name) Default value Description

EKS cluster name (EKSClusterName)

Requires input

EKS cluster name

IAM role (IAMRole)

Requires input

IAM role for the installer to use. The role should be a member of the system:masters group in the EKS config map

EC2 security group (SecurityGroup)

Requires input

Security group for the installer to use

Table 3. Rancher configuration
Parameter label (name) Default value Description

Domain name (DomainName)

aws.private

DNS domain name that users can use to access the Rancher console.

Table 4. AWS Quick Start configuration
Parameter label (name) Default value Description

Quick Start S3 bucket name (QSS3BucketName)

aws-quickstart

S3 bucket name for the Quick Start assets. Quick Start bucket name can include numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen (-).

Quick Start S3 key prefix (QSS3KeyPrefix)

quickstart-eks-rancher/

S3 key prefix for the Quick Start assets. Quick Start key prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), and forward slash (/).

Quick Start S3 bucket Region (QSS3BucketRegion)

us-east-1

The AWS Region where the Quick Start S3 bucket (QSS3BucketName) is hosted. When using your own bucket, you must specify this value.

Send us feedback

To post feedback, submit feature ideas, or report bugs, use the Issues section of the GitHub repository for this Quick Start. To submit code, see the Quick Start Contributor’s Guide.

Quick Start reference deployments

GitHub repository

Visit our GitHub repository to download the templates and scripts for this Quick Start, to post your comments, and to share your customizations with others.


Notices

This document is provided for informational purposes only. It represents AWS’s current product offerings and practices as of the date of issue of this document, which are subject to change without notice. Customers are responsible for making their own independent assessment of the information in this document and any use of AWS’s products or services, each of which is provided “as is” without warranty of any kind, whether expressed or implied. This document does not create any warranties, representations, contractual commitments, conditions, or assurances from AWS, its affiliates, suppliers, or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers.

The software included with this paper is licensed under the Apache License, version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the accompanying "license" file. This code is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied. See the License for specific language governing permissions and limitations.