Skip to content

About

Deploy IBM webMethods Microservices Runtime (MSR) with your packages on OpenShift in one command - optional Kafka, PostgreSQL, Grafana/Prometheus/Tempo. Built for IBM TechZone PoCs.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

msr-openshift-kit

Deploy an IBM webMethods Microservices Runtime (MSR) with your own packages on any OpenShift cluster in one command, with an optional Kafka broker, PostgreSQL database and monitoring stack. Each service gets a public HTTPS URL.

The kit was built for proofs of concept on IBM TechZone OpenShift clusters: you reserve a cluster, run msrkit deploy, and send the URLs to your client. Nothing in the kit is specific to TechZone, though. It works on any OpenShift 4.x where you are cluster-admin.

$ msrkit deploy my-poc
[00:00:00] 1/8 project my-poc and permissions (as kube:admin)
...
[00:07:36] 8/8 done
  MSR admin UI and APIs : https://msr-my-poc.apps.xxxx.techzone.ibm.com/   (user Administrator)
  Grafana               : https://grafana-my-poc.apps.xxxx.techzone.ibm.com/   (user admin)
  Kafka UI              : https://kafka-ui-my-poc.apps.xxxx.techzone.ibm.com/   (user admin)

What gets deployed

flowchart LR
  user([Client / browser]) -->|HTTPS route| msr
  user -->|HTTPS route| grafana
  user -->|HTTPS route| kui[Kafka UI]
  subgraph ns [OpenShift namespace]
    msr[MSR 12.x<br/>your packages] --> kafka[(Kafka<br/>KRaft, 1 node)]
    msr --> pg[(PostgreSQL 16)]
    otel[OTel Collector] -->|scrape /metrics| msr
    msr -->|OTLP traces| otel
    otel --> prom[(Prometheus)]
    otel --> tempo[(Tempo)]
    grafana[Grafana] --> prom & tempo
    kui --> kafka
  end
  msr -->|outbound calls| ext([Client test systems])
Loading
Component Image In the namespace Public route Optional
MSR your base image + your packages msr:5555 msr (admin UI, APIs) no
Kafka apache/kafka:3.9.1 kafka:19092 (Kafka UI only) kafka
Kafka UI provectuslabs/kafka-ui:v0.7.2 kafka-ui:8080 kafka-ui (login) kafka
PostgreSQL postgres:16-alpine postgres:5432 none postgres
OTel Collector, Prometheus, Tempo otel contrib 0.111, prometheus 3.1, tempo 2.6 internal none observability
Grafana grafana:11.4.0 grafana:3000 grafana (login) observability

msrkit is a single self-contained executable of under 1 MB, for Linux, macOS and Windows. The manifests, monitoring configuration, example profile and web console are built into it. It has no runtime dependency of its own: no Python, Bash, Node.js, Helm or operator. The plain YAML it applies is in manifests/.

Prerequisites

  • An OpenShift 4.x cluster where you are cluster-admin. On TechZone, see docs/techzone.md.
  • The oc CLI, logged in (oc login --token=... --server=...).
  • podman (recommended) or docker, to build the MSR image.
  • An MSR base image you are entitled to, in your local engine or pullable by it. The kit never ships IBM images.

Install

Download the binary for your platform from the latest release:

# Linux x86_64 (also: msrkit-linux-arm64, msrkit-macos-arm64, msrkit-macos-x86_64)
curl -fsSLo msrkit https://github.com/cpoder/msr-openshift-kit/releases/latest/download/msrkit-linux-x86_64
chmod +x msrkit && sudo mv msrkit /usr/local/bin/
msrkit version

On Windows, download msrkit-windows-x86_64.exe, rename it msrkit.exe and put it on your PATH. SHA256SUMS in each release lets you verify the download.

To build from source with Rust 1.75 or later, run cargo install --git https://github.com/cpoder/msr-openshift-kit.

Quick start

msrkit init my-poc                 # commented profile to start from
# edit my-poc/profile.env: NAMESPACE and MSR_BASE_IMAGE at least
# drop your packages in my-poc/packages/
oc login --token=sha256~... --server=https://api.xxxx:6443
msrkit deploy my-poc
msrkit credentials --show

