Skip to content

Multi-Tenancy

A reference for Red Hat OpenShift AI Models as a Service multi-tenancy (RHOAI 3.5+): multiple MaaS tenants on one shared platform, isolation boundaries, and provisioning an additional tenant.

This page is a reference for Red Hat OpenShift AI Models as a Service multi-tenancy (RHOAI 3.5+). It answers the question that comes up in every architecture discussion: “Can we have a MaaS per team or per namespace in the same cluster?” The short answer: you get multiple MaaS tenants on one shared platform, not multiple independent MaaS instances. This page explains what that difference means, what is isolated, what is shared, and how to provision an additional tenant.

Important

MaaS multi-tenancy is a Technology Preview feature in RHOAI 3.5. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. See the official RHOAI 3.5 multi-tenancy documentation for the supported scope.

Tenants, Not Instances

A tenant is a slice of one shared MaaS platform, bootstrapped by an AITenant custom resource. From the user’s point of view each tenant behaves like an independent MaaS environment: its own gateway hostname, its own identity configuration, its own API keys, subscriptions, and model catalog. From the platform’s point of view there is still one maas-controller, one PostgreSQL database, and one model serving infrastructure underneath.

What each tenant gets (dedicated):

ResourceDetail
GatewayA dedicated Gateway API Gateway with a unique hostname (e.g. finance-maas.apps.<cluster-domain>). The controller claims each Gateway for exactly one tenant - two AITenant resources cannot share a Gateway.
Tenant namespaceCreated as ai-tenant-<name> for additional tenants. Holds the tenant-scoped MaaS resources: MaaSSubscription, MaaSAuthPolicy, MaaSModelRef, and the tenant’s MaasTenantConfig.
API infrastructureA per-tenant maas-api instance (maas-api-<name> in redhat-ai-gateway-infra), plus gateway-scoped authentication and rate-limit policies for that tenant’s Gateway.
Identity realmEach tenant can point at its own OIDC issuer (spec.oidc on the AITenant), or fall back to OpenShift TokenReview. Tokens minted for one tenant are rejected by other tenants’ gateways.
RBAC RolesThe controller creates aitenant-<name>-tenant-admin (manage subscriptions, auth policies, tenant config in the tenant namespace) and aitenant-<name>-object-admin (read the AITenant object). You grant access by creating standard RoleBindings.

What stays shared across all tenants:

ResourceDetail
PostgreSQL databaseAll tenants store API keys in the same database instance. Keys are stored as salted SHA-256 hashes together with the username, group memberships, subscription, and tenant name, and every lookup is scoped by the (key_hash, tenant) index - a key created in tenant A returns 404 API key not found on tenant B’s gateway. See API Key Security for the full storage and validation internals.
maas-controllerOne controller reconciles all tenants.
Model serving infrastructureGPU nodes, model weights, and the serving stack (KServe / llm-d / vLLM) are cluster resources. Tenants govern access to models; they do not get dedicated copies of them.
Authorino and LimitadorPlatform-level authentication and rate limiting components are shared; the policies they enforce are per tenant.
Observability stackPrometheus, OTEL collectors, and dashboards are shared. Metrics, traces, and structured logs carry the tenant name, so usage can be filtered and attributed per tenant.

So “a MaaS per namespace” is not quite the model. The model is: one platform, and per team a tenant slice consisting of a gateway, a tenant namespace, and labeled model namespaces. Traffic separation comes from the dedicated gateways; governance separation comes from the tenant scoping in maas-api and the per-tenant policies.

Isolation Boundaries

The official docs list four cross-tenant protections, all enforced at the application layer:

  • API key rejection - a key created in one tenant returns HTTP 404 (API key not found) against another tenant’s gateway. Each tenant’s maas-api instance queries only its own tenant’s keys.
  • OIDC token rejection - tokens are validated against the tenant-specific identity provider configuration; tokens from another tenant’s IdP are rejected by the gateway AuthPolicy.
  • Subscription scoping - GET /v1/subscriptions returns only the requesting tenant’s data.
  • Model discovery scoping - GET /v1/models returns only models associated with the tenant through MaaSModelRef resources in the tenant namespace or with a matching tenantRef.
Note

Network-layer isolation is not part of MaaS tenancy. The boundaries above are gateway, identity, and RBAC boundaries. Pods in different tenant namespaces still share the cluster network. If your isolation requirements go further (e.g. tenants must not reach each other’s model pods directly, bypassing the gateway), add NetworkPolicies or, on OVN-Kubernetes, User Defined Networks (UDN) on top - that is standard OpenShift multi-tenancy hardening, independent of MaaS. This guide has not validated a UDN setup with MaaS.

The Default Tenant

Deploying MaaS (Phase 4) automatically creates the default tenant, which is exactly what this guide has been using all along:

oc get aitenant models-as-a-service -n ai-tenants
NAME                  READY   TENANT NAMESPACE      GATEWAY                AGE
models-as-a-service   True    models-as-a-service   maas-default-gateway   1h

The default tenant uses the models-as-a-service namespace and claims maas-default-gateway. On upgrade from 3.4, the controller migrates the old Tenant resource to a MaasTenantConfig, preserving API keys, subscriptions, and models.

Important

ExternalModel resources (Phase 8) are supported only in the default tenant. The controller disables the ExternalModel controller for non-default tenants (DISABLE_EXTERNAL_MODEL_CONTROLLER=true) to prevent HTTPRoute conflicts between tenant gateways. Access external models through the default tenant gateway.

Provisioning an Additional Tenant

Condensed from the official procedure. Prerequisites: the default tenant is Ready, cert-manager is installed, and RHCL is at Kuadrant v1.4.2 or later (the gateway-scoped AuthPolicy needs spec.defaults.rules).

Step 1: Pick a tenant name (DNS-1123 label, max 41 characters), detect the TLS certificate name (same derivation as Phase 2 - the official docs hardcode router-certs-default, which is wrong on clusters with a custom ingress certificate), and label the namespaces that must attach routes to the tenant Gateway:

TENANT_NAME="finance"
CLUSTER_DOMAIN=$(oc get ingresses.config.openshift.io cluster -o jsonpath='{.spec.domain}')
GATEWAY_HOSTNAME="${TENANT_NAME}-maas.${CLUSTER_DOMAIN}"

CERT_NAME=$(oc get ingresscontroller default -n openshift-ingress-operator \
  -o jsonpath='{.spec.defaultCertificate.name}' 2>/dev/null)
CERT_NAME="${CERT_NAME:-router-certs-default}"

# infrastructure namespace (per-tenant maas-api HTTPRoute)
oc label namespace redhat-ai-gateway-infra \
  "maas.opendatahub.io/gateway-access-${TENANT_NAME}=true" --overwrite

# every model namespace this tenant should serve from
oc label namespace <model_namespace> \
  "maas.opendatahub.io/gateway-access-${TENANT_NAME}=true" --overwrite

Step 2: Create the dedicated Gateway. The two annotations are required - opendatahub.io/managed: "false" keeps the ODH model controller from overriding MaaS policies, and the TLS bootstrap annotation enables Gateway-to-Authorino TLS (same pattern as Phase 2). The heredoc expands the variables from Step 1:

cat <<EOF | oc apply -f -
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: ${TENANT_NAME}
  namespace: openshift-ingress
  annotations:
    opendatahub.io/managed: "false"
    security.opendatahub.io/authorino-tls-bootstrap: "true"
spec:
  gatewayClassName: openshift-default
  listeners:
    - name: https
      hostname: "${GATEWAY_HOSTNAME}"
      port: 443
      protocol: HTTPS
      allowedRoutes:
        namespaces:
          from: Selector
          selector:
            matchLabels:
              maas.opendatahub.io/gateway-access-${TENANT_NAME}: "true"
      tls:
        mode: Terminate
        certificateRefs:
          - group: ""
            kind: Secret
            name: ${CERT_NAME}
EOF
Note

On non-cloud platforms (baremetal, SNO, OpenStack) the same LoadBalancer considerations as in Phase 2 apply: each additional Gateway needs its own external IP from MetalLB (extend the IPAddressPool), or a passthrough/reencrypt Route through the OpenShift router. Check whether the Gateway controller auto-provisioned a Route (oc get route -n openshift-ingress -l gateway.networking.k8s.io/gateway-name=<tenant-name>) and create one manually if not.

Step 3: Create the AITenant. It must live in the ai-tenants management namespace - the admission webhook rejects any other namespace:

cat <<EOF | oc apply -f -
apiVersion: maas.opendatahub.io/v1alpha1
kind: AITenant
metadata:
  name: ${TENANT_NAME}
  namespace: ai-tenants
spec:
  gateway:
    name: ${TENANT_NAME}
  # optional - per-tenant identity provider (BYOIDP), see Phase 9 for the Keycloak setup
  # oidc:
  #   issuerUrl: "https://<oidc_provider>/realms/<tenant_realm>"
  #   clientId: <client_id>
  #   ttl: 300
EOF

Step 4: Wait for the tenant to become Ready and verify the bootstrap:

oc get aitenant ${TENANT_NAME} -n ai-tenants -w

# tenant namespace, config, and per-tenant maas-api
oc get namespace ai-tenant-${TENANT_NAME}
oc get maastenantconfig default-tenant -n ai-tenant-${TENANT_NAME}
oc get deployment maas-api-${TENANT_NAME} -n redhat-ai-gateway-infra

# tenant endpoint answers with tenant-scoped models
curl -sk "https://${GATEWAY_HOSTNAME}/v1/models" \
  -H "Authorization: Bearer $(oc whoami -t)" | jq .

Step 5: Grant tenant admins access by binding the controller-created Roles (the spec.rbac field on AITenant is deprecated and ignored):

oc create rolebinding finance-tenant-admins \
  -n ai-tenant-${TENANT_NAME} \
  --role=aitenant-${TENANT_NAME}-tenant-admin \
  --group=finance-admins

From there, the tenant admin creates MaaSSubscription and MaaSAuthPolicy resources in the tenant namespace exactly as in Phase 5, and users mint API keys against the tenant’s own gateway hostname.

Deleting a Tenant

Delete the AITenant CR. The controller revokes the tenant’s API keys, removes the per-tenant maas-api, releases the Gateway claim, and deletes the controller-owned Roles and RoleBindings. User-created RoleBindings are preserved - review and remove stale ones before re-creating a tenant with the same name, or former admins regain access.

Quick Answers

QuestionAnswer
Can we run a MaaS per namespace in the same cluster?You run one MaaS platform with multiple isolated tenants. Each tenant maps to a dedicated gateway + tenant namespace + labeled model namespaces, not to an arbitrary namespace.
Multiple MaaS instances then?No - multiple tenants. One controller, one database, one serving infrastructure. The per-tenant pieces are the gateway, identity realm, namespace, maas-api instance, and policies.
Are the API keys separated?Logically yes, physically no. All keys live in the shared PostgreSQL database (as salted hashes with tenant metadata, see API Key Security), and every validation is tenant-scoped: a tenant A key gets 404 on tenant B’s gateway.
Can each tenant bring its own IdP?Yes - spec.oidc on the AITenant points that tenant at its own issuer. Without it, the tenant uses OpenShift TokenReview.
Are external models per tenant?No - ExternalModel works only in the default tenant in 3.5 (Technology Preview limitation).
Is there network isolation between tenants?Not from MaaS itself - isolation is at the gateway/identity/RBAC layer. Add NetworkPolicies or UDN separately if you need network-level separation.

References