Configure self-managed Context Gateway
Prepare Helm values, file references, credential storage, the database registry, Context Surface databases, and optional features for Context Gateway.
Context Gateway reads non-secret settings from Helm values and every credential from a mounted file. Every value on this page sits under the contextGateway: key of the suite's iris-values.yaml. The suite sets the tenant, license, tokens, CA bundle, and Identity Service connection from global.iris. Prepare the values and the Secrets they reference before you deploy.
Helm values
| Value | Purpose |
|---|---|
publicBaseURL |
The Data Plane's public origin, used in every Gateway's mcpEndpoint. |
dataplane.ingress |
An optional Ingress for the Data Plane, off by default. When on, hosts must include the publicBaseURL host and route / with pathType: Prefix, annotations must not rewrite paths, and for an https:// origin a tls entry with a secretName must cover that host. Otherwise rendering fails. |
profile |
prod (default) or dev logging. |
imagePullSecrets |
Credentials for a private registry. |
controlplane.config, dataplane.config |
Application settings for each plane. They default to {}, so the image's defaults apply. |
Start with the complete deployment values example, then apply the settings you need from this page.
File references
Each credential has its own reference. Point it at a Kubernetes Secret key with existingSecret and secretKey, or at a Secrets Store CSI (Container Storage Interface) Driver file with secretProviderClass and fileName. Change a reference's optional checksum to roll out both planes after the file changes.
| Helm reference | File contents | Used by |
|---|---|---|
metadataDB |
YAML with metadata_db.urls. |
Both planes |
credentialStorage.redis.connection |
YAML with credential_storage.redis.urls. |
Both planes |
credentialStorage.redis.keyring |
Directory of base64-encoded 32-byte Advanced Encryption Standard (AES) keys. | Both planes |
credentialStorage.vault.credentials.controlplane |
YAML with credential_storage.vault.token, with write and delete access. |
Control Plane |
credentialStorage.vault.credentials.dataplane |
YAML with credential_storage.vault.token, with read access. |
Data Plane |
databaseConnections[] |
YAML with databases.<id>.urls. |
Both planes |
The suite supplies the admin, internal, and runtime tokens from its generated credentials, the license from global.iris.license, and the certificate authority (CA) bundle from global.tls.caCertSecret. Keep the Vault writer token out of every CSI class the Data Plane mounts.
Credential storage
credentialStorage.provider |
Configuration |
|---|---|
redis (default) |
A credential Redis connection and a keyring shared by both planes. credentialStorage.redis.keyFiles maps each key ID to a file in the keyring, and activeKeyId names the key for new writes. |
vault |
Separate writer and reader tokens for the Control Plane and Data Plane. |
aws_secrets_manager |
Separate Identity and Access Management (IAM) roles for each plane through workload identity. |
Database registry
Register every database a Gateway uses under the same ID on both planes: Context Surface databases and Gateway databases. Put display names in shared.config.databases and connection URLs in a databaseConnections file.
shared:
config:
databases:
clinics: {name: Clinic directory}
results: {name: Gateway database}
databaseConnections:
- existingSecret: gateway-database-connections
secretKey: config.yaml
Both planes probe every entry at startup. An entry that does not answer does not stop a plane. The plane logs Gateway database did not answer at startup with the entry's database_id and starts.
Default databases
An on-prem deployment uses two databases from the registry, and each has its own job:
| Database | Holds | Written by |
|---|---|---|
| Gateway database | Cached results and compression handles. | Only the Gateway. |
| Surface database | The customer data that Context Surfaces read. | Never the Gateway. |
Name a default for each so that administrators do not repeat the ID on every request. Both defaults are optional, and both planes read them:
shared:
config:
databases:
gateway-db: {name: Gateway database}
surface-db: {name: Surface database}
databaseConnections:
- existingSecret: gateway-database-connections
secretKey: config.yaml
defaultDatabases:
gatewayDb: gateway-db
surfaceDb: surface-db
The chart renders these as default_databases.gateway and default_databases.surface in the shared configuration. Each must name a databases entry, or both planes refuse to start.
| Value | Used when | Without it |
|---|---|---|
defaultDatabases.gatewayDb |
A Gateway create sends no databaseId. The response's databaseBinding.databaseId shows the resolved database, and cache and compression default to ENABLED as if you had sent it. An explicit databaseId always wins. |
A Gateway created without databaseId has no database, so the cache and compression are off. |
defaultDatabases.surfaceDb |
A Context Surface create sends no contextSurface.databaseId. An explicit ID always wins. |
That create returns 400 on contextSurface.databaseId. |
Redis Cloud has no defaults and always requires the database ID.
Gateway database requirements
Give the Gateway database a finite maxmemory and maxmemory-policy volatile-ttl. Compression also needs the JSON module. Redis enforces the memory limit: a volatile-* policy evicts only keys with a time to live (TTL), and every cache entry and handle has one. The checks differ by where they run:
- At startup, the Data Plane checks the default Gateway database. With
compression.enabled: trueit fails to start when the database has no JSON module, or its eviction policy is not avolatile-*policy ornoeviction. A policy the database doesn't report fails too. Otherwise it logs a warning. An unreachable default Gateway database only logs a warning at startup. - When you turn compression on through the API, the Control Plane checks the Gateway database. The request returns
400on thecompressionfield, with anerrors[]entry whosepointeris/compressionand whosedetailexplains the problem when the database cannot hold handles, and503when it cannot be reached. The same check runs when an update changesdatabaseIdwhile compression staysENABLED. - A Gateway create that omits
compressionnever fails on this check. When the database cannot hold handles or cannot be reached, the Gateway is stored withcompressionset toDISABLED, and the Control Plane logs why.
noeviction and a maxmemory of 0 still work, including for compression, and log a deprecation warning. A later release refuses them. Redis Software and Redis Cloud enforce their own memory limit and don't report maxmemory, so they get no warning. They refuse CONFIG SET, so set their eviction policy in the admin console or API. The cache accepts any policy, and logs a warning when an allkeys-* policy could evict keys without a TTL.
Size the Gateway database for the rate of stored results, their stored size, and their TTL. Compression ratios vary with the result, so measure stored bytes for your workload rather than assuming a fixed ratio. Account for cache entries and handles separately.
Under a volatile-* policy, Redis can evict a cache entry or a handle before its TTL. An evicted cache entry is a miss, and an evicted handle reads as expired. Under noeviction, a full database refuses new writes: the cache serves the Upstream result without storing a new entry, automatic handle capture returns the result inline, and an explicit run_tool_as_handle request returns a tool error instead of the whole result. Release handles you no longer need, shorten TTLs, or increase database capacity. See Tool call failures.
cache.max_memory_share and compression.max_memory_share are deprecated and ignored. Remove them: helm install and helm upgrade print a warning while either is set, and the Data Plane logs one at startup.
Do not point both defaults at the same Redis when compression is on. The Gateway database's maxmemory and eviction policy would then apply to your customer data. The Data Plane logs a warning at startup when the two defaults share an endpoint.
For how to size the Gateway database and the Redis versions it needs, see Redis databases.
Context Surface databases
A Context Surface stores only its database ID. Give each plane its own Redis user on the database, as listed in Redis users for Surface databases. The databaseConnections registry is shared by both planes, so supply each plane's URL for that database ID through an overlay. Put the Control Plane's login in a controlplane.overlays Secret and the Data Plane's login in a dataplane.overlays Secret. Overlays load last and override the registry's connection settings:
databases:
clinics:
urls:
- rediss://<plane-user>:<password>@<host>:<port>
Reference each Secret from controlplane.overlays or dataplane.overlays with existingSecret and secretKey, as in the embedding example below. To change a password, update the Secret and restart both planes.
Semantic and hybrid search tools embed the agent's text before they search. Configure the embedding models under inference.models and their provider connections under embedders_connection_details, in a mounted Data Plane overlay. Save a restricted local file named embedding-secret.yaml:
inference:
models:
- provider: openai
model: text-embedding-3-small
embedders_connection_details:
openai:
protocol: openai
base_url: https://api.openai.com/v1
credentials:
type: static
api_key: <embedding-provider-api-key>
Each provider names an embedders_connection_details entry. List every model your Surface indexes record as their embedding_model. protocol is openai (also for OpenAI-compatible endpoints), cohere, vertex-ai, or oip for self-hosted embedders. credentials.type is static with an api_key, none for a keyless self-hosted embedder, or gcp-service-account for vertex-ai. Create a Secret from that file:
kubectl -n <namespace-name> create secret generic gateway-embedding --from-file=config.yaml=embedding-secret.yaml
Reference it in your Helm values:
dataplane:
overlays:
- existingSecret: gateway-embedding
secretKey: config.yaml
Keep the real key out of iris-values.yaml and source control. The overlay contains application settings at the top level, without a Helm dataplane.config wrapper. Set the entry's checksum so that a changed key rolls out both Data Plane pods.
The earlier context_surface.embedding block still loads, with a deprecation warning, and a later release refuses it. Move its settings to inference.models and embedders_connection_details.
Without an embedding service, every other tool still works, and semantic or hybrid search calls fail with embedding_unavailable. A call fails with embedding_model_unsupported when the Surface's data model records an embedding_model that the Data Plane has no embedder for. The embedding client ignores proxy variables and dials the endpoint directly, and with an API key set every endpoint must use HTTPS.
The Data Plane keeps at most two clients for each Surface database. Each client's pool, context_surface.client_pool.client.pool_size, defaults to 8 connections. The Gateway database pool for the cache and handles, client_pool.client.pool_size, also defaults to 8. Both accept 0 to 1024 and go under dataplane.config. Budget up to 2 × pool_size × peak Data Plane replicas connections for each Surface database, per node on a Redis Cluster. The iris.context_gateway.redis_pool.* gauges report each pool's clients and connections, with the pool label set to cache_handles or surface.
Cache and compression
Both features are off by default. Turn them on in the Data Plane configuration:
dataplane:
config:
cache:
enabled: true
compression:
enabled: true
ttl: 15m
| Setting | Default | Meaning |
|---|---|---|
cache.max_entry_bytes |
262144 |
The largest result the cache stores, in bytes. |
compression.ttl |
15m |
How long a handle lives. At most 24h. A tool policy can override it. |
compression.inline_max_bytes |
32768 |
Results above this size become handles. |
compression.max_capture_bytes |
8388608 |
Maximum captured result size in bytes. Automatic capture can return oversized results inline. Explicit capture fails if no handle can be stored. |
compression.preview_items, compression.preview_bytes |
3, 2048 |
The size of a handle stub's preview. |
compression.max_surface_items |
10000 |
Maximum records collected for a Surface handle. |
compression.max_paged_capture_bytes_in_flight |
67108864 |
Per-process byte budget for Surface pages being collected across captures. |
compression.max_concurrent_paged_captures |
4 |
Maximum captures collecting Surface continuation pages at once per process. |
compression.paged_capture_wait |
2s |
Maximum wait for a paging slot. |
compression.paged_capture_time_budget |
2s |
Total paging budget, including the wait for a slot. The request deadline can shorten it. |
These settings turn each feature on for the deployment. Each Gateway then has its own cache and compression settings, and a feature serves a Gateway only when both the deployment and the Gateway turn it on. Both need the Gateway to have a database, from its databaseId or from the default Gateway database.
The cache still needs a policy for each tool. Compression applies to every eligible result on a Gateway that has it on, unless a tool's policy opts out. See Turn the cache and compression on or off.
An explicit run_tool_as_handle request on a Surface filter or text query collects continuation pages into the handle. Capture stops at the row, byte, time, or concurrency limit and returns a partial handle when it has a storable partial result. Read its warning before treating its count as the complete query count. Automatic capture holds only the page the tool returned, and count_results or aggregate_results on such a handle returns a tool error. A page with more rows than compression.max_surface_items that can't be cut to that limit is returned whole, with the skipped_item_cap outcome. Semantic and hybrid top-K queries are not continued. See Compression.
Bound Data Plane memory
Set dataplane.resources.limits.memory for each pod. At startup, dataplane.config.memory_limit_ratio sets the Go runtime's soft memory limit to that fraction of the container limit. The default is 0.7. An explicit GOMEMLIMIT environment value takes precedence. Without a container memory limit, the automatic setting does not apply. This soft limit leaves room for memory outside the Go heap and does not replace the container limit.
Cache metadata resolutions
The metadata resolution cache is off by default. Enable it only after every Control Plane instance supports invalidating Gateway resolutions after Upstream mutation attempts. Roll out all writers first. Credentials and caller permissions are still checked on every invocation.
dataplane:
config:
metadata_cache:
resolution:
enabled: true
max_age: 30s
max_age defaults to 30s and must be positive. It bounds stale resolutions when invalidation fails. Keep this configuration under dataplane.config, not shared.config.
Redis client certificates
For a Redis Enterprise database that requires a client certificate (mutual Transport Layer Security (TLS)), create a Secret with the keys tls.crt and tls.key, and set redisClientTLS.existingSecret. Every rediss:// connection of both planes presents it. redisClientTLS.extraCertificates adds a certificate for one connection: each entry's name and existingSecret mount it at /etc/redis-client-tls/<name>/, and the connection's tls block names it with cert_path and key_path.
contextGateway:
redisClientTLS:
existingSecret: gateway-redis-client
For certificate-only login, use a rediss:// URL with no user name or password. Certificate-only login needs Redis Enterprise 7.8.4 or later, and a database user configured for certificate authentication. Trust the server's CA with global.tls.caCertSecret.
A renewed certificate needs no restart. After you update the Secret, Kubernetes updates the mounted files, usually within a minute or two. Each process checks the files about every 30 seconds, and its next TLS handshake after a check uses the new certificate. Open connections keep the certificate they were opened with.
Multi-tenant mode
By default a release serves one tenant, global.iris.tenantId. To serve more than one, set global.iris.auth.oidc.tenantIdClaim to the identity provider (IdP) access token claim that names each user's tenant, and don't set global.iris.tenantId. The chart also requires global.iris.auth.oidc.issuer and global.iris.auth.oidc.jwksURI with tenantIdClaim, because only an IdP token can name its tenant. Setting the claim alone fails the render:
global:
iris:
auth:
oidc:
issuer: https://<idp-host>/<issuer-path>
jwksURI: https://<idp-host>/<jwks-path>
tenantIdClaim: <tenant-claim>
If you turn on identity provider sign-in for MCP clients, also set dataplane.config.auth.oidc.tenant_id_claim. In this mode:
- Each caller keeps the tenant of its credential: the tenant claim of an IdP token, or the tenant of an agent key's grants. A Gateway of another tenant returns
404. - All tenants share the database registry. Register only databases that every tenant can use.
- The Control Plane refuses the admin token, because the token has no tenant. Use an IdP access token with the tenant claim. Health and readiness still answer.
Trust a private CA
Set global.tls.caCertSecret to a Secret with the PEM bundle under the key ca.crt. Restart both planes after you rotate a certificate.
Configure metrics and tracing
Both planes serve Prometheus metrics at /metrics. Set shared.config.opentelemetry.enable_tracing: true and an OpenTelemetry Protocol (OTLP) endpoint for traces.
Scale and schedule the planes
The suite runs two Data Plane replicas and one Control Plane replica, and fixes the rollout strategy and PodDisruptionBudgets. See Availability. Set replicaCount, or turn on autoscaling, with resources, nodeSelector, tolerations, and affinity under controlplane and dataplane. Autoscaling is off by default, needs Metrics Server, and needs resources.requests.cpu or resources.requests.memory for each target it uses. Leave headroom for old and new pods during upgrades.
The startupProbe, livenessProbe, and readinessProbe of each plane use /health/liveness and /health/readiness by default, and accept native Kubernetes probe fields. Set a probe to null to turn it off. The default startup probe allows 150 seconds before liveness checks begin.