The first deploy pushes the whole MSR image (about 1 GB), so it takes from a few minutes to about 20 minutes, depending on your upload bandwidth. msrkit deploy is idempotent: run it again after you change packages or configuration. The application image is tagged with a hash of its content (base image, packages, data), so a redeploy only pushes the layers that changed (a few MB of packages), and skips the build entirely when nothing changed. On a TechZone cluster, a redeploy without package changes takes about a minute.

Web console

Prefer a browser? msrkit ui opens a local console at http://127.0.0.1:8765. It is served by the same executable, with your own oc session.

msrkit console: stack topology with live component states, public links, credentials and endpoints

From the console you can:

  • connect by pasting the oc login command from the OpenShift console;
  • create a PoC profile with a form: base image (local MSR images are suggested), packages folder or zip upload, components, endpoints, passwords and Kafka topics;
  • edit the profile files and deploy, with step-by-step progress and the live log;
  • watch the stack, through a topology diagram whose nodes change colour with each component's state and an MSR health check, refreshed every 10 seconds;
  • share access: copy the HTTPS links, and show or copy passwords;
  • change endpoints and secrets in a table that highlights changes, then apply with an MSR restart;
  • operate the stack: read the logs and restart each component, or delete the namespace (type its name to confirm).

The console is built into the binary and loads nothing from the internet, so it also works offline. It listens on 127.0.0.1 only, and every call must carry the random session token that appears in the URL printed at start-up. Run msrkit ui --port 9000 --no-browser to choose another port and skip opening the browser.

New profiles are created in $MSRKIT_PROFILES, otherwise in ./profiles if that folder exists, otherwise in ~/msrkit-profiles. Profile folders stored elsewhere can be added from the console.

A profile = one PoC

The kit is generic. Everything that belongs to one project lives in a profile folder, which you keep in a private place (it usually contains client material):

my-poc/
├── profile.env              # namespace, base image, components, DB name/user, options
├── packages/<Package>/      # MSR packages baked into the image
├── application.properties   # MSR configuration variables, using $env{...}
├── msr.env                  # non-secret environment variables (endpoints, users, JVM...)
├── secrets.env              # passwords (git-ignored), "@KEY" reuses a generated password
├── kafka-topics.txt         # topics to create: name[:partitions]
├── db/*.sql | *.sql.gz      # PostgreSQL init scripts (run once, on an empty volume)
├── data/                    # files seeded once into MSR's persistent /data volume
├── grafana/dashboards/*.json, grafana/datasources/*.yaml   # extra Grafana content
└── hooks/post-deploy.sh     # runs at the end of every deploy (smoke tests, seeding...)

Every file except profile.env is optional. docs/profile.md is the full reference, and examples/minimal is a commented starting point.

Configuration principle: the image is the same everywhere. Endpoints and credentials come from environment variables, which application.properties reads at startup through $env{NAME}. To point the PoC at the client's test systems, change a variable. You don't need to rebuild.

Day-2 commands

msrkit status                          # pods, volumes, URLs, MSR /health
msrkit urls
msrkit credentials [--show]            # MSR_ADMIN_PASSWORD, TOOLS_ADMIN_PASSWORD, DB_PASSWORD, profile secrets
msrkit env                             # list MSR environment variables
msrkit env BACKEND_URL=https://test.client.example/api   # change, then restart MSR
msrkit env --unset BACKEND_URL
msrkit secret BACKEND_PASSWORD=-                         # change a secret (value read from stdin), then restart MSR
msrkit logs [msr|kafka|postgres|grafana|...] [-f]
msrkit restart [component]
msrkit destroy                         # deletes the namespace and all data (asks for confirmation)
msrkit ui                              # the same, in a browser

All commands take -n <namespace>. The default is $MSRKIT_NAMESPACE, then msr-poc. Changes made with msrkit env and msrkit secret survive later deploys, except for keys that the profile itself sets in msr.env.

Giving the client access to change endpoints

msrkit grant gives someone a namespace-scoped account instead of the cluster admin. It can see pods, logs, routes and the non-secret configuration, set overrides, and restart MSR. It cannot read msr-secrets (the generated passwords), exec into pods, or touch other components.

Overrides live in two objects that msrkit deploy creates empty and then never touches: msr-user-env (ConfigMap) and msr-user-secrets (Secret). MSR loads them last, so their keys win over the profile and the generated values:

msrkit env --overrides BACKEND_URL=https://test.client.example/api   # then MSR restarts
msrkit secret --overrides BACKEND_PASSWORD=-                          # value read from stdin
msrkit env --overrides --unset BACKEND_URL                            # back to the profile value
msrkit secret --overrides --unset BACKEND_PASSWORD

Two ways to create the account:

# A user who can log in to the cluster (their identity provider)
msrkit grant jane@client.example -n my-poc

# Anyone else: a service account and a kubeconfig file holding its token
msrkit grant --service-account client -n my-poc --kubeconfig ./kubeconfig-client

On TechZone, the cluster's identity provider (IBMid) is enforced by GitOps: an htpasswd provider you add is removed within minutes. Use --service-account for client accounts. Hand the kubeconfig over through a secure channel; the client then runs KUBECONFIG=./kubeconfig-client msrkit -n my-poc status. A service account cannot log in to the OpenShift web console. Remove access with msrkit revoke --service-account client -n my-poc, which also invalidates the token.

Security notes

  • Passwords are generated on the first deploy: 24 random characters, stored in the msr-secrets secret. No default password is ever used.
  • Routes are HTTPS (edge TLS with the cluster's certificate). HTTP redirects to HTTPS.
  • MSR, Grafana and Kafka UI all require a login. Anonymous Grafana access is disabled. PostgreSQL, Kafka, Prometheus and Tempo have no route.
  • ROUTE_ALLOWED_CIDRS in profile.env restricts every route to the source ranges you list.
  • The namespace's default service account gets the anyuid SCC, because the public images run with the fixed UIDs they were built for. Use a dedicated cluster or namespace for each PoC.
  • Use fictitious or anonymised data on shared demo infrastructure. TechZone requires it.

Troubleshooting

Symptom Check
cannot grant the 'anyuid' SCC You are not cluster-admin. Log in as kubeadmin or another admin.
Image push fails with docker The registry route uses the cluster certificate. Use podman, or add the route host to docker's insecure-registries.
Pods stuck in Pending oc get pvc -n <ns>: there is no default storage class. Set STORAGE_CLASS in profile.env.
Insufficient cpu or Insufficient memory Small clusters with ODF storage have little headroom. The kit's requests are deliberately low (MSR 100m CPU, 1 GiB), with no CPU limit. Drop a component from COMPONENTS (observability uses about 0.7 GiB), or ask for bigger workers.
ImagePullBackOff on public images Docker Hub rate limit (100 pulls per 6 h per IP). Retry later, or mirror the images and change manifests/.
MSR not ready after 10 minutes msrkit logs msr. Look for package load errors or a bad application.properties key.
Package changes not visible Packages are in the image, so run msrkit deploy again (a new image tag is built each time).
macOS refuses to open the binary It is not notarized: run xattr -d com.apple.quarantine msrkit once.

Repository layout

src/                         Rust sources: CLI, deploy, day-2 operations, web console server
ui/index.html                web console page (embedded in the binary, no build step)
manifests/                   msr, kafka, postgres, observability (plain YAML, __PLACEHOLDERS__)
images/Dockerfile            base image + packages + data seed
config/msr/base.properties   kit defaults merged before the profile's properties
config/observability/        otel collector, prometheus, tempo, grafana (generic MSR dashboard)
examples/minimal/            commented profile (what `msrkit init` writes)
docs/                        TechZone procedure, profile reference
.github/workflows/           CI (clippy, build) and release binaries for 5 platforms on each v* tag

Everything under manifests/, config/, images/, examples/ and ui/ is embedded at build time. To customize a manifest, edit it and run cargo build --release.

Dependencies are kept to a minimum: serde_json, zip (for package uploads in the console) and getrandom (for passwords and the session token), all pure Rust. The HTTP server is the standard library's TcpListener.

License

Apache License 2.0. See LICENSE. IBM webMethods products are licensed separately; this kit only automates their deployment.

About

Deploy IBM webMethods Microservices Runtime (MSR) with your packages on OpenShift in one command - optional Kafka, PostgreSQL, Grafana/Prometheus/Tempo. Built for IBM TechZone PoCs.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages