Micro Integrator

Run WSO2 Integrator: Micro Integrator on OpenShift and deploy a small integration API in front of a backend service.

Updated CompTech Team

WSO2 Integrator: Micro Integrator (MI) is the integration runtime in the WSO2 stack. It mediates: it exposes an API, transforms the payload, calls a backend, and returns a response. It is not the place subscribers discover an API. That is API Manager. It is not the place users sign in. That is Identity Server.

MI 4.5 is the line this lab pins, because the image wso2/wso2mi:4.5.0 and the 4.5.x Helm charts are a matched pair. Later 4.x lines use the same OpenShift constraints with the chart branch that matches the image. Check the WSO2 support matrix when you pick a newer line, and mirror that image onto the site registry if the cluster is sealed.

Prerequisites

  • An OpenShift cluster and the oc and helm commands.
  • The WSO2 Helm repository, or a clone of the Helm charts you have mirrored.
  • A backend to call. Any HTTP service in the cluster will do.

OpenShift runs containers as an assigned UID and blocks many of the defaults in a vendor chart. MI's own OpenShift guidance sets three switches: do not set a run-as user, do not set a run-as group, turn AppArmor off, and make the entrypoint ConfigMap executable (0457) so the assigned UID can run the scripts. Do that rather than granting the anyuid security context constraint.

Deploy with Helm

git clone https://github.com/wso2/helm-mi.git
cd helm-mi
git checkout 4.5.x
oc create namespace wso2-integration
helm install wso2-mi ./mi \
  --namespace wso2-integration \
  --set wso2.deployment.apparmor.enabled=false \
  --set wso2.deployment.securityContext.enableRunAsUser=false \
  --set wso2.deployment.securityContext.enableRunAsGroup=false \
  --set wso2.deployment.configMaps.entryPoint.defaultMode=0457
oc get pods -n wso2-integration -w

The Integration Control Plane is the companion UI for artefacts and logs. Install it from the same chart set when operators need a console. The runtime does not require it to serve traffic.

Confirm the pod is not crash-looping on a permission error. If it is, the entrypoint mode or the run-as settings have been overridden by a profile. Fix the values. Do not relax the namespace to privileged.

An API that returns a payload

MI deploys Synapse artefacts. A one-resource API is enough to prove the path. This one answers on /health and does not call a backend yet.

<?xml version="1.0" encoding="UTF-8"?>
<api context="/health" name="HealthAPI" xmlns="http://ws.apache.org/ns/synapse">
  <resource methods="GET">
    <inSequence>
      <payloadFactory media-type="json">
        <format>{"status":"up","service":"micro-integrator"}</format>
      </payloadFactory>
      <respond/>
    </inSequence>
  </resource>
</api>

Package artefacts into a Docker image based on wso2/wso2mi:4.5.0, copied into the server's repository/deployment/server/synapse-configs/default/api/ directory, and set that image in the Helm values. Baking the artefact into the image is the reproducible path. A ConfigMap mount of the same directory is acceptable in a lab and is easy to get wrong on permissions, so prefer the image once the API is real.

To call a backend, add an endpoint and a call mediator before respond. Point the endpoint at a Kubernetes Service DNS name, not at a hostname that only exists outside the cluster.

Expose the HTTP listener. MI serves API traffic on port 8290 and the management API on 9164.

apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: mi
  namespace: wso2-integration
spec:
  to:
    kind: Service
    name: wso2-mi
  port:
    targetPort: 8290
  tls:
    termination: edge
curl -sk "https://$(oc get route mi -n wso2-integration -o jsonpath='{.spec.host}')/health"

You want {"status":"up","service":"micro-integrator"}. A 404 means the artefact did not load: check the pod log for a Synapse deployment error.

On a cluster that uses Connectivity Link for ingress, skip the Route and attach an HTTPRoute to the mesh Gateway instead. One ingress pattern per environment, not both.

Hand the API to API Manager

MI is the implementation. API Manager is the product: it publishes the OpenAPI description, applies the subscription policy, and checks the token Identity Server issued. Point an API Manager API at the MI Service URL (http://wso2-mi.wso2-integration.svc:8290/health) as its production endpoint. Callers then hit API Manager, and API Manager calls MI inside the cluster.

Keep certificates and client secrets in OpenShift Secrets, mounted into the deployment. A client secret in a values file in Git is a leak even on a private network.

What's next

  1. API Manager: publish this integration as a managed API.
  2. Identity Server: issue the tokens API Manager will require.
  3. Connectivity Link: the cluster ingress in front of both.