Skip to main content
Deploy the IBM i MCP Server on Red Hat OpenShift using Kustomize with source-to-image (S2I) builds. New image builds automatically trigger redeployment.

Overview

The OpenShift deployment uses:
  • Source-to-Image (S2I) builds from the GitHub repository
  • Kustomize for configuration management
  • ImageStreamTag triggers for automatic redeployment on new builds
  • OpenShift Routes for TLS-terminated external access
The manifests deploy the IBM i MCP Server alongside the optional MCP Context Forge Gateway.

Prerequisites

1

OpenShift Cluster Access

You need access to an OpenShift cluster with permissions to create BuildConfigs, Deployments, Services, and Routes.
2

Install Required Tools

3

Enable Internal Image Registry

The S2I builds require the OpenShift internal image registry. Follow the Red Hat documentation to enable it if not already active.
4

Prepare Environment Files

You will need .env files with IBM i credentials and server configuration for the deployment.

Deployment Steps

1

Clone the Repository

2

Prepare Configuration Files

Copy required configuration files into the deployment directories:
Edit the .env file with your actual IBM i credentials before deploying. The file should contain DB2i_HOST, DB2i_USER, DB2i_PASS, and other required variables.The pod must bind all interfaces, so also set MCP_HTTP_HOST=0.0.0.0, set MCP_ALLOWED_HOSTS to the Route hostname, and enable authentication with MCP_AUTH_MODE=oauth. Without authentication the server refuses to start unless MCP_ALLOW_UNAUTHENTICATED_HTTP=true is set.The manifests as shipped fit an external authorization server (MCP_RESOURCE_URL and OAUTH_ISSUER_URL; SQL runs as the DB2i_USER service account). For users signing on with their IBM i user profile, follow Built-in IBM i Sign-On below: it needs three changes to the manifests.The Route terminates TLS in front of the pod, so the server sees the router’s address unless that address is listed in MCP_TRUSTED_PROXIES (see Finding the router’s address). The server then uses the right-most X-Forwarded-For entry that is not itself a listed proxy, which is the one the router writes under its default append policy and under replace. Do not set the Route annotation haproxy.router.openshift.io/set-forwarded-headers to never or if-none: both pass a client’s own header through. See Behind a Reverse Proxy.
3

Set Your Namespace

Update the root kustomization.yaml with your OpenShift namespace:Replace <NAMESPACE_PLACEHOLDER> with your actual namespace, then switch to it:
4

Deploy with Kustomize

This creates all required resources: BuildConfig, ImageStream, Deployment, Service, and Route.
5

Monitor the Build

Watch the S2I build progress:
The build clones the repository, runs the Dockerfile multi-stage build, and pushes the resulting image to the internal registry.
6

Verify Deployment


Built-in IBM i Sign-On

With the built-in IBM i sign-on users type their IBM i password into a page the server serves. The server therefore does not accept plain HTTP on a pod interface, and the shipped Route, which terminates TLS at the router (edge) and forwards plain HTTP to the pod, cannot be used. The router is a proxy on another host: it must re-encrypt, and the pod must listen with TLS.
The steps below were written from the server’s requirements and OpenShift’s documented behaviour. They were not run on a cluster for this release. Check each step on yours.
1

Give the pod a certificate

Let OpenShift’s service CA issue one. Add the annotation to ibmi-mcp-server/ibmi-mcp-server-service.yaml:
OpenShift then creates the Secret ibmi-mcp-server-tls with tls.crt and tls.key.
2

Mount it and probe over HTTPS

In ibmi-mcp-server/ibmi-mcp-server-deployment.yaml, add the volume and its mount, and scheme: HTTPS to both probes:
3

Make the Route re-encrypt

In ibmi-mcp-server/ibmi-mcp-server-route.yaml:
With no destinationCACertificate, the router verifies the pod against the service CA that issued the certificate above. Do not use passthrough: the router then adds no X-Forwarded-For, and every user appears at the router’s address.
4

Provide the Mapepire certificate

Put the certificate the server pins (or the CA that issued it) next to the key files, for example ibmi-mcp-server/secrets/mapepire.crt, and add it to the ibmi-mcp-secrets generator in ibmi-mcp-server/kustomization.yaml:
It is then mounted at /app/secrets/mapepire.crt.
5

Set the environment

In ibmi-mcp-server/.env:
Remove OAUTH_ISSUER_URL, DB2i_USER, DB2i_PASS and DB2i_IGNORE_UNAUTHORIZED. DB2i_PASS stops startup in this mode, and so does DB2i_IGNORE_UNAUTHORIZED=true together with DB2i_SERVER_CERT_FILE; without a certificate file it turns verification of the Mapepire certificate off.

Finding the router’s address

MCP_TRUSTED_PROXIES must cover the source address of the router’s connections as the pod sees it. With it unset or wrong, the sign-in page answers that the proxy does not match MCP_TRUSTED_PROXIES, because the router sends X-Forwarded-For.
lists the router pods and their addresses. When the router runs on the host network, the source address is a node address instead. To see what the server sees, start it once with MCP_LOG_LEVEL=debug and MCP_TRUSTED_PROXIES unset, request /.well-known/oauth-protected-resource through the Route, and read the rateLimitKey field (ip:<address>) of the Rate limit check passed. log record. Router pod addresses change when the pods are replaced, so a range is more practical than single addresses. Every pod inside a listed range can then write X-Forwarded-For to this server; restrict which pods may connect to it with a NetworkPolicy.

What else changes

  • Who may sign on. OAUTH_SIGNON_ALLOWED_CIDRS is compared with the user’s address as the router reports it. Its default covers private address ranges only.
  • One replica. The Deployment already runs one. Sign-ons live in that pod’s memory: every new rollout, and every pod restart, signs all users out and clears sign-on blocks.
  • Admin commands run inside the pod:
  • Other pods that call the server directly, such as the MCP Context Forge gateway, must use https://ibmi-mcp-server.<namespace>.svc:3010 (add that name to MCP_ALLOWED_HOSTS) and trust the service CA. A gateway cannot sign on as a person; give unattended callers a separate instance with an external authorization server.

What Gets Deployed

The Kustomize manifests create the following OpenShift resources:

IBM i MCP Server

Optional Components

The full Kustomize overlay can also deploy:
Edit the root kustomization.yaml to select which components to deploy. You can deploy only the IBM i MCP Server if you don’t need the gateway.

Triggering Rebuilds

Automatic

New image builds are triggered automatically when the ImageStreamTag is updated. Push a code change and start a build:

From Local Source

Build directly from your local working directory:
This uploads your local source code to OpenShift for building, useful for testing changes before pushing to Git.

From Remote Repository


Manifest Structure

The deployment manifests are organized under deployment/openshift/apps/openshift/:

Troubleshooting

Check the build logs for detailed error information:
Common causes:
  • Missing Dockerfile in the repository
  • Node.js dependency installation failures
  • Insufficient build resources (memory/CPU limits)
Check the pod logs:
Verify environment variables are set correctly:
Verify the route exists and has an assigned host:
Check that the service is targeting the correct port:
If persistent volume claims are pending:
Ensure your cluster has available storage classes with sufficient capacity.
Verify that your OpenShift cluster has network access to the IBM i system. In restricted environments, you may need:
  • Firewall rules allowing egress to IBM i on port 8076
  • Network policies permitting the MCP server pod to reach external hosts
  • DNS resolution for the IBM i hostname