0.1.9 • Published 1 year ago

@altech-hk/helm-gen v0.1.9

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Helm Chart Generator CLI

npm version

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:

  1. Chart Name

    • Enter your chart name (e.g., "my-service")
    • Must contain only lowercase letters, numbers, and hyphens
  2. Application Type

    • Select application type:
      • web: For web applications
      • api: For backend services
  3. Environments

    • Choose target environments (comma-separated)
    • Available options: dev,uat,prod
    • Example: "dev,uat,prod"
  4. Port Configuration

    • Enter the application port (1-65535)
    • Default: 8080
  5. Container Registry Settings

    • Registry URL (optional)
    • Repository name (optional)
    • Image tag (optional)
  6. Autoscaling Configuration

    • Enable/disable HPA
    • Set minimum replicas
    • Set maximum replicas
  7. 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:

  1. Environment Setup

    • Project namespace
    • Environment (dev/uat/prod)
    • Domain settings
  2. Ingress Configuration

    • TLS certificate settings
    • Host configurations for:
      • API Gateway
      • ArgoCD
      • Web (Coming Soon)
      • Other services (Coming Soon)
  3. 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
0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago