npm.io
0.2.1 • Published 1 week ago

@nest-batch/kubernetes

Licence
MIT
Version
0.2.1
Deps
0
Size
48 kB
Vulns
0
Weekly
143

@nest-batch/kubernetes

Kubernetes Job one-off execution adapter for @nest-batch/core.

Korean: README.ko.md

Install

pnpm add @nest-batch/core @nest-batch/kubernetes

Provide a client object with a createJob(input) method. It can wrap the Kubernetes API client your application uses.

Public Imports

import {
  KubernetesJobAdapter,
  KubernetesJobLauncher,
  type KubernetesJobModuleOptions,
} from '@nest-batch/kubernetes';

Wiring

import { KubernetesJobAdapter } from '@nest-batch/kubernetes';

NestBatchModule.forRoot({
  adapters: {
    persistence: persistenceAdapter,
    transport: KubernetesJobAdapter.forRoot({
      client: kubernetesJobsClient,
      namespace: 'batch',
      image: 'registry.example.com/orders-worker:latest',
      containerName: 'batch-worker',
      command: ['node', 'dist/batch-worker.js'],
      serviceAccountName: 'batch-worker',
    }),
  },
});

Keywords