A TypeScript-based jobs service designed to run scheduled tasks and cron jobs, deployable to Kubernetes.
This service provides a foundation for running scheduled jobs and cron tasks. It's built with TypeScript and can be deployed as Kubernetes CronJobs using the included Helm chart.
- 🚀 TypeScript with ES2022 target
- 📦 Dual format builds (CommonJS & ESM)
- 🔧 tsup for fast bundling
- ☸️ Kubernetes CronJob deployment via Helm
- 🔐 Environment variable support
- 📝 TypeScript path aliases (
@/*→src/*)
- Node.js (v18+ recommended)
- pnpm (package manager)
- Kubernetes cluster (for deployment)
- Helm 3.x (for deployment)
# Install dependencies
pnpm install# Run in development mode with watch
pnpm dev
# Build the project
pnpm build
# Run the built application
pnpm start.
├── src/
│ └── index.ts # Main entry point
├── ci-cd/ # Kubernetes deployment files
│ ├── Chart.yaml # Helm chart metadata
│ ├── values.yaml # Helm chart values
│ └── templates/
│ └── cron-jobs.yml # CronJob template
├── package.json
├── tsconfig.json # TypeScript configuration
└── tsup.config.ts # Build configuration
Copy .env.example to .env and configure:
cp .env.example .envAvailable environment variables:
ENV- Environment mode (development/production)
The project uses tsup for bundling:
- Output formats: CommonJS and ESM
- Output directory:
build/ - Source maps: Enabled
- Type definitions: Generated (
.d.tsfiles)
pnpm buildThe service can be deployed to Kubernetes using the included Helm chart:
# Navigate to the ci-cd directory
cd ci-cd
# Install/upgrade the chart
helm upgrade --install jobs . -f values.yamlEdit ci-cd/values.yaml to configure your cron jobs:
cronjob:
enabled: true
jobs:
- name: my-job
schedule: "0 0 * * *" # Cron schedule
command:
- node
- build/index.js
# ... additional configurationpnpm dev- Start development mode with watchpnpm build- Build the projectpnpm start- Run the built applicationpnpm test- Run tests (placeholder)