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:
- Login to Rancher Dashboard.
- Click on cluster.
- Choose the option
Add Cluster
- Click on the option
Other Cluster
- Provide a meaningful cluster name.
- Click on
Create
Apply the given command on the EKS cluster via CLI.
1
kubectl apply -f https://rancher.sample.com/v3/import/g42lk6_c-gfd2j.yaml
- Click on
Done
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.