{"id":30280241,"url":"https://github.com/whitemask-1/nodejs-k8s-eks-starter","last_synced_at":"2026-04-16T05:01:25.804Z","repository":{"id":309822205,"uuid":"1037557226","full_name":"whitemask-1/nodejs-k8s-eks-starter","owner":"whitemask-1","description":"A sample Node.js application deployed on AWS EKS using Kubernetes. This project demonstrates containerization with Docker, Kubernetes deployment manifests, and an automated EKS setup script. Ideal for showcasing DevOps and cloud-native skills.","archived":false,"fork":false,"pushed_at":"2025-08-14T00:30:14.000Z","size":6367,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-14T02:29:33.173Z","etag":null,"topics":["amazon-ecr","aws","cloudnative","cluster","devops","docker","eks","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whitemask-1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-13T18:52:53.000Z","updated_at":"2025-08-14T00:32:32.000Z","dependencies_parsed_at":"2025-08-14T02:39:39.796Z","dependency_job_id":null,"html_url":"https://github.com/whitemask-1/nodejs-k8s-eks-starter","commit_stats":null,"previous_names":["whitemask-1/nodejs-k8s-eks-starter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/whitemask-1/nodejs-k8s-eks-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemask-1%2Fnodejs-k8s-eks-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemask-1%2Fnodejs-k8s-eks-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemask-1%2Fnodejs-k8s-eks-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemask-1%2Fnodejs-k8s-eks-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whitemask-1","download_url":"https://codeload.github.com/whitemask-1/nodejs-k8s-eks-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemask-1%2Fnodejs-k8s-eks-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31872036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-ecr","aws","cloudnative","cluster","devops","docker","eks","kubernetes"],"created_at":"2025-08-16T15:01:28.414Z","updated_at":"2026-04-16T05:01:25.786Z","avatar_url":"https://github.com/whitemask-1.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Project 3: Kubernetes Container Orchestration\n\n---\n\n\n## What This Does\n\n* Runs your app in multiple containers (pods)\n* Automatically restarts failed containers\n* Load balances traffic between containers\n* Scales up/down based on demand\n* Provides service discovery and networking\n\n## Two Options: Local or AWS EKS\n\n### Option A: Local Kubernetes (Recommended for learning)\n\n* Uses Docker Desktop or Minikube\n* Free and fast to set up\n* Perfect for learning Kubernetes concepts\n\n### Option B: AWS EKS (Optional, for production experience)\n\n* Managed Kubernetes service on AWS\n* Production-ready setup\n* Costs money but more realistic\n\n## Prerequisites\n\n### For Local Kubernetes:\n\n* [Docker Desktop](https://www.docker.com/products/docker-desktop) with Kubernetes enabled\n* OR [Minikube](https://minikube.sigs.k8s.io/docs/start/)\n* [kubectl](https://kubernetes.io/docs/tasks/tools/)\n\n### For AWS EKS (Optional):\n\n* [AWS CLI](https://aws.amazon.com/cli/) configured\n* [eksctl](https://eksctl.io/introduction/#installation)\n* AWS account (will incur costs)\n\n## Option A: Local Kubernetes Setup\n\n### 1. Enable Kubernetes in Docker Desktop\n\n1. Open Docker Desktop\n2. Go to Settings → Kubernetes\n3. Check \"Enable Kubernetes\"\n4. Click \"Apply \u0026 Restart\"\n5. Wait for green \"Kubernetes is running\" status\n\n**OR setup Minikube:**\n\n```bash\nminikube start\nminikube addons enable metrics-server\n\n# Set up Docker environment\neval $(minikube docker-env)\n```\n\n### 2. Build Your Docker Image\n\n```bash\ndocker build -t my-webapp:latest .\ndocker images | grep my-webapp\n```\n\n### 3. Deploy to Kubernetes\n\n```bash\nkubectl apply -f k8s/app.yaml\nkubectl get pods\nkubectl get services\nkubectl get pods -w\n```\n\n### 4. Access Your Application\n\n#### For Docker Desktop:\n\n```bash\nkubectl get services my-webapp-service\n# Use the EXTERNAL-IP shown\n```\n\n#### For Minikube:\n\n```bash\nminikube service my-webapp-service --url\n```\n\n### 5. Test Kubernetes Features\n\n**Scaling:**\n\n```bash\nkubectl scale deployment my-webapp --replicas=5\nkubectl get pods -w\nkubectl scale deployment my-webapp --replicas=2\n```\n\n**Self-healing:**\n\n```bash\nkubectl delete pod [POD-NAME]\nkubectl get pods -w\n```\n\n**Rolling updates:**\n\n```bash\nkubectl set image deployment/my-webapp webapp=my-webapp:v2\nkubectl rollout status deployment/my-webapp\n```\n\n\n## 🚀 Production Deployment on AWS EKS\n\n### 1. Set Up EKS Cluster\n\n```bash\n# Make the setup script executable and run it (creates EKS cluster, configures kubectl)\nchmod +x eks-setup.sh\n./eks-setup.sh\n```\n\n### 2. Create an ECR Repository\n\n```bash\n# Replace \u003cyour-repo-name\u003e with your actual repo name (e.g., my-webapp, no angle brackets)\naws ecr create-repository --repository-name my-webapp --region us-east-1\n```\n\n### 3. Build, Tag, and Push Docker Image to ECR\n\n```bash\n# Get your AWS account ID\nACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)\nREGION=us-east-1\nREPO_NAME=my-webapp # Use the name from the previous step\n\n# Authenticate Docker to your ECR registry\naws ecr get-login-password --region $REGION | docker login --username AWS --password-stdin $ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com\n\n# Build your Docker image\ndocker build -t $REPO_NAME:latest .\n\n# Tag the image for ECR\ndocker tag $REPO_NAME:latest $ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com/$REPO_NAME:latest\n# Push the image to ECR\ndocker push $ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com/$REPO_NAME:latest\n```\n\n### 4. Update Kubernetes Manifest\n\nEdit `k8s/app.yaml` and set the image field to your ECR image (replace with your actual values):\n\n```yaml\nimage: \u003cACCOUNT_ID\u003e.dkr.ecr.\u003cREGION\u003e.amazonaws.com/my-webapp:latest\n```\n\n### 5. Deploy to EKS\n\n```bash\nkubectl apply -f k8s/app.yaml\nkubectl get pods\nkubectl get services\n```\n\n### 6. Access Your Application\n\nIf your service is of type `LoadBalancer`, get the external IP:\n\n```bash\nkubectl get services my-webapp-service\n# Wait for EXTERNAL-IP, then open in your browser\n```\n\n### 7. Clean Up AWS Resources\n\n```bash\n# Delete Kubernetes resources\nkubectl delete -f k8s/app.yaml\n\n# Delete the EKS cluster\neksctl delete cluster --name my-webapp-cluster --region us-east-1\n\n# (Optional) Delete the ECR repository and images\naws ecr delete-repository --repository-name \u003cyour-repo-name\u003e --region us-east-1 --force\n```\n\n---\n\n**Troubleshooting Tips:**\n- Make sure your AWS CLI is configured (`aws configure`).\n- Use IAM credentials with EKS/ECR permissions.\n- If `kubectl` or `eksctl` are missing, install them as described above.\n- Check AWS Console for EKS/ECR status and error messages.\n\n---\n\n## Useful Kubernetes Commands\n\n```bash\nkubectl get all\nkubectl describe pod [POD-NAME]\nkubectl logs [POD-NAME]\nkubectl logs -f [POD-NAME]\nkubectl exec -it [POD-NAME] -- /bin/sh\nkubectl get events --sort-by=.metadata.creationTimestamp\nkubectl port-forward service/my-webapp-service 8080:80\nkubectl delete -f k8s/app.yaml\n```\n\n## Understanding the Configuration\n\n### Deployment\n\n* `replicas: 3`: Runs 3 copies of your app\n* `resources`: CPU and memory limits\n* `livenessProbe`: Restarts unhealthy containers\n* `readinessProbe`: Sends traffic only to ready containers\n\n### Service\n\n* `type: LoadBalancer`: Exposes a public IP\n* `port: 80`: External port\n* `targetPort: 3001`: Internal app port\n\n### ConfigMap\n\n* Stores config data\n* Mount as files or env vars\n* Apply changes without image rebuild\n\n### HPA (Horizontal Pod Autoscaler)\n\n* `minReplicas: 2`, `maxReplicas: 10`\n* `averageUtilization: 70`\n\n## Troubleshooting\n\n### Local Kubernetes\n\n#### \"No resources found\"\n\n```bash\nkubectl cluster-info\nkubectl config current-context\nminikube status\n```\n\n#### \"ImagePullBackOff\"\n\n```bash\neval $(minikube docker-env)\ndocker build -t my-webapp:latest .\ndocker images | grep my-webapp\n```\n\n#### \"Pods stuck in Pending\"\n\n```bash\nkubectl describe nodes\nkubectl get events --sort-by=.metadata.creationTimestamp\n```\n\n### Application Issues\n\n#### \"Can't access the app\"\n\n```bash\nkubectl get services\nminikube service my-webapp-service --url\nkubectl get pods\nkubectl logs [POD-NAME]\n```\n\n#### \"Health checks failing\"\n\n```bash\nkubectl logs [POD-NAME]\nkubectl exec [POD-NAME] -- curl localhost:3001/health\nkubectl port-forward [POD-NAME] 3001:3001\ncurl localhost:3001/health\n```\n\n### EKS Issues\n\n#### \"eksctl command not found\"\n\n```bash\ncurl --silent --location \"https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz\" | tar xz -C /tmp\nsudo mv /tmp/eksctl /usr/local/bin\n```\n\n#### \"Cluster creation failed\"\n\n* Check AWS credentials: `aws sts get-caller-identity`\n* Verify IAM permissions\n* Check AWS service limits\n\n## Clean Up\n\n### Local Kubernetes:\n\n```bash\nkubectl delete -f k8s/app.yaml\nminikube stop\nminikube delete\n```\n\n### AWS EKS:\n\n```bash\nkubectl delete -f k8s/app.yaml\neksctl delete cluster --name my-webapp-cluster --region us-east-1\n```\n\n## What You Learned\n\n✅ Kubernetes container orchestration\n✅ Replica management and self-healing\n✅ Load balancing and service discovery\n✅ Config management via ConfigMaps\n✅ Health checks and rolling updates\n✅ Horizontal pod autoscaling\n✅ (Optional) Production deployment with EKS\n\n## Real-World Use Cases\n\n* Microservices architecture\n* High availability and zero-downtime deploys\n* Traffic-based scaling\n* Resilient production systems\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitemask-1%2Fnodejs-k8s-eks-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhitemask-1%2Fnodejs-k8s-eks-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitemask-1%2Fnodejs-k8s-eks-starter/lists"}