$ run as a normal user# run as root (or with sudo)
Know it before you install
EKS runs the Kubernetes control plane for you; you add node groups (EC2) or Fargate. eksctl turns a ClusterConfig file into CloudFormation stacks. Access to the cluster API is controlled by access entries (IAM users/roles → Kubernetes rights); access from Pods to AWS by EKS Pod Identity (or IRSA).
| Item | Value |
|---|---|
| Program | eksctl (from github.com/eksctl-io/eksctl/releases) |
| Needs | AWS CLI login (SSO or role), kubectl |
| Cluster file | cluster.yaml (apiVersion: eksctl.io/v1alpha5, kind: ClusterConfig) |
| Creates | CloudFormation stacks eksctl-<name>-cluster and …-nodegroup-… |
| Kubeconfig | written to ~/.kube/config (uses aws eks get-token) |
Watch out
An EKS cluster costs money every hour (control plane + nodes + NAT gateways + load balancers). Delete lab clusters when you are done (eksctl delete cluster).
Install on RHEL and Ubuntu
curl -fsSLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_Linux_amd64.tar.gz"
curl -fsSL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep Linux_amd64 | sha256sum --check
eksctl_Linux_amd64.tar.gz: OK
tar -xzf eksctl_Linux_amd64.tar.gz
install -m 0755 eksctl /usr/local/bin/eksctl
eksctl version
aws sts get-caller-identityFirst configuration: the cluster file
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: shop-prod
region: eu-central-1
version: "1.33"
tags:
team: platform
env: prod
vpc:
nat:
gateway: HighlyAvailable
clusterEndpoints:
publicAccess: true
privateAccess: true
publicAccessCIDRs: ["203.0.113.0/24"]
iam:
withOIDC: true
accessConfig:
authenticationMode: API
addons:
- name: vpc-cni
- name: coredns
- name: kube-proxy
- name: eks-pod-identity-agent
- name: aws-ebs-csi-driver
managedNodeGroups:
- name: general
instanceTypes: ["m6i.large", "m6a.large"]
minSize: 2
desiredCapacity: 3
maxSize: 6
privateNetworking: true
volumeSize: 50
volumeEncrypted: true
labels: { role: general }
cloudWatch:
clusterLogging:
enableTypes: ["api", "audit", "authenticator"]| Part | Why |
|---|---|
version | Pin the Kubernetes version; upgrade on purpose. |
publicAccessCIDRs / privateAccess | The API is reachable only from your office/VPN (or only privately). |
authenticationMode: API | Access entries instead of the old aws-auth ConfigMap. |
eks-pod-identity-agent add-on | Pods get AWS permissions without keys (Pod Identity). |
privateNetworking | Nodes in private subnets, no public IPs. |
volumeEncrypted | Encrypted node disks. |
clusterLogging audit | Who did what in the cluster, in CloudWatch. |
eksctl create cluster -f cluster.yaml --dry-run | less
eksctl create cluster -f cluster.yaml
[✔] EKS cluster "shop-prod" in "eu-central-1" region is ready
kubectl get nodes -o wideCreating a cluster takes about 15–20 minutes.
Access for people and Pods
Give a team role access to the cluster (access entry + an EKS access policy):
eksctl create accessentry --cluster shop-prod --principal-arn arn:aws:iam::123456789012:role/PlatformAdmins --access-policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy --access-scope type=cluster
eksctl create accessentry --cluster shop-prod --principal-arn arn:aws:iam::123456789012:role/ShopDevs --kubernetes-groups shop-devs
eksctl get accessentry --cluster shop-prod(shop-devs then gets rights with normal Kubernetes RBAC RoleBindings.) Give a Pod's service account AWS rights with Pod Identity:
Daily use: the commands and the real uses
eksctl get cluster --region eu-central-1
eksctl get nodegroup --cluster shop-prod
eksctl scale nodegroup --cluster shop-prod --name general --nodes 4
eksctl utils write-kubeconfig --cluster shop-prod
eksctl get addon --cluster shop-prod
eksctl upgrade cluster --name shop-prod --version 1.34 --approve
eksctl update addon --name vpc-cni --cluster shop-prod
eksctl upgrade nodegroup --cluster shop-prod --name general --kubernetes-version 1.34
eksctl delete cluster -f cluster.yaml --waitUpgrade order: control plane (upgrade cluster, one minor version at a time) → add-ons → node groups.
Real uses at work:
- Create EKS clusters from a reviewed YAML file (in Git), the same for dev and prod.
- Add node groups for special workloads (GPU, ARM/Graviton, Spot instances).
- Manage access entries and Pod Identity without hand-written IAM trust policies.
Make it safe
Security checklist:
- API endpoint limited to known CIDRs, or private only; nodes in private subnets.
- Access entries with least privilege; no shared admin user; MFA/SSO for people.
- Pod Identity (or IRSA) — never AWS keys inside Pods.
- Audit logs on; encrypted disks; consider envelope encryption of Secrets with KMS (
secretsEncryption). - Keep the cluster on a supported version (standard support ~14 months); update add-ons.
- Delete unused clusters and load balancers (cost and attack surface).
Update and remove
Download the new release as above and replace /usr/local/bin/eksctl. eksctl delete cluster removes the cluster and its CloudFormation stacks — check for left-over load balancers, EBS volumes and security groups made by apps.
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
Create fails: CloudFormation CREATE_FAILED | Quota (VPCs, EIPs, vCPUs), IAM rights, or instance type not in that AZ. | Read the stack events in CloudFormation; raise quotas; choose other instance types. |
kubectl: You must be logged in to the server (Unauthorized) | Your IAM role has no access entry. | eksctl create accessentry … for your role; check aws sts get-caller-identity. |
| Nodes do not join | Subnets without NAT/route, or wrong security groups. | Check NAT gateways and routes; node group events in the console. |
| Pods can not reach AWS APIs with their role | Pod Identity agent missing or wrong service account. | Install the eks-pod-identity-agent add-on; restart the Pods; check the association. |
| Delete hangs | Load balancers or ENIs made by apps still exist. | Delete Services of type LoadBalancer and Ingresses first, then retry. |
version not supported | Version too old or too new for EKS. | Use a version from the EKS supported list. |
Next steps
- Quick how-to: Get the EKS kubeconfig.
- Command page: eksctl, Command page: aws, Command page: kubectl.
- At work: eksctl in DevOps.
- What you need first: AWS CLI, kubectl. The IaC way: Terraform.
1How do you give an IAM role access to the EKS API today?
With an access entry (eksctl create accessentry) and an access policy or Kubernetes groups.
2How should a Pod get AWS permissions?
With EKS Pod Identity (or IRSA) for its service account — never with keys in the Pod.