KNetraHub Work API: endpoints and migrations, no background jobs.
902
Work API ā the request half of Work.
KNetraHub is a self-hosted IT operations portal: a Docker Swarm console, full-stack monitoring, work management, privileged access management, IP address management and a database workspace, behind one sign-in. It ships two ways ā as a single monolith image, or as the split stack of one image per service that this image belongs to.
š Documentation: https://sengphirum.github.io/KNetraHub/documentationā
The Work module's HTTP API and realtime (SSE) endpoints, plus its schema migrations. No background jobs.
It bundles the server code of work and nothing else, so the image carries only the module it is named after.
Serves Work's HTTP endpoints and its realtime stream, and applies that module's own schema migrations at start-up. It opens two database pools: the portal pool it shares with every service, and Work's module pool, which it shares only with that module's worker.
It runs no background job whatsoever. Nothing here polls, sweeps or drains, so restarting it interrupts requests only ā never the work already in flight on the worker.
Runs unprivileged with cap_drop: [ALL] and nothing added back.
| Image | Serves HTTP | Runs background jobs | Scale it with |
|---|---|---|---|
knetrahub-work-api (this image) | yes | no | request load |
knetrahub-work-workerā | no | yes | job volume |
knetrahub-appā | yes | yes | nothing ā it is one process |
Scale this with request and dashboard load. Scale work-worker separately when it is the jobs, not the traffic, that are growing.
Read straight from the stack file that deploys this service, so the list is what the image actually takes. Optional entries ship commented out.
| Variable | Default | |
|---|---|---|
NUXT_APP_REPLICAS | 1 | set |
NUXT_DB_POOL_MAX | 8 | set |
NUXT_MODULE_POOL_REPLICAS | 2 | set |
NUXT_JWT_SECRET | change-me-to-a-long-random-string | set |
NUXT_ENV_MODE | staging | optional |
NUXT_DB_HOST | timescaledb | set |
NUXT_DB_PORT | 5432 | set |
NUXT_DB_NAME | knetrahub | set |
NUXT_DB_USER | knetrahub | set |
NUXT_DB_PASSWORD | change-me-to-a-long-random-string | set |
KNETRA_INTERNAL_TOKEN_FILE | /run/secrets/knetrahub_internal_token | optional |
NUXT_WORK_FILES_DIR | /app/data/work-files | set |
NUXT_WORK_MAX_FILE_MB | 50 | optional |
NUXT_WORK_FILES_PROVIDER | s3 | optional |
NUXT_WORK_S3_ENDPOINT | https://minio.example.com | optional |
NUXT_WORK_S3_BUCKET | knetrahub-work-files | optional |
NUXT_WORK_S3_ACCESS_KEY_FILE | /run/secrets/knetrahub_work_s3_access_key | optional |
NUXT_WORK_S3_SECRET_KEY_FILE | /run/secrets/knetrahub_work_s3_secret_key | optional |
NUXT_WORK_FILES_PROVIDER | azure | optional |
NUXT_WORK_AZURE_ACCOUNT | mystorageaccount | optional |
NUXT_WORK_AZURE_CONTAINER | knetrahub-work-files | optional |
NUXT_WORK_AZURE_ACCOUNT_KEY_FILE | /run/secrets/knetrahub_work_azure_key | optional |
NUXT_WORK_FILES_PROVIDER | gcs | optional |
NUXT_WORK_GCS_BUCKET | knetrahub-work-files | optional |
NUXT_WORK_GCS_SERVICE_ACCOUNT_JSON_FILE | /run/secrets/knetrahub_work_gcs_sa.json | optional |
NUXT_WORK_FILES_PROVIDER | seaweedfs | optional |
NUXT_WORK_SEAWEEDFS_FILER | http://seaweedfs:8888 | optional |
NUXT_WORK_SEAWEEDFS_JWT_KEY_FILE | /run/secrets/knetrahub_work_seaweedfs_jwt | optional |
NUXT_PUBLIC_APP_URL | https://knetrahub.example.com | optional |
Anything ending in _FILE reads its value from that path instead, which is how the stack passes Docker secrets.
This is one service of a stack, not a standalone container: it expects the portal database and its siblings on the same overlay network. Deploy it with the stack file that owns it rather than with docker run.
docker stack deploy -c docker/docker-compose.yml knetrahub
Pin a tag or a registry for this one service with KNETRAHUB_WORK_API_IMAGE, which the stack file reads:
export KNETRAHUB_WORK_API_IMAGE=phirumseng/knetrahub-work-api:0.1.11
latest ā the most recent releasex.y.z (e.g. 0.1.11) ā immutable release versionsPin the version in production. A rollback needs a tag that does not move, and every image in the stack is released under the same version so the whole set can be pinned together.
Each service is its own image, so one can be updated without restarting the others:
phirumseng/knetrahub-appā ā Monolith (app)phirumseng/knetrahub-uiā ā UIphirumseng/knetrahub-core-apiā ā Core APIphirumseng/knetrahub-docker-apiā ā Docker APIphirumseng/knetrahub-docker-workerā ā Docker workerphirumseng/knetrahub-monitoring-apiā ā Monitoring APIphirumseng/knetrahub-monitoring-workerā ā Monitoring workerphirumseng/knetrahub-work-api ā Work API ā this imagephirumseng/knetrahub-work-workerā ā Work workerphirumseng/knetrahub-pam-apiā ā Privileged Access APIphirumseng/knetrahub-pam-workerā ā Privileged Access workerphirumseng/knetrahub-ipmgt-apiā ā IP Management APIphirumseng/knetrahub-ipmgt-workerā ā IP Management workerphirumseng/knetrahub-dbmanager-apiā ā Database Manager APIphirumseng/knetrahub-agentā ā node agentphirumseng/knetrahub-pam-ssh-gatewayā ā PAM SSH gatewayphirumseng/knetrahub-pam-connector-runnerā ā PAM connector runnerphirumseng/knetrahub-dbmanager-gatewayā ā DB Manager gatewayProprietary ā Ā© Seng Phirum. All rights reserved.
Content type
Image
Digest
sha256:7ff8c30b5ā¦
Size
60.7 MB
Last updated
3 days ago
docker pull phirumseng/knetrahub-work-api