Part of APL - Application Platform for LKE (Linode Kubernetes Engine).
The tasks repo contains autonomous jobs orchestrated by redkubes/otomi-core.
This repo is also built as an image and published on docker hub at otomi/tasks.
This readme is aimed at development. If you wish to contribute please read our Developers Contributor Code of Conduct and Contribution Guidelines
Local development requires Node.js >=24.22.1 <25 and npm 11.x. With nvm installed, run these commands from the repository root before installing dependencies or running scripts:
nvm install
nvm useThe default Node.js version is pinned to 24.22.1 in .nvmrc and both Docker
base images. package.json allows newer Node.js 24 releases for local development.
The tracked .npmrc enables engine-strict so npm rejects installs
with incompatible engines. npm 11 also checks devEngines before installs,
npm ci, and npm run commands, rejecting Node.js versions outside the allowed range.
Important
When using npm i and you get the errors Unauthorized and Permission denied on the installation regarding getting packages from redkubes
Example:
npm ERR! 403 403 Forbidden - GET https://npm.pkg.github.com/linode/@linode%2fgitea-client-node - Permission denied
The tracked .npmrc reads authentication from NODE_AUTH_TOKEN. Export a token
in your shell before installing dependencies:
export NODE_AUTH_TOKEN=PERSONAL_ACCESS_TOKEN_HERE
npm ciTo create a personal access token, go to GitHub -> settings -> developer settings -> personal access token -> give read permission on packages and create the token
Never put a token directly in the tracked .npmrc or commit it to the repository.
Make sure your expected environment variables exist in a mandatory .env file.
For Harbor operator
cp .env.harbor.sample .env
For Keycloak or Gitea operator
cp .env.sample .env
Set port forwarding so the operator can reach harbor|gitea|keycloak API
export KUBECONFIG=<>
bin/start-proxies.sh
In separate terminal execute a task locally:
export KUBECONFIG=<>
npm run tasks:(gitea*|harbor|keycloak|certs-aws|...)-dev
Or start them in vscode from the debug menu. (Don't forget to add a profile for any new tasks!)
When targeting https://... services with self-signed certs, also create a .env.ca file (just copy .env.ca.letsencrypt-staging to .env.ca when using issuer: letsencrypt-staging), and export it before running tasks:
export NODE_EXTRA_CA_CERTS='./.env.ca'Or just skip ssl verification altogether with:
export NODE_TLS_REJECT_UNAUTHORIZED='0'Setting debug level:
For all npm packages (that support it) to turn on debug, edit .env and uncomment DEBUG='*'
To limit scope please read the debug docs.
There are not many unit tests, as the tasks are very robust and idempotent. You can run them as always with:
npm test