ekspressjs
v0.1.1
Published
Deploy applications to EKS quickly and easily with ready-to-use configurations
Downloads
225
Maintainers
Readme
EKSPressJS 🚀
Deploy applications to Amazon EKS quickly and easily with ready-to-use configurations.
Features
- 🎯 One-command deployment to EKS
- 📦 Support for multiple frameworks (Next.js, Nuxt.js, NestJS, React, Vue, Java)
- ⚙️ Automatic Dockerfile generation (or use your existing Dockerfile)
- ☸️ Kubernetes manifests generation
- 🔐 AWS configuration prompts
- 🚀 Ready-to-use configurations
- 📝 Smart environment variables management (supports .env files)
- 🗑️ Easy deployment deletion with namespace selection
Installation
npm install -g ekspressjsOr use with npx (no installation needed):
npx ekspressjs --framework nextGet Help
npx ekspressjs --help
# or
npx ekspressjs -hUsage
Basic Usage
# With framework specified
npx ekspressjs --framework <framework-type>
# Or use shorter alias
npx ekspressjs -f <framework-type>
# Without framework (requires Dockerfile in project root)
npx ekspressjsSupported Application Types
next- Next.js applicationsnuxt- Nuxt.js applicationsnest- NestJS applicationsreact- React applications (static)vue- Vue.js applications (static)java- Java applications (Spring Boot, etc.)
Note: If you don't specify --framework and have a Dockerfile in your project root, the tool will automatically detect and use it (framework type will be set to java).
Examples
# Deploy Next.js app
npx ekspressjs --framework next
# Deploy Nuxt.js app
npx ekspressjs --framework nuxt
# Deploy NestJS app
npx ekspressjs --framework nest
# Deploy Java app with custom port
npx ekspressjs --framework java --port 8080
# Deploy without specifying framework (uses Dockerfile if exists)
npx ekspressjs --port 8080
# Deploy with custom name and port
npx ekspressjs --framework nest --name my-api --port 3000Configuration
When you run the command, you'll be prompted to enter:
Basic Configuration
- AWS Region - Your EKS cluster region
- Cluster Name - Name of your EKS cluster
- Application Name - Name for your application
- Port - Port your application runs on (default: 3000)
- Replicas - Number of replicas (default: 2)
- Namespace - Kubernetes namespace (default: default)
- Ingress - Enable external access via ALB
- Image Registry - ECR URI or Docker Hub username
- AWS Credentials - Access Key ID and Secret Access Key
Domain Configuration (Optional but Recommended)
- Domain - Your domain name (e.g., example.com)
- Subdomain - Optional subdomain (e.g., app)
- SSL/TLS - Enable HTTPS with automatic certificate provisioning
- Cloudflare API Token - Your Cloudflare API token (see below)
- Cloudflare Zone ID - Your Cloudflare zone ID (see below)
Advanced Configuration
- Resource Limits - CPU and memory requests/limits
- Autoscaling - Horizontal Pod Autoscaler configuration
- Environment Variables - Smart environment variable management:
- Option 1: Use
.envfile from project (automatically detects.env,.env.local, or.env.production) - Option 2: Manual input (enter
KEY=valueformat, type "done" to finish) - For each variable, you can mark it as a secret (stored in Kubernetes Secrets) or regular env var
- Option 1: Use
- Secrets - Automatically created from environment variables marked as secrets
- Health Check Path - Custom health check endpoint
Commands
Deploy
npx ekspressjs [options]Delete Deployment
npx ekspressjs delete [options]This command will:
- List all available namespaces
- Let you select a namespace (or enter manually)
- List all deployments in the selected namespace
- Let you select which deployment to delete
- Delete the deployment and related resources (service, ingress, HPA)
Options:
-n, --namespace <ns>- Specify namespace directly (optional, will prompt if not provided)
Diagnose
npx ekspressjs diagnose [options]
# or
npx ekspressjs doctorCheck system health and debug stuck deployments.
What It Does
- ✅ Auto-detects prerequisites and guides installation if missing
- ✅ Auto-detects existing EKS clusters or helps create new ones
- ✅ Generates optimized Dockerfile for your app type (or uses existing Dockerfile)
- ✅ Creates Kubernetes deployment manifests with custom resources
- ✅ Creates Kubernetes service manifests
- ✅ Creates ingress configuration with domain and SSL
- ✅ Automatically requests SSL certificate from ACM
- ✅ Automatically configures Cloudflare DNS records
- ✅ Builds Docker image
- ✅ Pushes to ECR (or Docker Hub)
- ✅ Deploys to EKS cluster
- ✅ Sets up autoscaling (if enabled)
- ✅ Configures secrets and environment variables (supports .env files)
- ✅ Your app is accessible via domain immediately after deployment!
Requirements
- Node.js >= 20
- Docker installed and running
- kubectl installed (will be auto-detected)
- AWS CLI installed (will be auto-detected)
- EKS cluster (can be created automatically during deployment)
- AWS credentials (Access Key ID and Secret Access Key)
Prerequisites
EKSPressJS will automatically detect and guide you through installing missing prerequisites. However, you can install them manually:
Docker
- macOS:
brew install dockeror download Docker Desktop - Linux:
sudo apt-get install docker.ioor follow Docker installation guide - Windows: Download Docker Desktop
kubectl
- macOS:
brew install kubectl - Linux: Follow kubectl installation guide
- Windows: Follow kubectl installation guide
AWS CLI
- macOS:
brew install awscli - Linux:
pip install awsclior follow AWS CLI installation guide - Windows: Download from AWS CLI
Get AWS Credentials (Access Key & Secret)
- Option 1: Reuse existing AWS CLI config
- Run
aws configure(if not done before) - Provide Access Key, Secret Key, default region, output format
- Run
- Option 2: Create a new IAM Access Key (AWS Console)
- Open AWS Console → IAM → Users → Your user (or create a new programmatic user)
- Go to Security credentials → Create access key → Choose “Command Line Interface (CLI)”
- Copy Access key ID and Secret access key (store securely)
- Permissions needed (least privilege): EKS, ECR (push/pull), ACM (request/describe), and Route53/Cloudflare DNS as used.
EKS Cluster
Option 1: Create automatically during deployment (Recommended)
- EKSPressJS will prompt you to create a cluster if none exists
- Follow the interactive prompts to create your cluster
Option 2: Create manually
# Using eksctl (recommended)
eksctl create cluster --name my-cluster --region us-east-1
# Or using AWS Console
# Follow: https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.htmlConfiguration Notes
Domain Setup
For automatic domain access, you need:
- A domain registered (can be from any provider)
- Route53 Hosted Zone created for your domain
- Route53 Hosted Zone ID
- Enable SSL/TLS in the prompts
- AWS credentials with ACM and Route53 permissions
- ALB Ingress Controller installed in your EKS cluster
Cloudflare DNS Setup:
EKSPressJS uses Cloudflare for automatic DNS management. You need:
Cloudflare API Token
- Go to Cloudflare Dashboard
- Click Create Token
- Use template Edit zone DNS or create custom token with:
- Zone → DNS → Edit permission
- Select your domain zone
- Click Continue to summary → Create Token
- Copy the token immediately (it's only shown once!)
Cloudflare Zone ID
- Go to Cloudflare Dashboard
- Select your domain
- Scroll down to API section in the right sidebar
- Copy the Zone ID
During deployment, the tool will automatically:
- Request SSL certificate from ACM (us-east-1)
- Create DNS validation records in Cloudflare
- Validate certificate automatically
- Create ALB Ingress with SSL
- Wait for ALB to be provisioned (2-5 minutes)
- Configure Cloudflare CNAME record pointing to ALB
- Your app will be accessible at
https://your-domain.comafter deployment!
📖 See CLOUDFLARE_SETUP.md for detailed setup guide
Next.js
For optimal Docker builds, ensure your next.config.js includes:
module.exports = {
output: 'standalone',
// ... other config
}Nuxt.js
Ensure your nuxt.config.ts is properly configured for production builds.
NestJS
Ensure your NestJS app has a build script in package.json that compiles TypeScript to the dist folder. The default entry point is dist/main.js.
Java
- If you have a
Dockerfilein your project root, it will be used automatically - If not, a default Java Dockerfile will be generated (Maven-based)
- Ensure your Java app exposes the correct port (default: 3000, can be changed with
--port)
Environment Variables
EKSPressJS supports smart environment variable management:
Using .env file (Recommended):
- Place a
.env,.env.local, or.env.productionfile in your project root - During deployment, the tool will:
- Automatically detect and parse the .env file
- Ask for each variable whether it should be a secret
- Automatically suggest secrets for variables containing "password", "secret", "key", or "token"
- Store secrets in Kubernetes Secrets, regular vars as environment variables
- Place a
Manual input:
- Enter variables in
KEY=valueformat - Press Enter to save each variable
- Type "done" to finish
- For each variable, mark it as secret or regular env var
- Enter variables in
Best Practice: Sensitive values (passwords, API keys, tokens) should be marked as secrets and will be stored securely in Kubernetes Secrets.
Docker Registry
- ECR: Provide full ECR repository URI (e.g.,
123456789.dkr.ecr.us-east-1.amazonaws.com) - Docker Hub: Provide your Docker Hub username
- Local: Leave empty to use local images (requires manual push or local registry)
Generated Files & Layout
- All artifacts are placed under
./ekspressjs/(keeps your project clean). - Configuration is saved to
./ekspressjs/.ekspressjs-config.jsonfor future deployments. - If you already have a
Dockerfileat project root, it is reused (copied into./ekspressjs/Dockerfile). Otherwise a Dockerfile is generated based on your framework type. - Kubernetes manifests are written to:
ekspressjs/k8s/deployment.yamlekspressjs/k8s/service.yamlekspressjs/k8s/ingress.yaml(when ingress enabled)ekspressjs/k8s/hpa.yaml(when autoscaling enabled)ekspressjs/k8s/secrets.yaml(when secrets are configured)
Troubleshooting
Docker Build Fails
- Ensure Docker is running:
docker ps - Check Dockerfile syntax
- Verify all dependencies are in package.json
kubectl Connection Fails
- Verify AWS credentials are correct
- Check cluster name and region
- Run:
aws eks update-kubeconfig --region <region> --name <cluster-name>
Image Push Fails
- For ECR: Ensure repository exists and IAM permissions are correct
- For Docker Hub: Ensure you're logged in:
docker login
Deployment Stuck
- Use the diagnose command:
npx ekspressjs diagnose - Check pod status:
kubectl get pods -n <namespace> - View logs:
kubectl logs <pod-name> -n <namespace> - Check events:
kubectl describe pod <pod-name> -n <namespace>
Delete Deployment
- Use:
npx ekspressjs delete - The tool will guide you through selecting namespace and deployment
- Or specify namespace directly:
npx ekspressjs delete --namespace production
Examples
Deploy Next.js App
cd my-nextjs-app
npx ekspressjs --framework nextDeploy Java App with Custom Port
cd my-java-app
npx ekspressjs --framework java --port 8080 --name my-apiDeploy with Existing Dockerfile
# If you have a Dockerfile, you can skip --framework
cd my-app
npx ekspressjs --port 8080Deploy with Custom Replicas
npx ekspressjs --framework nest --replicas 5Deploy with Custom Name
npx ekspressjs --framework next --name my-frontendDelete a Deployment
# Interactive mode (will prompt for namespace and deployment)
npx ekspressjs delete
# With namespace specified
npx ekspressjs delete --namespace productionUsing Saved Configuration
After your first deployment, configuration is saved to .ekspressjs-config.json. On subsequent runs, you can:
- Use saved config automatically (recommended)
- Or reconfigure everything from scratch
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
