I’ve created a blog post that demonstrates how to set up Rancher and integrate an existing AWS EKS cluster into it. Rancher is an open-source software platform that is used for managing the Kubernetes clusters.
Prerequisites
AWS EC2 Instance — Ubuntu
EKS cluster with kubectl access
Step 1: Install Docker on EC2 instance (Rancher Server)
I used to follow the below steps to install the latest Docker version in Ubuntu,
Follow the instructions that appear on the welcome page
Press enter or click to view image in full size
Login Rancher
Step 6: Add EKS cluster to Rancher
Click on clusters and choose Generic
Add the Cluster name and click on Create
Step 7: Apply the kubectl command
$ kubectl apply -f https://domain/v3/import/xxxxxxxxxx.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-3486dd8 created clusterrole.rbac.authorization.k8s.io/cattle-admin created deployment.apps/cattle-cluster-agent configured service/cattle-cluster-agent created$ kubectl get all -n cattle-system NAME READY STATUS RESTARTS AGE pod/cattle-cluster-agent-68cb8c4784-mzfgc 1/1 Running 0 2m14s pod/cattle-cluster-agent-68cb8c4784-xkg7r 1/1 Running 0 2m15s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/cattle-cluster-agent ClusterIP 172.20.125.115 <none> 80/TCP,443/TCP 52d NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/cattle-cluster-agent 2/2 2 2 52d NAME DESIRED CURRENT READY AGE replicaset.apps/cattle-cluster-agent-65bcff69d 0 0 0 52d replicaset.apps/cattle-cluster-agent-68cb8c4784 2 2 2 2m15s replicaset.apps/cattle-cluster-agent-68fb87d757 0 0 0 52d replicaset.apps/cattle-cluster-agent-745894d768 0 0 0 2m55s
Step 8: Access the Rancher UI
Once that is done, cluster metrics will show as below. You will be able to manage the EKS cluster now by creating new deployments, services, etc.
Summary
We can add an existing Kubernetes cluster or create a new Kubernetes cluster using Rancher and scale up and scale down multiple nodes, pods, etc.
Author
Created by @sebinxavi — feel free to contact me and advise as necessary!!