@altech-hk/helm-gen
v0.1.9
Published
CLI tool to generate Kubernetes Helm charts
Downloads
371
Maintainers
Readme
Helm Chart Generator CLI
A command-line interface tool to quickly generate Kubernetes Helm chart templates with best practices.
Overview
This CLI tool helps developers quickly scaffold a Helm chart structure with commonly needed templates and configurations. It generates a complete Helm chart setup based on user inputs and best practices.
Installation
npm install -g @altech-hk/helm-gen
Usage
Creating a New Helm Chart
To create a new chart, run:
helm-gen create
The CLI will walk you through the following steps:
Chart Name
- Enter your chart name (e.g., "my-service")
- Must contain only lowercase letters, numbers, and hyphens
Application Type
- Select application type:
web
: For web applicationsapi
: For backend services
- Select application type:
Environments
- Choose target environments (comma-separated)
- Available options: dev,uat,prod
- Example: "dev,uat,prod"
Port Configuration
- Enter the application port (1-65535)
- Default: 8080
Container Registry Settings
- Registry URL (optional)
- Repository name (optional)
- Image tag (optional)
Autoscaling Configuration
- Enable/disable HPA
- Set minimum replicas
- Set maximum replicas
Health Check Paths
- Readiness probe path
- Liveness probe path
- Default paths:
- Web: "/"
- API: "/actuator/health/readiness" and "/actuator/health/liveness"
Generated Structure
The command will create a new directory with the following structure:
my-service/
├── Chart.yaml # Chart metadata
├── values.dev.yaml # Development environment values
├── values.uat.yaml # UAT environment values
├── values.prod.yaml # Production environment values
└── templates/
├── deployment.yaml # Kubernetes Deployment
├── service.yaml # Kubernetes Service
├── configmap.yaml # ConfigMap for configuration
├── secret.yaml # Secret for sensitive data
├── hpa.yaml # Horizontal Pod Autoscaler
└── cron-jobs.yaml # Scheduled jobs configuration
Example
$ helm-gen create
? What is your chart name? my-service
? Select application type: api
? Enter environments (comma-separated): dev,uat,prod
? Enter application port: 8080
? Enter container registry URL: registry.example.com
? Enter repository name: my-team/my-service
? Enter image tag: latest
This will generate a complete Helm chart with all necessary templates and configurations for your application.
Features
- Generate complete Helm chart structure
- Support multiple environments (dev, uat, prod)
- Include common K8s resources:
- Deployment
- Service
- ConfigMap
- Secret
- HPA (Horizontal Pod Autoscaler)
- CronJobs for scheduled tasks
- Customizable templates with common variables
- Built-in best practices for K8s deployments
- Support for HTTP-based scheduled jobs with retry mechanism
Cron Jobs Configuration
You can define scheduled jobs in your values file:
jobs:
daily-cleanup:
schedule: "0 0 * * *"
method: POST
endpoint: /api/cleanup
weekly-report:
schedule: "0 0 * * 0"
method: GET
endpoint: /api/generate-report
Each job supports:
- Custom schedule using cron syntax
- HTTP method (GET, POST, etc.)
- Endpoint configuration
- Automatic retry mechanism (3 attempts)
- Success/failure history management
Core Helm Setup for ArgoCD
To set up a core Helm chart for ArgoCD infrastructure, run:
helm-gen setup-core
The CLI will walk you through the following steps:
Environment Setup
- Project namespace
- Environment (dev/uat/prod)
- Domain settings
Ingress Configuration
- TLS certificate settings
- Host configurations for:
- API Gateway
- ArgoCD
- Web (Coming Soon)
- Other services (Coming Soon)
Service Configuration
- Backend services paths and ports
- Frontend applications settings (Coming Soon)
- Monitoring tools setup (Coming Soon)
The command will generate a complete core Helm chart with:
- Ingress configurations for all services
- TLS certificate setup
- ArgoCD configurations
- Environment-specific values