This topic gives you reference information for properties you can configure for the Spring Gateway Trait on Tanzu Platform.
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.
Gateway name
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:
API Metadata
Metadata contributed to the autogenerated OpenAPI specification. More information here.
api:
description:
documentation:
groupId:
serverUrl:
title:
version:
CORS configuration
Enable HTTP CORS (Cross-Origin Resource Sharing) to all routes. More information here.
api:
cors:
allowCredentials: []
allowedHeaders: []
allowedMethods: []
allowedOriginPatterns: []
allowedOrigins: []
exposedHeaders: []
maxAge:
External services bindings
Secret name for external services configuration. Currently, only Redis is supported. More information here.
bindings:
redis:
secret:
Replicas count
Number of gateway pods per gateway instance. Set to 2 or more for high availability (HA) configuration.
count:
TLS client configuration
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: []
TLS server configuration
Listing of secrets and host names to enable direct TLS termination in the Gateway. More information here.
server:
tls:
- hosts: []
secretName:
Environment variables
Additional environment variables to pass to the Gateway. Follows same conventions as Kubernetes, described here.
env:
- name:
value:
Spring Cloud Gateway Custom Extension configuration
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: []
Upstream Health Check
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 options
JVM parameters for the Gateway instance, for example to adjust JVM memory (java-opts: -Xmx512m
).
More information here.
java-opts:
Observability
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:
Response Cache Configuration
Configuration for local cache feature. Cache allows reducing traffic to upstream services and improve overall performance.
More information here.
responseCache:
local:
global:
size:
timeToLive:
Kubernetes upstream service
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:
Single sign-on
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:
Pod resources
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:
Content feedback and comments