Continental Innovates with Rancher and Kubernetes
This page covers two ways to install Rancher v2.5+ on EKS. Older Rancher versions should not be installed on hosted Kubernetes clusters.
The first is a guide for deploying the Rancher server on an EKS cluster using CloudFormation. This guide was created in collaboration with Amazon Web Services to show how to deploy Rancher following best practices.
The second is a guide for installing an EKS cluster with an ingress by using command line tools. This guide may be useful if you want to use fewer resources while trying out Rancher on EKS.
If you already have an EKS Kubernetes cluster, skip to the step about installing an ingress. Then install the Rancher Helm chart following the instructions on this page.
Rancher and Amazon Web Services collaborated on a quick start guide for deploying Rancher on an EKS cluster following AWS best practices. The deployment guide is here.
The quick start guide provides three options for deploying Rancher on EKS:
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:
* The CloudFormation 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.
In this section, you’ll install an EKS cluster with an ingress by using command line tools. This guide may be useful if you want to use fewer resources while trying out Rancher on EKS.
You should already have an AWS account.
It is recommended to use an IAM user instead of the root AWS account. You will need the IAM user’s access key and secret key to configure the AWS command line interface.
The IAM user needs the minimum IAM policies described in the official eksctl documentation.
Only Rancher v2.5+ can be installed on hosted Kubernetes clusters.
Install the following command line tools on your workstation:
To configure the AWS CLI, run the following command:
Then enter the following values:
To create an EKS cluster, run the following command. Use the AWS region that applies to your use case:
eksctl create cluster \
--name rancher-server \
--version 1.18 \
--region us-west-2 \
--nodegroup-name ranchernodes \
--nodes 3 \
--nodes-min 1 \
--nodes-max 4 \
The cluster will take some time to be deployed with CloudFormation.
To test the cluster, run:
eksctl get cluster
The result should look like the following:
eksctl get cluster
2021-03-18 15:09:35 [ℹ] eksctl version 0.40.0
2021-03-18 15:09:35 [ℹ] using region us-west-2
NAME REGION EKSCTL CREATED
iztest2 us-west-2 True
The cluster needs an Ingress so that Rancher can be accessed from outside the cluster.
The following command installs an nginx-ingress-controller with a LoadBalancer service. This will result in an ELB (Elastic Load Balancer) in front of NGINX:
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm upgrade --install \
ingress-nginx ingress-nginx/ingress-nginx \
--namespace ingress-nginx \
--set controller.service.type=LoadBalancer \
--version 3.12.0 \
To get the address of the load balancer, run:
kubectl get service ingress-nginx-controller --namespace=ingress-nginx
The result should look similar to the following:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
ingress-nginx-controller LoadBalancer 10.100.90.18 a904a952c73bf4f668a17c46ac7c56ab-962521486.us-west-2.elb.amazonaws.com 80:31229/TCP,443:31050/TCP
Save the EXTERNAL-IP.
External traffic to the Rancher server will need to be directed at the load balancer you created.
Set up a DNS to point at the external IP that you saved. This DNS will be used as the Rancher server URL.
There are many valid ways to set up the DNS. For help, refer to the AWS documentation on routing traffic to an ELB load balancer.
Next, install the Rancher Helm chart by following the instructions on this page. The Helm instructions are the same for installing Rancher on any Kubernetes distribution.
Use that DNS name from the previous step as the Rancher server URL when you install Rancher. It can be passed in as a Helm option. For example, if the DNS name is rancher.my.org, you could run the Helm installation command with the option --set hostname=rancher.my.org.