Access control plane from another ec2 instance

Viewed 67

I am trying to access the kubectl of the master node that is running on an ec2 instance. I want to do this from another ec2 instance running on a different vpc. What steps should I take to make this possible?

I have the kubeconfig file on my second machine already but on running kubectl, it gives me a connection error,

Edit: Both the vpcs are private and have the similar CIDR.

2 Answers
  • If your eks api server is private, create peering between the VPCs and allow your Second EC2 server's private IP
  • If your eks api server is public, you can allow your Second EC2 instance's public IP from the aws console, in the eks security or network section
Related