Skip to content

Commit 0b5cdf2

Browse files
committed
Enable HTTP/2 support in kube-client rustls connector
This change adds HTTP/2 ALPN support to the rustls HTTPS connector by calling enable_http2() in addition to enable_http1(). This enables HTTP/2 multiplexing for Kubernetes API connections, reducing the number of TCP connections from potentially hundreds to a single multiplexed connection per API server. Previously, kube-rs only supported HTTP/1.1 connections, resulting in a new TCP connection for each concurrent API request. With HTTP/2 enabled, multiple requests can be multiplexed over a single connection, improving performance and reducing resource usage. Signed-off-by: Andrew McDermott <[email protected]>
1 parent 9062eec commit 0b5cdf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kube-client/src/client/config_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl ConfigExt for Config {
245245
.map_err(Error::RustlsTls)?,
246246
));
247247
}
248-
Ok(builder.enable_http1().wrap_connector(connector))
248+
Ok(builder.enable_http1().enable_http2().wrap_connector(connector))
249249
}
250250

251251
#[cfg(feature = "openssl-tls")]

0 commit comments

Comments
 (0)