Cloud Native 3 min read

Managing an EKS Cluster from an EC2 Node

This guide walks through installing kubectl on an EC2 instance, configuring the kubeconfig to point to a specific Amazon EKS cluster, and verifying the setup by listing cluster nodes, providing all commands and expected outputs.

ZhiKe AI
ZhiKe AI
ZhiKe AI
Managing an EKS Cluster from an EC2 Node

Install kubectl on EC2

Download the binary, move it to /usr/local/bin, make it executable, then run a basic command to confirm the binary is reachable.

# Download kubectl
curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.20.4/2021-04-12/bin/linux/amd64/kubectl
# Move to /usr/local/bin
sudo mv ./kubectl /usr/local/bin
# Add executable permission
chmod +x /usr/local/bin/kubectl

# Verify installation (expected error before kubeconfig is set)
kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?

Installation reference: https://docs.aws.amazon.com/zh_cn/eks/latest/userguide/install-kubectl.html

Configure EC2 node for a managed EKS cluster

Update the kubeconfig for the target cluster and verify that the node list can be retrieved.

# Set cluster information
aws eks --region ap-south-1 update-kubeconfig --name obg-eks-develop
Added new context arn:aws:eks:ap-south-1:384776417503:cluster/obg-eks-develop to /home/ec2-user/.kube/config

# Verify configuration
kubectl get nodes
NAME                                            STATUS   ROLES   AGE   VERSION
ip-10-48-34-209.ap-south-1.compute.internal    Ready    <none>   85m   v1.18.9-eks-d1db3c

System architecture reference: https://blog.csdn.net/weixin_41010198/article/details/109166131

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

KubernetesAWSCluster ConfigurationEKSkubectlEC2
ZhiKe AI
Written by

ZhiKe AI

We dissect AI-era technologies, tools, and trends with a hardcore perspective. Focused on large models, agents, MCP, function calling, and hands‑on AI development. No fluff, no hype—only actionable insights, source code, and practical ideas. Get a daily dose of intelligence to simplify tech and make efficiency tangible.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.