MAS 9.2 series companion app tutorial
Anatomy of a MAS Companion App shows what such an app is made of. This page shows how one gets there. We ran every step of it on our test system, on the MAS 9.2 series, from an ARM workstation with bun, podman and oc. The cluster uses path routing.
What the skeleton is#
The skeleton is a server and a page in one repository of ours. The repository is private, and the pages of this series print the files that matter:
| Part | What it is |
|---|---|
server/ | an Express server that runs under Bun: sign-in, the rights check, three API addresses |
web/ | a page built with React and Carbon, bundled by Vite |
deploy/ | the manifest, the registration Job, the two scripts that deploy and remove the app, and one optional policy file |
Dockerfile | the image |
To make an app from it, we start with three files: server/routes/api.ts for the API, web/src/App.tsx for the page, and the settings in deploy/app.yaml. The pages after this one are about the rest.
Step 1: run it on your workstation#
The skeleton runs with no cluster. In development mode it skips the sign-in and the rights check, and its API answers from a small block of demo data.
bun install
cp .env.example .env
NODE_ENV=development PORT=3001 bun server/index.ts
bunx vite --config web/vite.config.tsThe server and the page run in two terminals. The server wrote HTTP on http://localhost:3001. The page was at port 5173.

We asked the server directly as well:
| Address | Answer |
|---|---|
/probes/readiness | 200, ok |
/api/whoami | 200, the demo user |
/api/profile | 200, one demo permission |
/api/workorders | 200, two demo work orders |
This is the mode for building the page. Nothing in it proves the sign-in.
Step 2: build the image#
The image has three stages:
# Three stages: build the page, install the runtime packages, then the runtime image.
# The first two run on the processor type of the machine that builds (BUILDPLATFORM).
# Their output is JavaScript, so it runs on any processor type. On an ARM workstation
# this keeps Bun out of the emulator, where the page build crashed.
# The runtime image suits OpenShift: an arbitrary user id, files owned by group 0.
# ---- build the page ----
FROM --platform=$BUILDPLATFORM docker.io/oven/bun:1 AS build
WORKDIR /app
COPY package.json bun.lock* ./
RUN bun install --frozen-lockfile || bun install
COPY tsconfig.json ./
COPY web ./web
COPY server ./server
RUN bun run build # -> web/dist
# ---- runtime packages ----
FROM --platform=$BUILDPLATFORM docker.io/oven/bun:1 AS deps
WORKDIR /app
COPY package.json bun.lock* ./
RUN bun install --frozen-lockfile --production || bun install --production
# ---- runtime ----
FROM docker.io/oven/bun:1 AS runtime
WORKDIR /app
ENV NODE_ENV=production
COPY package.json ./
COPY --from=deps /app/node_modules ./node_modules
COPY server ./server
COPY --from=build /app/web/dist ./web/dist
# OpenShift restricted SCC: arbitrary user id, group 0, group-writable.
RUN chgrp -R 0 /app && chmod -R g=u /app
USER 1001
EXPOSE 9443
CMD ["bun", "server/index.ts"]The first build failed on our ARM workstation. The image is built for the processor type amd64, and on this workstation that means an emulator. In our first version the page was built inside that emulator, and Bun crashed there: the build ended with “Bun has crashed” and exit status 134.
The fix is in the first two lines that start with FROM. The two stages that build the page and install the packages run on the processor type of the build machine. Their output is JavaScript, and the last stage copies it. With that change the build passed.
Step 3: deploy with one command#
APP=mas-companion-skeleton ./deploy/deploy.shWe ran the script with a cluster login that has rights in the namespace of the suite. It reads the domain and the routing mode of the suite and the workspace of Maximo Manage from the cluster. After a short preflight it works through six steps:
- It builds the image and pushes it to the registry of the cluster.
- It makes the secret of the sign-in client, if there is none yet.
- It applies the objects of the app: certificate, service account, volume, network policy, deployment, service.
- It waits for the certificate and makes the Route.
- It registers the app for sign-in, with a Job in the cluster.
- It rolls the app out and checks three things.
Deploying Into a MAS Namespace explains each object and the order.
The second run failed at step 5. The Job that registers the app stayed in ImagePullBackOff. We had taken the Job from another app of ours, and it named an image pull secret that this app does not have. The pull from the cluster’s own registry failed with “authentication required”. The pod of the app itself, from the same image and without that line, was running at the same time. We removed the line.
The third run ended like this. We left out three kinds of lines: the Job being created, the answer of the identity provider, and the wait for the rollout.
== 5. register the sign-in client with the identity provider (a Job in the cluster)
coreidp HTTP 201
Registration OK
== 6. roll out and check
deployment "mas-companion-skeleton" successfully rolled out
probe through the Route: 200
page without a session: 302
client in the redirect: client_id=mas-companion-skeletonA run that skips the build (SKIP_BUILD=1) took 20 seconds, with every object already in place.
Step 4: sign in#
We opened the address of the app in a browser that had a session of the suite. The page came up signed in. Its third tile now showed real data:

The three checks of the script and this tile show three links of the chain. The Route reaches the pod. A request with no session is sent to the sign-in of the suite, with the app as the client. And a signed-in user gets data from Maximo Manage.
What we take from it#
- Build the page off the emulator. On an ARM workstation, Bun crashed when the page was built inside the amd64 emulator.
- Name no pull secret that does not exist. With such a line, a pull from the cluster’s own registry failed for us.
- Let the script read the cluster. Domain, routing mode and workspace come from the suite.
- Use development mode for the page only. It has no sign-in and no rights check.
What to read next#
Deploying Into a MAS Namespace takes step 3 apart. Logging In Through MAS is about the sign-in, and Authorization: Reusing Maximo’s Signature Options about who gets in. There Are Three Ways to Build for Maximo Application Suite says when a companion app is the right choice.
