Operate self-managed Context Gateway
Check health, rotate credentials and encryption keys, monitor the cache and the Gateway database, back up, upgrade, and uninstall Context Gateway.
Check service health
Both planes serve /health/liveness and /health/readiness without a credential. The Control Plane's readiness answers 503 while the admin or internal token cannot be read or is empty, or the license is not valid. The Data Plane's readiness does not check its token or the license. An invalid license stops either plane at startup. The response does not name the failed check, so read the plane's logs.
With the ports forwarded as in Deploy:
curl -sS http://localhost:9100/health/readiness
curl -sS http://localhost:8083/health/readiness
The public service probes are also available at /iris/v1/context-gateway/health/live and /ready on the Control Plane, and /iris/data/v1/context-gateway/health/live and /ready on the Data Plane. They require no credential. The operational /health/* probes remain available.
iris context-gateway health probes the Control Plane, and probes the Data Plane only when given --url or a Gateway ID. iris context-gateway service diagnose <gateway-id> reports a Gateway's setup, including Upstreams with empty catalogs.
Rotate credentials
| Credential | How to rotate |
|---|---|
| Upstream credential | Update the Upstream with a new value through the Control Plane. After an in-place rotation in Vault or AWS Secrets Manager, refresh the Upstream's catalog so cached results stop being served. |
| Agent key | Rotate or revoke it through the Identity Service. See Rotate or revoke agent keys. A revoked key stops working within 300 seconds by default. |
| Admin token, internal token | Change iris-context-gateway-admin-token in place. For the internal token, change iris-context-gateway-internal-token, or key context-gateway in iris-internal-tokens (the Secret global.iris.secrets.controlplaneInternalTokens.existingSecret names) after a credential handover. The Control Plane rereads the file, so no restart is needed, and the Identity Service mounts the same Secret. |
| Runtime token | Change iris-context-gateway-dataplane-credential in place, or key context-gateway-dp in iris-dataplane-credentials (the Secret global.iris.secrets.dataplaneServiceCredentials.existingSecret names) after a credential handover. The Identity Service mounts the same Secret, and the Data Plane rereads it on its next key check. |
| Metadata, credential, and registered database URLs, Vault tokens | Replace the Secret, then restart the planes that read it. |
Set a file reference's checksum under contextGateway:, then upgrade the release, to roll out the planes predictably after any file change.
Rotate the encryption keyring
The keyring is loaded at startup, so each step needs a rollout of both planes:
- Add
k2to the keyring and tocontextGateway.credentialStorage.redis.keyFiles, and keepk1active. ChangecontextGateway.credentialStorage.redis.keyring.checksumand upgrade. Both planes can now read either key. - Set
contextGateway.credentialStorage.redis.activeKeyId: k2and upgrade. New credential writes usek2, and existing credentials still open withk1. - Rewrite the remaining credentials through the Control Plane. Keep
k1until you can prove nothing uses it, including rollbacks and retained backups.
Monitor the cache
A cache hit carries cache in the call's invocation metadata. Every other outcome shows only in metrics and traces. iris_context_gateway_cache_lookups_total counts lookups by outcome (hit, miss, bypass, error) and reason:
Bypass reason |
What to check |
|---|---|
not_opted_in |
The tool has no cache policy. |
disabled |
The Gateway's cache setting is DISABLED. |
no_database |
The Gateway has no databaseId. |
unknown_database |
The Gateway's database is not registered on the Data Plane. Declare it on both planes. |
vetoed_by_annotation |
The tool's definition says it is not read-only, or that it is destructive. |
caller_credentials |
The Upstream's credential could depend on the caller. |
uncanonical_arguments |
The arguments repeat a member, are not valid UTF-8, or nest too deep. |
unreadable_policy |
The Data Plane is older than the release that wrote the policy. Upgrade it. |
Error reason |
What to check |
|---|---|
lookup_timeout |
The Gateway database answered slower than cache.lookup_timeout. Check its latency and load. |
lookup_failed |
The Gateway database is down, unreachable, or refuses the Data Plane's user. |
unusable_entry |
The entry was written by a newer release. The call's own write replaces it. |
A call whose lookup fails is served from the Upstream. Monitor iris_context_gateway_cache_writes_total for out_of_memory and failed. Cache write failures do not turn a successful tool result into a failed call. Repeated failures need a database capacity or connectivity investigation.
Watch the Gateway database
When compression is on, alert on iris_context_gateway_compression_creates_total{outcome="out_of_memory"}. It means Redis refused a handle write at maxmemory, which happens under noeviction or when Redis can't evict enough keys with a TTL. Automatic capture returns the result inline, but an explicit run_tool_as_handle request returns a tool error when it cannot hold the result. Raise maxmemory, shorten the handle lifetime, release unneeded handles, or move result storage to a dedicated database.
The eviction_policy outcome means the database's policy is neither a volatile-* policy nor noeviction, or isn't reported, so no handle is created. Handle creation also requires JSON support. See Gateway database requirements.
A partial Surface handle can also mean that paging reached a row, byte, time, or concurrency limit. Check its warning before increasing limits. The stored count describes only the captured records.
Update configuration Secrets
Replace the Secret, then roll out both planes. Set checksum on a file reference to trigger the rollout automatically.
Back up the deployment
Back up Metadata Redis and credential storage together. A Gateway record without its credentials cannot call its Upstreams. Keep every encryption key that a backed-up credential needs.
Upgrade
Context Gateway upgrades with the suite release, as Upgrade describes. Upgrade to 1.1.1 from the latest 1.0 patch, 1.0.1: the chart refuses an upgrade that skips a minor version. Roll forward, not back. An older Data Plane cannot read tool policy members that a newer Control Plane wrote, and serves those tools uncached. helm rollback restores the release's Kubernetes resources only. It does not undo database writes or restore external Secrets.
Upgrade from 1.0
The Gateway database no longer needs noeviction, and Redis enforces its memory limit:
- If your
1.0release generated its credentials (global.iris.secrets.generate: true, the default), hand them over first. With generation on, the1.1.1upgrade fails because the Secrets it expects to generate already exist. The handover switches toglobal.iris.secrets.generate: falseand keeps the existinggateway-keyring, so stored Upstream credentials stay readable. - Remove
dataplane.config.cache.max_memory_shareanddataplane.config.compression.max_memory_sharefrom your values. Both are ignored, and the upgrade prints a warning while either is set. - Upgrade the release with your values and
handover-values.yaml. - On the Gateway database, run
CONFIG SET maxmemory <bytes>andCONFIG SET maxmemory-policy volatile-ttl, and set both inredis.conf. On Redis Software or Redis Cloud, set the eviction policy in the admin console or API. - Alert on
out_of_memoryiniris_context_gateway_cache_writes_totalandiris_context_gateway_compression_creates_total. Theskipped_low_memoryoutcome is gone.
Move semantic search settings from context_surface.embedding to inference.models and embedders_connection_details, as in Context Surface databases. The old block still loads, with a deprecation warning.
contextGateway.credentialStorage.redis.keyring.existingSecret now defaults to gateway-keyring. A keyring delivered by a Secrets Store CSI Driver class needs contextGateway.credentialStorage.redis.keyring.existingSecret: "" before you upgrade, or the render fails.
Reinstall over a preview Gateway database
When you move from a preview chart against the same databases, these changes apply. Chart 1.0.0 renamed the dataplane.config blocks result_cache to cache and result_handles to compression. Every nested key keeps its name. Move these settings before you upgrade: the values schema rejects the old blocks, and a Data Plane ignores them. Upgrade the chart and images together, because an older image ignores the new keys and leaves both features off. The same release renamed the Gateway fields resultCache and resultHandles to cache and compression. Gateways stored under the old names lose their settings and tool policies, so set them again.
After an upgrade, refresh an Upstream's catalog when the release notes ask for it.
Update API clients to the unified /iris/v1/context-gateway routes and uppercase API values such as ENABLED, DISABLED, FULL, and SEARCH. Tool names use namespace__tool, and namespaces are limited to 32 characters. Use discovered tool names unchanged.
Update dashboards and alerts to the iris_context_gateway_* metrics. The previous metric names have no aliases. Review database updates and tool policies in Turn the cache and compression on or off.
If MCP sign-in uses the shared api://redis-iris audience, the upgraded Data Plane refuses to start. Move it to an API of its own first, as Upgrade from the shared audience describes.
Remove or uninstall
To remove Context Gateway and its data, see Remove a service permanently. To remove the whole suite, see Uninstall.
Uninstall removes the planes only. Redis databases, Secrets, Container Storage Interface (CSI) provider classes, Upstream credentials, and Gateway records stay. To remove Gateways and their credentials, delete them through the Control Plane before you uninstall.