Overview
This practical demonstrates a complete end-to-end Kubernetes workflow on AWS EKS using eksctl from a Windows PowerShell environment.
The goal is to:
- Create a new EKS cluster
- Provision worker nodes
- Deploy applications on Kubernetes
- Expose the application to the outside world using a LoadBalancer
- Perform complete cleanup to avoid AWS charges
This documentation is based on real execution logs and troubleshooting, not theoretical steps.
Prerequisites
- Windows OS
- PowerShell
- AWS Account
- AWS CLI installed
- kubectl installed
- eksctl installed
STEP 1: Verify eksctl Installation
eksctl version
Output:
0.221.0
✅ Confirms eksctl is installed and ready.
STEP 2: Configure AWS Credentials
aws configure
Entered details:
- AWS Access Key ID
- AWS Secret Access Key
- Default region:
us-east-1 - Output format:
json
Sure 👍 here’s a clear, step-by-step guide to get AWS Access Key ID and Secret Access Key from the AWS Security (IAM) section.
This is exactly what you should write in documentation / practical files.
🔐 How to Get AWS Access Key ID & Secret Access Key (IAM)
Login to AWS Console
- Go to 👉 https://aws.amazon.com/console/
- Click Sign in to the Console
- Login using your AWS root account or IAM user
Open IAM (Security Service)
- In the AWS Console search bar, type IAM
- Open IAM – Identity and Access Management
👉 IAM is used to manage users, permissions, and access keys.
Go to Users
- In the left sidebar, click Users
- Click on your IAM User name
⚠️ Best practice:
Use an IAM user, not the root account, for CLI access.
Open Security Credentials
- Inside the user page, go to the Security credentials tab
- Scroll down to Access keys
Create Access Key
- Click Create access key
- Select Command Line Interface (CLI)
- Check the confirmation box
- Click Next
- (Optional) Add a tag
- Click Create access key
Copy Access Keys (VERY IMPORTANT)
You will see:
- Access Key ID
- Secret Access Key
⚠️ IMPORTANT RULES
- Secret Access Key is shown ONLY ONCE
- Copy and store it safely
- If lost, you must create a new key
Example:
Access Key ID : AKIAxxxxxxxxxxxx
Secret Access Key : xxxxxxxxxxxxxxxxxxxxxxxxx
STEP 3: Verify AWS Identity
aws sts get-caller-identity
Output:
{
"UserId": "198961699878",
"Account": "198961699878",
"Arn": "arn:aws:iam::198961699878:root"
}
✅ Confirms AWS authentication is working.
STEP 4: Verify Configured Region
aws configure get region
Output:
us-east-1
STEP 5: Create EKS Cluster with Managed Node Group
eksctl create cluster `
--name my-cluster `
--region us-east-1 `
--nodegroup-name standard-workers `
--node-type t3.medium `
--nodes 3
What this does:
- Creates an EKS cluster named
my-cluster - Uses Kubernetes version
1.32 - Provisions 3 EC2 worker nodes
-
Installs core add-ons:
- kube-proxy
- CoreDNS
- VPC CNI
- metrics-server
⏱️ Cluster creation took ~15 minutes.
Final Status:
EKS cluster "my-cluster" in "us-east-1" region is ready
STEP 6: Update kubeconfig for kubectl
aws eks update-kubeconfig --name my-cluster --region us-east-1
Output:
Added new context arn:aws:eks:us-east-1:198961799878:cluster/my-cluster
STEP 7: Verify Worker Nodes
kubectl get nodes
Output:
ip-192-168-21-14.ec2.internal Ready
ip-192-168-28-52.ec2.internal Ready
ip-192-168-49-76.ec2.internal Ready
✅ All worker nodes are in Ready state.
STEP 8: Create ConfigMap (Application Configuration)
Initial PowerShell Multiline Error
Linux-style \ caused parsing errors in PowerShell.
Correct Command (Single Line)
kubectl create configmap app-config --from-literal=APPENV=production --from-literal=LOGLEVEL=info
Output:
configmap/app-config created
Verify ConfigMap
kubectl get configmap
kubectl describe configmap app-config
STEP 9: Create Pod Using ConfigMap
Create YAML File
notepad config-pod.yaml
config-pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: config-pod
spec:
containers:
- name: app
image: nginx
env:
- name: APPENV
valueFrom:
configMapKeyRef:
name: app-config
key: APPENV
Apply Pod
kubectl apply -f config-pod.yaml
Verify Pod
kubectl get pods
kubectl exec -it config-pod -- printenv APPENV
Output:
production
STEP 10: Create Deployment (Multiple Replicas)
Create Deployment YAML
notepad nginx-deployment.yaml
nginx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.25
ports:
- containerPort: 80
Apply Deployment
kubectl apply -f nginx-deployment.yaml
Verify
kubectl get deployments
kubectl get pods
STEP 11: Expose Deployment Using LoadBalancer
kubectl expose deployment nginx-deployment --type=LoadBalancer --port=80
Verify Service
kubectl get svc
Output:
nginx-deployment LoadBalancer a26036e6e746042178d8b53a365c218b.us-east-1.elb.amazonaws.com
✅ AWS Elastic Load Balancer was created automatically.
STEP 12: Cleanup Kubernetes Resources
kubectl delete deployment nginx-deployment
kubectl delete svc nginx-deployment
kubectl delete pod config-pod
kubectl delete configmap app-config
Verify Cleanup
kubectl get all
Output:
service/kubernetes (default system service only)
STEP 13: Delete EKS Cluster (MOST IMPORTANT)
eksctl delete cluster --name my-cluster --region us-east-1
What this deletes:
- Worker nodes
- EKS control plane
- Load balancers
- CloudFormation stacks
- Networking resources
Final Status:
all cluster resources were deleted
Conclusion
This practical successfully demonstrated:
- EKS cluster creation using
eksctl - Managed worker node provisioning
- ConfigMap creation and usage
- Pod and Deployment lifecycle
- External access using LoadBalancer
- Complete and safe cleanup to avoid AWS charges
Stay connected for next kubernetes tutorial! 😊
Top comments (0)