This resource uses an OpenAPI file with x-kusk annotations as the source of truth to configure routing. Refer to OpenAPI Extension Reference for the further information on how to add routing information to OpenAPI file.
The required field of API resource is
x-kusk-enhanced OpenAPI file is supplied as an embedded string.
You can generate API resources from an OpenAPI definition (and integrate into your CI) using the Kusk CLI - see
Generating API CRDs.
The optional spec.fleet field specifies to what Envoy Fleet (Envoy Proxy instances with the exposing K8s Service) this configuration applies. The fleet.name and fleet.namespace fields reference the deployed Envoy Fleet Custom Resource name and namespace. Deploy your API configuration in any namespace with any name and it will be applied to the specific Envoy Fleet. If this option is missing, auto-detection will be performed to find the single fleet deployed in the Kubernetes cluster fleet, which is considered as the default fleet. The deployed API custom resource will be changed to map to that fleet accordingly. If there are multiple fleets deployed, the spec.fleet is required to specify in the manifest.
Once the resource manifest is deployed, Kusk Gateway Manager will use it to configure routing for Envoy Fleet. Multiple resources can exist in different namespaces; all of them will be evaluated and the configuration merged on any update with these resources. Trying to apply a resource that has conflicting routes with the existing resources (i.e. same HTTP method and path) will result in error.
- Currently, the resource status field is not updated by the manager when the configuration process finishes.
# Envoy Fleet (its name and namespace) to deploy the configuration to, here - deployed EnvoyFleet with the name "default" in the namespace "default".
# Optional, if not specified - single (default) fleet auto-detection will be performed in the cluster.
# OpenAPI file with x-kusk annotation here
- url: /api/v3
description: Some description
title: the best API in the world
# top level x-kusk extension to configure routes
hosts: [ "*" ]
# Strips prefix when forwarding to upstream
--- skipped ---
summary: Update pet
description: Update an existing pet by Id
--- skipped ---