Deploying on-prem Kong AI Gateway 2.x with Kong Operator is in Tech Preview. Running Kong AI Gateway with an OnPremAIGateway control plane is not supported for production use, and its resources and behavior may change between releases. It requires Kong Operator 2.4.0-rapid.3.0 or later and a Kong Gateway Enterprise license.
An OnPremAIGateway replaces the Konnect-hosted control plane with one that runs inside Kong Operator. It doesn’t create a Deployment or Pods of its own. For each OnPremAIGateway, Kong Operator runs a control plane instance that:
- Watches the AI Gateway configuration resources whose
spec.aiGatewayRef points at the OnPremAIGateway, and the Secrets they reference.
- Translates them into AI Gateway configuration.
- Pushes that configuration to the Admin API of every
AIGatewayDataPlane attached to the OnPremAIGateway.
Nothing is sent to Konnect, so Konnect features such as analytics and the Konnect UI aren’t available. To follow the getting started series with an on-premises control plane, see Install Kong Operator for Kong AI Gateway.
The OnPremAIGateway controller is disabled by default. Enable it alongside the AIGatewayDataPlane controller when installing Kong Operator:
--set env.ENABLE_CONTROLLER_AIGATEWAYDATAPLANE=true \
--set env.ENABLE_CONTROLLER_ONPREMAIGATEWAY=true
Apply a KongLicense to the cluster. Kong Operator injects the license into every AIGatewayDataPlane that references an OnPremAIGateway, and reports it in a LicenseValid condition on both resources. A missing license doesn’t block Ready: the data plane runs without a license and reports LicenseValid=False.
A configuration resource must set both group and kind in spec.aiGatewayRef:
spec:
aiGatewayRef:
group: aigateway.konghq.com
kind: OnPremAIGateway
namespacedRef:
name: my-ai-gateway-cp
When group and kind are omitted, the reference defaults to group: konnect.konghq.com and kind: KonnectAIGateway. The API server accepts the resource, but no on-premises control plane picks it up: it never gets a status, and its configuration is never pushed. Check kubectl get <resource> -o jsonpath='{.spec.aiGatewayRef.kind}' if a resource has no Programmed condition at all.
You can’t change kind on an existing resource to move it between a KonnectAIGateway and an OnPremAIGateway. Delete and recreate it instead.
An AIGatewayDataPlane attaches to an OnPremAIGateway with spec.controlPlaneRef.type: onpremNamespacedRef:
spec:
controlPlaneRef:
type: onpremNamespacedRef
onpremNamespacedRef:
name: my-ai-gateway-cp
For an on-premises data plane, Kong Operator creates a ClusterIP Service named <data-plane-name>-admin on port 8444, and a TLS certificate for it. The control plane instance pushes configuration to the data plane’s Admin API through this Service using mTLS. The AIGatewayDataPlane reports the certificate in an AdminCertificateProvisioned condition. You don’t need to expose this Service outside the cluster.
Deploy at least one AIGatewayDataPlane before you wait on configuration resources. Until a data plane is running, configuration resources report Programmed=False with the message no Admin API endpoints discovered; configuration not pushed. Once a data plane is Ready, pending configuration is pushed and the resources become Programmed without any further action.
All spec fields are optional. An empty spec watches only the OnPremAIGateway’s own namespace and uses the operator’s default sync settings.
|
Field
|
Description
|
spec.watchNamespaces.type
|
own (default) watches only the OnPremAIGateway’s namespace. list also watches the namespaces in spec.watchNamespaces.list. all watches every namespace, and requires Kong Operator to run cluster-wide, with an empty --watch-namespaces. Changing this field restarts the control plane instance.
|
spec.dataplaneSync.intervalSeconds
|
Seconds between two rounds of pushing configuration to the data planes. When unset, the operator default is used.
|
spec.dataplaneSync.timeoutSeconds
|
Timeout of a single push, in seconds. When unset, no timeout is applied.
|
spec.objectFilters.secrets.matchLabels
|
Additional labels a Secret must carry for this gateway to read it. They’re combined with the operator’s own Secret label selector, konghq.com/secret=true by default.
|
To keep configuration resources in a different namespace from the OnPremAIGateway, list the namespace in spec.watchNamespaces, and create a WatchNamespaceGrant in that namespace allowing the OnPremAIGateway’s namespace to watch it:
apiVersion: aigateway.konghq.com/v1alpha1
kind: OnPremAIGateway
metadata:
name: my-ai-gateway-cp
namespace: kong
spec:
watchNamespaces:
type: list
list:
- ai-team-a
---
apiVersion: gateway-operator.konghq.com/v1alpha1
kind: WatchNamespaceGrant
metadata:
name: my-ai-gateway-cp
namespace: ai-team-a
spec:
from:
- group: aigateway.konghq.com
kind: OnPremAIGateway
namespace: kong
Resources are in ai-team-a, then set spec.aiGatewayRef.namespacedRef.namespace: kong. Without the grant, the OnPremAIGateway reports WatchNamespaceGrantValid=False and Ready=False, and its control plane instance doesn’t run.
OnPremAIGateway reports these conditions:
|
Condition
|
Meaning
|
Ready
|
The control plane instance is running and all configuration was translated. Wait on this condition rather than Programmed, which KonnectAIGateway uses.
|
LicenseValid
|
A KongLicense was found and applied.
|
OptionsValid
|
The spec is compatible with how Kong Operator is configured, for example its watched namespaces and Secret label selector.
|
WatchNamespaceGrantValid
|
Every namespace in spec.watchNamespaces.list has a matching WatchNamespaceGrant.
|
ConfigurationTranslated
|
All configuration resources were translated. On failure, the message names the resource that failed.
|
DataPlanesConfigured
|
Configuration was pushed to the data planes. The message reports the number of Admin API endpoints, one per data plane replica.
|
Configuration resources report a Programmed condition, as they do with Konnect. Their ID and ORGID columns stay empty because they’re never created in Konnect.
The following behavior was observed with Kong Operator 2.4.0-rapid.3.0 and may change:
- A single invalid resource marks the whole gateway as not ready. For example, an
AIGatewayModelProvider that references a missing Secret sets ConfigurationTranslated=False and Ready=False on the OnPremAIGateway. The invalid resource is left out, and the rest of the configuration is still pushed to the data planes, so traffic for other AI Models keeps working.
- Configuration is pushed, not pulled, so new data plane Pods depend on Kong Operator. Running data plane Pods keep serving their last pushed configuration if Kong Operator becomes unavailable. A data plane Pod that starts while Kong Operator is unavailable has no configuration, isn’t ready, and doesn’t receive traffic until Kong Operator recovers and pushes configuration to it. To work around this issue, run more than one data plane replica, and avoid restarting data planes and Kong Operator at the same time.