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.
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-d1db3cSystem architecture reference: https://blog.csdn.net/weixin_41010198/article/details/109166131
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
