Traffic *ClusterTrafficFeatures `json:"traffic,omitempty" yaml:"traffic,omitempty"`
// ClusterTrafficFeatures holds the TrafficFeatures fields that translate to Envoy cluster (CDS)
// configuration - the ones applyTraffic consumes. These are the only fields safe to bake into a
// merged BackendCluster shared across routes; route/HCM-scoped features (rate limit, fault
// injection, etc.) live directly on TrafficFeatures instead.
//
// +k8s:deepcopy-gen=true
type ClusterTrafficFeatures struct {
// load balancer policy to use when routing to the backend endpoints.
LoadBalancer *LoadBalancer `json:"loadBalancer,omitempty" yaml:"loadBalancer,omitempty"`
// Proxy Protocol Settings
ProxyProtocol *ProxyProtocol `json:"proxyProtocol,omitempty" yaml:"proxyProtocol,omitempty"`
// HealthCheck defines the configuration for health checking on the upstream.
HealthCheck *HealthCheck `json:"healthCheck,omitempty" yaml:"healthCheck,omitempty"`
// AdmissionControl defines the schema for admission control based on success rate.
AdmissionControl *AdmissionControl `json:"admissionControl,omitempty" yaml:"admissionControl,omitempty"`
// Circuit Breaker Settings
CircuitBreaker *CircuitBreaker `json:"circuitBreaker,omitempty" yaml:"circuitBreaker,omitempty"`
// Request and connection timeout settings
Timeout *Timeout `json:"timeout,omitempty" yaml:"timeout,omitempty"`
// TcpKeepalive settings associated with the upstream client connection.
TCPKeepalive *TCPKeepalive `json:"tcpKeepalive,omitempty" yaml:"tcpKeepalive,omitempty"`
// settings of upstream connection
BackendConnection *BackendConnection `json:"backendConnection,omitempty" yaml:"backendConnection,omitempty"`
// HTTP2 provides HTTP/2 configuration for clusters
// +optional
HTTP2 *HTTP2Settings `json:"http2,omitempty" yaml:"http2,omitempty"`
// DNS is used to configure how DNS resolution is handled by the Envoy Proxy cluster
DNS *DNS `json:"dns,omitempty" yaml:"dns,omitempty"`
}
// TrafficFeatures holds the information associated with the Backend Traffic Policy.
// +k8s:deepcopy-gen=true
type TrafficFeatures struct {
// ClusterTrafficFeatures holds the cluster (CDS) scoped fields. Inlined, so serialization and
// promoted field access (e.g. tf.CircuitBreaker) are unchanged.
ClusterTrafficFeatures `json:",inline" yaml:",inline"`
// RateLimit defines the more specific match conditions as well as limits for ratelimiting
// the requests on this route.
RateLimit *RateLimit `json:"rateLimit,omitempty" yaml:"rateLimit,omitempty"`
// BandwidthLimit defines bandwidth limiting for the backend.
BandwidthLimit *BandwidthLimit `json:"bandwidthLimit,omitempty" yaml:"bandwidthLimit,omitempty"`
// FaultInjection defines the schema for injecting faults into HTTP requests.
FaultInjection *FaultInjection `json:"faultInjection,omitempty" yaml:"faultInjection,omitempty"`
// Retry settings
Retry *Retry `json:"retry,omitempty" yaml:"retry,omitempty"`
// ResponseOverride defines the schema for overriding the response.
ResponseOverride *ResponseOverride `json:"responseOverride,omitempty" yaml:"responseOverride,omitempty"`
// Compression settings for HTTP Response
Compression []*Compression `json:"compression,omitempty" yaml:"compression,omitempty"`
// HTTPUpgrade defines the schema for upgrading the HTTP protocol.
HTTPUpgrade []HTTPUpgradeConfig `json:"httpUpgrade,omitempty" yaml:"httpUpgrade,omitempty"`
// Telemetry defines the schema for telemetry configuration.
Telemetry *BackendTelemetry `json:"telemetry,omitempty" yaml:"telemetry,omitempty"`
// RequestBuffer defines the schema for enabling buffered requests
RequestBuffer *RequestBuffer `json:"requestBuffer,omitempty" yaml:"requestBuffer,omitempty"`
}
We should only include Cluster-scoped traffic features in the
BackendCluster.Originally posted by @zhaohuabing in #9477 (comment)