ClientTrafficPolicy is an Envoy Gateway extension that configures how Envoy Proxy behaves with downstream clients—the connections coming into the proxy from external clients or services.
ClientTrafficPolicy allows you to configure:
KubeLB synchronizes ClientTrafficPolicy resources from tenant clusters to the management cluster. The policy is attached to a Gateway resource and applies to all listeners on that Gateway.
targetRefapiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
name: client-timeout-policy
namespace: default
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: kubelb
timeout:
http:
requestReceivedTimeout: 30s
Configure HTTP/2 settings for clients:
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
name: http2-policy
namespace: default
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: kubelb
http2:
initialStreamWindowSize: 64Ki
initialConnectionWindowSize: 1Mi
maxConcurrentStreams: 200
Extract real client IPs when behind a load balancer:
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
name: client-ip-policy
namespace: default
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: kubelb
clientIPDetection:
xForwardedFor:
numTrustedHops: 2
Platform administrators can disable ClientTrafficPolicy synchronization at the global or tenant level:
apiVersion: kubelb.k8c.io/v1alpha1
kind: Config
metadata:
name: default
namespace: kubelb
spec:
gatewayAPI:
disableClientTrafficPolicy: true
apiVersion: kubelb.k8c.io/v1alpha1
kind: Tenant
metadata:
name: my-tenant
namespace: kubelb
spec:
gatewayAPI:
disableClientTrafficPolicy: true