An example of how to run a job process with NestJS-Commander inside a k8s job.
_ Technologies applied _
- NestJS
- Nest-commander
- TypeORM
- K8S
- Monorepo
- install packages
- run docker with
docker-compose up -d
- create tables
yarn migration:run
- run
nest start --watch -- cli event-refresh --provider=ticketmaster
- Create the image
docker build -t ticketmaster-event-refresh-job .
- Create config map
kubectl create configmap env-config --from-env-file=.env
- After creating the config map, update the HOST and create a NODE_ENV with the following values:
CLI-ENRICHER.HOST=host.docker.internal
NODE_ENV=production
- Inside k8s folder, run
kubectl apply -f cronjob.yaml
- K8S get both project and root envs;