diff --git a/charts/gateway/README.md b/charts/gateway/README.md index 808341c..f8d6b1e 100644 --- a/charts/gateway/README.md +++ b/charts/gateway/README.md @@ -231,6 +231,12 @@ The command removes all the Kubernetes components associated with the chart and | nginx.workerProcesses | string | `"auto"` | | | nginx.workerRlimitNofile | string | `"20480"` | | | nginx.workerShutdownTimeout | string | `"240s"` | | +| openapiToMcp.enabled | bool | `false` | Enable or disable the OpenAPI-to-MCP sidecar. Required when using the `openapi-to-mcp` or `mcp-tools-acl` plugins. The container runs alongside the gateway in the same pod and is reached on 127.0.0.1. | +| openapiToMcp.image.pullPolicy | string | `"IfNotPresent"` | OpenAPI-to-MCP image pull policy | +| openapiToMcp.image.repository | string | `"api7/openapi-to-mcp"` | OpenAPI-to-MCP image repository | +| openapiToMcp.image.tag | string | `"0.0.1-beta"` | OpenAPI-to-MCP image tag | +| openapiToMcp.port | int | `3000` | Port that the sidecar listens on. Must match the `port` configured under `plugin_attr.openapi-to-mcp` in the gateway config (defaults to 3000). | +| openapiToMcp.resources | object | `{}` | Resources for the OpenAPI-to-MCP sidecar container. | | pluginAttrs | object | `{}` | Set APISIX plugin attributes, see [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L376) for more details | | rbac.create | bool | `false` | | | serviceAccount.annotations | object | `{}` | | diff --git a/charts/gateway/templates/_pod.tpl b/charts/gateway/templates/_pod.tpl index b7a174e..494e0bb 100644 --- a/charts/gateway/templates/_pod.tpl +++ b/charts/gateway/templates/_pod.tpl @@ -228,6 +228,43 @@ spec: port: http scheme: HTTP {{- end }} + {{- if .Values.openapiToMcp.enabled }} + {{- $mcpAttr := (index .Values.pluginAttrs "openapi-to-mcp" | default dict) -}} + {{- $pluginMcpPort := (index $mcpAttr "port" | default 3000 | int) -}} + {{- if ne $pluginMcpPort (int .Values.openapiToMcp.port) -}} + {{- fail (printf "openapiToMcp.port (%v) must match pluginAttrs.openapi-to-mcp.port (%v; default 3000)" .Values.openapiToMcp.port $pluginMcpPort) -}} + {{- end }} + - name: openapi-to-mcp + image: {{ .Values.openapiToMcp.image.repository }}:{{ .Values.openapiToMcp.image.tag }} + imagePullPolicy: {{ .Values.openapiToMcp.image.pullPolicy }} + env: + - name: SSE_PORT + value: {{ .Values.openapiToMcp.port | quote }} + ports: + - containerPort: {{ .Values.openapiToMcp.port }} + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /health + port: {{ .Values.openapiToMcp.port }} + failureThreshold: 6 + initialDelaySeconds: 5 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 3 + livenessProbe: + httpGet: + path: /health + port: {{ .Values.openapiToMcp.port }} + failureThreshold: 6 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + resources: + {{- toYaml .Values.openapiToMcp.resources | nindent 8 }} + {{- end }} {{- if .Values.apisix.hostNetwork }} hostNetwork: true dnsPolicy: ClusterFirstWithHostNet diff --git a/charts/gateway/values.yaml b/charts/gateway/values.yaml index 5750255..8063b66 100644 --- a/charts/gateway/values.yaml +++ b/charts/gateway/values.yaml @@ -680,6 +680,24 @@ soapProxy: # -- SOAP proxy image pull policy pullPolicy: IfNotPresent +openapiToMcp: + # -- Enable or disable the OpenAPI-to-MCP sidecar. Required when using the + # `openapi-to-mcp` or `mcp-tools-acl` plugins. The container runs alongside + # the gateway in the same pod and is reached on 127.0.0.1. + enabled: false + image: + # -- OpenAPI-to-MCP image repository + repository: api7/openapi-to-mcp + # -- OpenAPI-to-MCP image tag + tag: 0.0.1-beta + # -- OpenAPI-to-MCP image pull policy + pullPolicy: IfNotPresent + # -- Port that the sidecar listens on. Must match the `port` configured under + # `plugin_attr.openapi-to-mcp` in the gateway config (defaults to 3000). + port: 3000 + # -- Resources for the OpenAPI-to-MCP sidecar container. + resources: {} + control: # -- Enable Control API enabled: true