Home How to add an EKS cluster in Rancher?
Post
Cancel

How to add an EKS cluster in Rancher?

Rancher is an open source software platform where we can manage the containerized environments. It helps to create and manage kubernetes clusters via Rancher. Also, we can import already existing cluster to Rancher to manage and configure.

Pre-requistes.
  • We should have an EKS cluster provisioned.
  • Kubectl command line tool should be available
Steps Involved:
  1. Login to Rancher Dashboard.
  2. Click on cluster.
  3. Choose the option Add Cluster
    image-1
  4. Click on the option Other Cluster
    image-2
  5. Provide a meaningful cluster name.
  6. Click on Create
    image-1
  7. Apply the given command on the EKS cluster via CLI.

    1
    
    kubectl apply -f https://rancher.sample.com/v3/import/g42lk6_c-gfd2j.yaml
    
  8. Click on Done


image-1

Note: Once we have applied the command, a new namespace will be created on the cluster.

Sample output:

1
2
3
4
5
6
7
8
9
$ kubectl apply -f https://rancher.domain.com/v3/import/6xhtqc6_c-ggtmz.yaml
clusterrole.rbac.authorization.k8s.io/proxy-clusterrole-kubeapiserver created
clusterrolebinding.rbac.authorization.k8s.io/proxy-role-binding-kubernetes-master created
namespace/cattle-system created
serviceaccount/cattle created
clusterrolebinding.rbac.authorization.k8s.io/cattle-admin-binding created
secret/cattle-credentials-71f3460 created
clusterrole.rbac.authorization.k8s.io/cattle-admin created
deployment.apps/cattle-cluster-agent created

We have to allow the NAT gateway IP address for 443 port in the security group of the rancher server. Otherwise we end up in the following error

1
2
$ kubectl -n cattle-system logs cattle-cluster-agent-5d6b7cd-dwd7d
ERROR: https://rancher.domain.com/ping is not accessible (Failed to connect to rancher.domain.com port 443: Connection timed out)

That’s it.

This post is licensed under CC BY 4.0 by the author.