# InferenceGateway

Source: https://v0-1.docs.modelplane.ai/reference/inferencegateways/

Unified OpenAI-compatible endpoint on the control plane cluster.

Apply instances as `apiVersion: modelplane.ai/v1alpha1`, `kind: InferenceGateway`.

[Concept guide: Set Up the Gateway](https://v0-1.docs.modelplane.ai/platform/inference-gateway/index.md)

## Example

```yaml
apiVersion: modelplane.ai/v1alpha1
kind: InferenceGateway
metadata:
  name: default
spec:
  backend: Traefik
  traefik:
    version: "40.2.0"
    loadBalancer: MetalLB
    metallb:
      addressPool: "172.18.255.200-172.18.255.250"
```

## Definition

The CompositeResourceDefinition this reference is generated from, with the complete OpenAPI schema, validation rules, and defaults:

```yaml
apiVersion: apiextensions.crossplane.io/v2
kind: CompositeResourceDefinition
metadata:
  name: inferencegateways.modelplane.ai
spec:
  group: modelplane.ai
  names:
    categories: [crossplane, modelplane]
    kind: InferenceGateway
    plural: inferencegateways
    shortNames: [ig]
  scope: Cluster
  versions:
  - name: v1alpha1
    served: true
    referenceable: true
    additionalPrinterColumns:
    - name: GATEWAY
      type: string
      jsonPath: .spec.backend
    - name: ADDRESS
      type: string
      jsonPath: .status.address
    schema:
      openAPIV3Schema:
        type: object
        required: [spec]
        properties:
          spec:
            type: object
            required: [backend]
            x-kubernetes-validations:
            - rule: "self.backend != 'Traefik' || has(self.traefik)"
              message: spec.traefik is required when spec.backend is Traefik.
            properties:
              backend:
                type: string
                description: Gateway implementation.
                enum: [Traefik]
              traefik:
                type: object
                description: >-
                  Traefik Proxy configuration. Required when backend is
                  Traefik.
                required: [version]
                x-kubernetes-validations:
                - rule: "!has(self.loadBalancer) || self.loadBalancer != 'MetalLB' || has(self.metallb)"
                  message: spec.traefik.metallb is required when spec.traefik.loadBalancer is MetalLB.
                properties:
                  version:
                    type: string
                    description: Traefik Helm chart version.
                  loadBalancer:
                    type: string
                    description: >-
                      Load balancer implementation for the gateway Service.
                      Omit for cloud environments where a native LB
                      controller is available.
                    enum: [MetalLB]
                  metallb:
                    type: object
                    description: >-
                      MetalLB configuration. Required when loadBalancer is
                      MetalLB. Use for kind or bare-metal clusters.
                    required: [addressPool]
                    properties:
                      addressPool:
                        type: string
                        description: >-
                          IP address range for the MetalLB pool
                          (e.g. "172.18.255.200-172.18.255.250").
                          Must be within the cluster's network CIDR.
          status:
            type: object
            properties:
              address:
                type: string
                description: >-
                  External address of the control plane gateway.
                  Backend-agnostic — works for any routing implementation.
```
