From 8c7e4266877bf688ebdd70b746316137f1804e92 Mon Sep 17 00:00:00 2001 From: Kaushal Kahapola <129000208+kaushalkahapola@users.noreply.github.com> Date: Wed, 19 Aug 2026 16:56:21 +0530 Subject: [PATCH 1/3] Revise Kubernetes standalone deployment documentation Updated the documentation for deploying an OpenAI LLM provider in Kubernetes. Revised sections for API creation, invocation, and health checks. --- .../kubernetes/kubernetes-standalone.md | 84 ++++++++++--------- 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/en/docs/ai-gateway/1.2.0/deployment/deployment-modes/kubernetes/kubernetes-standalone.md b/en/docs/ai-gateway/1.2.0/deployment/deployment-modes/kubernetes/kubernetes-standalone.md index 6b517e668f..3784a37a0c 100644 --- a/en/docs/ai-gateway/1.2.0/deployment/deployment-modes/kubernetes/kubernetes-standalone.md +++ b/en/docs/ai-gateway/1.2.0/deployment/deployment-modes/kubernetes/kubernetes-standalone.md @@ -5,9 +5,9 @@ canonical_url: https://wso2.com/api-platform/docs/ai-gateway/deployment/deployme md_url: https://wso2.com/api-platform/docs/ai-gateway/deployment/deployment-modes/kubernetes/kubernetes-standalone.md tags: - ai-gateway - - kubernetes - - deployment -author: WSO2 API Platform Documentation Team + - kubernetes + - deployment + author: WSO2 API Platform Documentation Team last_updated: 2026-08-07 content_type: "how-to" --- @@ -231,7 +231,7 @@ helm install ap-gateway oci://ghcr.io/wso2/api-platform/helm-charts/gateway \ --set gateway.controller.upstreamCerts.secretName=upstream-ca-certs ``` -## Create and Invoke API +## Create and Invoke an LLM Provider ### Port-forward Gateway Controller Service @@ -241,10 +241,10 @@ kubectl port-forward svc/ap-gateway-controller 9090:9090 ### Verify gateway controller admin endpoint is running ```bash -curl http://localhost:9094/api/admin/v0.9/health +curl http://localhost:9094/api/admin/v1/health ``` -### Deploy an API configuration +### Deploy an LLM provider configuration The management API uses basic auth with the credentials from your Helm values (`controller.auth.basic.users`; the chart default is `admin` / `admin`). Export them, changing them if @@ -255,55 +255,61 @@ export ADMIN_USERNAME=admin export ADMIN_PASSWORD=admin ``` +The gateway includes first-class support for the OpenAI LLM provider. Replace `` with your +OpenAI API key and run the following command to deploy a sample OpenAI LLM provider: + ```bash -curl -X POST http://localhost:9090/api/management/v1/rest-apis \ +curl -X POST http://localhost:9090/api/management/v1/llm-providers \ -u "$ADMIN_USERNAME:$ADMIN_PASSWORD" \ -H "Content-Type: application/yaml" \ --data-binary @- <<'EOF' apiVersion: gateway.api-platform.wso2.com/v1 -kind: RestApi +kind: LlmProvider metadata: - name: reading-list-api-v1.0 + name: openai-provider spec: - displayName: Reading-List-API + displayName: OpenAI Provider version: v1.0 - context: /reading-list/$version + template: openai + context: /openai/latest upstream: - main: - url: https://apis.bijira.dev/samples/reading-list-api-service/v1.0 - policies: - - name: set-headers - version: v1 - params: - request: - headers: - - name: x-wso2-apip-gateway-version - value: v1.0.0 - response: - headers: - - name: x-environment - value: development - operations: - - method: GET - path: /books - - method: POST - path: /books - - method: GET - path: /books/{id} - - method: PUT - path: /books/{id} - - method: DELETE - path: /books/{id} + url: https://api.openai.com/v1 + auth: + type: api-key + header: Authorization + value: + accessControl: + mode: deny_all + exceptions: + - path: /chat/completions + methods: [POST] + - path: /models + methods: [GET] + - path: /models/{modelId} + methods: [GET] EOF ``` ### Test routing through the gateway ```bash -curl http://localhost:8080/reading-list/v1.0/books -curl -k https://localhost:8443/reading-list/v1.0/books +curl -X POST https://localhost:8443/openai/latest/chat/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "gpt-4o-mini", + "messages": [ + { + "role": "user", + "content": "Hi" + } + ] + }' -k ``` +To expose an MCP server instead, follow the same `kubectl port-forward` and admin-credential steps above, +then POST an `Mcp` payload to `/api/management/v1/mcp-proxies` as shown in the +[MCP proxy quick start guide](../../../mcp-proxy/quick-start-guide.md). + ## Next Steps - For operator-managed lifecycle and CRDs, see [Kubernetes Operator deployment mode](./gateway-operator.md). -- For mode comparison and migration context from Kubernetes Gateway 1.3.0, see the [deployment modes overview page](./overview.md). \ No newline at end of file +- For mode comparison and migration context from Kubernetes Gateway 1.3.0, see the [deployment modes overview page](./overview.md). From 928015baec6c8f83c3d23dc3eaacd9816e294471 Mon Sep 17 00:00:00 2001 From: Kaushal Kahapola <129000208+kaushalkahapola@users.noreply.github.com> Date: Wed, 19 Aug 2026 17:01:08 +0530 Subject: [PATCH 2/3] Fix formatting in kubernetes-standalone.md metadata --- .../deployment-modes/kubernetes/kubernetes-standalone.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/en/docs/ai-gateway/1.2.0/deployment/deployment-modes/kubernetes/kubernetes-standalone.md b/en/docs/ai-gateway/1.2.0/deployment/deployment-modes/kubernetes/kubernetes-standalone.md index 3784a37a0c..37b65cb575 100644 --- a/en/docs/ai-gateway/1.2.0/deployment/deployment-modes/kubernetes/kubernetes-standalone.md +++ b/en/docs/ai-gateway/1.2.0/deployment/deployment-modes/kubernetes/kubernetes-standalone.md @@ -5,9 +5,9 @@ canonical_url: https://wso2.com/api-platform/docs/ai-gateway/deployment/deployme md_url: https://wso2.com/api-platform/docs/ai-gateway/deployment/deployment-modes/kubernetes/kubernetes-standalone.md tags: - ai-gateway - - kubernetes - - deployment - author: WSO2 API Platform Documentation Team + - kubernetes + - deployment +author: WSO2 API Platform Documentation Team last_updated: 2026-08-07 content_type: "how-to" --- From b99a466813fb49ef44a5205f54ff38dde38f0971 Mon Sep 17 00:00:00 2001 From: Kaushal Kahapola <129000208+kaushalkahapola@users.noreply.github.com> Date: Wed, 19 Aug 2026 17:13:21 +0530 Subject: [PATCH 3/3] Revise LLM provider setup and API endpoints Updated API documentation to reflect changes in LLM provider configuration and endpoints. --- .../kubernetes/kubernetes-standalone.md | 78 ++++++++++--------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/en/docs/ai-gateway/next/deployment/deployment-modes/kubernetes/kubernetes-standalone.md b/en/docs/ai-gateway/next/deployment/deployment-modes/kubernetes/kubernetes-standalone.md index 6b517e668f..37b65cb575 100644 --- a/en/docs/ai-gateway/next/deployment/deployment-modes/kubernetes/kubernetes-standalone.md +++ b/en/docs/ai-gateway/next/deployment/deployment-modes/kubernetes/kubernetes-standalone.md @@ -231,7 +231,7 @@ helm install ap-gateway oci://ghcr.io/wso2/api-platform/helm-charts/gateway \ --set gateway.controller.upstreamCerts.secretName=upstream-ca-certs ``` -## Create and Invoke API +## Create and Invoke an LLM Provider ### Port-forward Gateway Controller Service @@ -241,10 +241,10 @@ kubectl port-forward svc/ap-gateway-controller 9090:9090 ### Verify gateway controller admin endpoint is running ```bash -curl http://localhost:9094/api/admin/v0.9/health +curl http://localhost:9094/api/admin/v1/health ``` -### Deploy an API configuration +### Deploy an LLM provider configuration The management API uses basic auth with the credentials from your Helm values (`controller.auth.basic.users`; the chart default is `admin` / `admin`). Export them, changing them if @@ -255,55 +255,61 @@ export ADMIN_USERNAME=admin export ADMIN_PASSWORD=admin ``` +The gateway includes first-class support for the OpenAI LLM provider. Replace `` with your +OpenAI API key and run the following command to deploy a sample OpenAI LLM provider: + ```bash -curl -X POST http://localhost:9090/api/management/v1/rest-apis \ +curl -X POST http://localhost:9090/api/management/v1/llm-providers \ -u "$ADMIN_USERNAME:$ADMIN_PASSWORD" \ -H "Content-Type: application/yaml" \ --data-binary @- <<'EOF' apiVersion: gateway.api-platform.wso2.com/v1 -kind: RestApi +kind: LlmProvider metadata: - name: reading-list-api-v1.0 + name: openai-provider spec: - displayName: Reading-List-API + displayName: OpenAI Provider version: v1.0 - context: /reading-list/$version + template: openai + context: /openai/latest upstream: - main: - url: https://apis.bijira.dev/samples/reading-list-api-service/v1.0 - policies: - - name: set-headers - version: v1 - params: - request: - headers: - - name: x-wso2-apip-gateway-version - value: v1.0.0 - response: - headers: - - name: x-environment - value: development - operations: - - method: GET - path: /books - - method: POST - path: /books - - method: GET - path: /books/{id} - - method: PUT - path: /books/{id} - - method: DELETE - path: /books/{id} + url: https://api.openai.com/v1 + auth: + type: api-key + header: Authorization + value: + accessControl: + mode: deny_all + exceptions: + - path: /chat/completions + methods: [POST] + - path: /models + methods: [GET] + - path: /models/{modelId} + methods: [GET] EOF ``` ### Test routing through the gateway ```bash -curl http://localhost:8080/reading-list/v1.0/books -curl -k https://localhost:8443/reading-list/v1.0/books +curl -X POST https://localhost:8443/openai/latest/chat/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "gpt-4o-mini", + "messages": [ + { + "role": "user", + "content": "Hi" + } + ] + }' -k ``` +To expose an MCP server instead, follow the same `kubectl port-forward` and admin-credential steps above, +then POST an `Mcp` payload to `/api/management/v1/mcp-proxies` as shown in the +[MCP proxy quick start guide](../../../mcp-proxy/quick-start-guide.md). + ## Next Steps - For operator-managed lifecycle and CRDs, see [Kubernetes Operator deployment mode](./gateway-operator.md). -- For mode comparison and migration context from Kubernetes Gateway 1.3.0, see the [deployment modes overview page](./overview.md). \ No newline at end of file +- For mode comparison and migration context from Kubernetes Gateway 1.3.0, see the [deployment modes overview page](./overview.md).