This topic gives you reference information for Spring Gateway Trait configurable properties on Tanzu Platform for Kubernetes.
Except for the name
and namespace
options, the Spring Gateway Trait simply wraps the spring-cloud-gateway.tanzu.vmware.com
package, exposing only selected configuration properties.
The following provides a description of the available configuration options.
This is used to configure the instance name in the SpringCloudGateway
Kubernetes resource. If not set, it will be spring-cloud-gateway
by default.
gateway:
name:
Metadata contributed to the autogenerated OpenAPI specification. More information here.
api:
description:
documentation:
groupId:
serverUrl:
title:
version:
Enable HTTP CORS (Cross-Origin Resource Sharing) to all routes. More information here.
api:
cors:
allowCredentials: []
allowedHeaders: []
allowedMethods: []
allowedOriginPatterns: []
allowedOrigins: []
exposedHeaders: []
maxAge:
Secret name for external services configuration. Currently, only Redis is supported. More information here.
bindings:
redis:
secret:
Number of gateway pods per gateway instance. Set to 2 or more for high availability (HA) configuration.
count:
Listing of secrets containing Kubernetes certificates to enable TLS connection to upstream services. The TLS secret names contains trusted certificates for upstream connections. More information here.
client:
tls:
secretNames: []
Listing of secrets and host names to enable direct TLS termination in the Gateway. More information here.
server:
tls:
- hosts: []
secretName:
Additional environment variables to pass to the Gateway. Follows same conventions as Kubernetes, described here.
env:
- name:
value:
Array of custom extensions to load. Custom extensions allow adding additional features (filters and predicated) dynamically. The name must match the ConfigMap name containing the JAR. More information here.
extensions:
custom: []
By default, Spring Cloud Gateway doesn’t check if the upstream services are healthy, leaving some requests timeout or responding incorrectly. You can use active Health Checks to help unhealthy upstream services recover more smoothly in the event of a disruption.
By periodically checking a configurable health endpoint, the gateway knows when to short-circuit the request and return a 503 response code, instead of putting additional load on an already struggling API.
More information here.
To specify activate health checks, set:
healthCheck:
enabled:
interval:
JVM parameters for the Gateway instance, for example to adjust JVM memory (java-opts: -Xmx512m
).
More information here.
java-opts:
Activation of metrics endpoints and metrics injections for multiple systems.
More information here.
observability:
metrics:
prometheus:
enabled:
annotations:
enabled:
serviceMonitor:
enabled:
labels:
wavefront:
enabled:
tracing:
wavefront:
enabled:
zipkin:
enabled:
url:
wavefront:
application:
secret:
service:
source:
Configuration for local cache feature. Cache allows reducing traffic to upstream services and improve overall performance.
More information here.
responseCache:
local:
global:
size:
timeToLive:
Configuration of the Kubernetes service for the gateway to be shared across all routes (unless overridden in the route).
More information here on service level configuration, and here on service type customization.
service:
nodePort:
type:
Spring Cloud Gateway for Kubernetes supports authentication and authorization using single sign-on (SSO) with an OpenID identity provider that supports OpenID Connect Discovery protocol.
More information here.
sso:
inactive-session-expiration-in-minutes:
roles-attribute-name:
secret:
tls:
secretName:
Similarly to other Kubernetes resource types, it is possible to override the required memory and CPU for a Gateway. More information here.
resources:
limits:
cpu:
memory:
requests:
cpu:
memory: