https://github.com/udx/worker-cnab
2.1K
Secure, containerized tooling for building and publishing Helm-based applications as Porter CNAB bundles for Microsoft Marketplace Kubernetes offers.
latestUDX Worker CNAB extends usabilitydynamics/udx-worker with Porter, Helm, and ORAS for a repeatable Microsoft Marketplace packaging flow.
It owns the shared porter.yaml template, renders bundle configuration from environment variables, validates the CNAB payload, builds the bundle, and publishes the resulting OCI artifact to Azure Container Registry (ACR).
Create a directory containing:
cnab/
├── manifest.yaml
├── azuredeploy.json
├── createUIDefinition.json
└── helm/
manifest.yaml must include version and extensionRegistrationParameters.defaultScope. When defaultScope is cluster, it must also include extensionRegistrationParameters.namespace.
Authenticate with an identity that can read the application image and push the CNAB bundle to the target ACR.
For local development, sign in with the Azure CLI:
az login
Replace the example registry and image names, then run:
docker run --rm \
--user root \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$PWD/cnab:/home/udx/ci/configs/cnab:ro" \
-v "$HOME/.azure:/root/.azure:ro" \
-e REGISTRY_REPO="example.azurecr.io/example-app-cnab" \
-e APP_IMAGE_REPO="example.azurecr.io/example-app" \
-e APP_IMAGE_TAG="1.0.0" \
-e APP_NAME="example-app" \
-e DISPLAY_NAME="Example App" \
usabilitydynamics/udx-worker-cnab:latest
The worker renders porter.yaml, builds the CNAB bundle, publishes it to ACR, and validates the resulting OCI manifest.
| Variable | Required | Default | Purpose |
|---|---|---|---|
REGISTRY_REPO | Yes | — | CNAB bundle repository, for example example.azurecr.io/example-app-cnab |
APP_IMAGE_REPO | No | REGISTRY_REPO | Application image repository included in bundle metadata |
APP_IMAGE_TAG | No | latest | Application image tag |
APP_NAME | No | Derived | Bundle and image name |
DISPLAY_NAME | No | APP_NAME | Human-readable install and uninstall label |
CNAB_DIR | No | Auto-detected | Mounted payload directory |
RUN_CNAB_BUILD | No | true | Build the bundle |
RUN_CNAB_PUBLISH | No | true | Publish the bundle to ACR |
HELM_CHART_PATH | No | ./helm | Helm chart directory |
HELM_RELEASE_NAME | No | APP_NAME | Helm release name |
K8S_NAMESPACE | No | APP_NAME | Target Kubernetes namespace |
Set RUN_CNAB_PUBLISH=false to build without publishing. Publishing requires a build in the same run.
Use @udx/worker-deployment to keep local, CI/CD, and hosted runs consistent:
npm install -g @udx/worker-deployment
worker run --config=deploy.yml
The repository includes an example deploy.yml with the required Docker socket, optional CNAB payload mount, and Azure authentication mount.
During the build, Worker CNAB renders the Marketplace-specific CNAB metadata required for Kubernetes offers, including:
custom.helmchartcustom.extensionregistrationparameterscustom.packagingtoolversioncustom.testparameterfilecustom.skipdeploymentContent type
Image
Digest
sha256:a585be02e…
Size
459.2 MB
Last updated
15 days ago
docker pull usabilitydynamics/udx-worker-cnab