Skip to content

Try to enable HTTP/2 support in the client #1923

@clux

Description

@clux

What problem are you trying to solve?

The apiserver supports HTTP/2 as evidenced by the multiple http2 flags documented.

If the apiserver supports it, it would be good to try to support it also.

Enabling http2 can supposedly massively reduce open connections for certain calls, particularly around log streaming as reported in #1823 . That PR has a start, but is currently abandoned so raising an issue to open up if anyone is interested in experimenting.

Describe the solution you'd like

Unclear. This needs experimentation.

Enabling http2 is simple enough;

-        Ok(builder.enable_http1().wrap_connector(connector))
+        Ok(builder.enable_http1().enable_http2().wrap_connector(connector))

with extra htt2 features on dependencies hyper, hyper-util and hyper-rustls.

However, this leads to upgrade errors UpgradeConnection(ProtocolSwitch(500)) for websocket related calls.
So i am not sure if this is possible to do as is, i.e. globally setting http2 but then doing some calls as http1.

Exploration is welcome. I speculated a bit in #1823 (comment).

I'd rather not split clients up, but maybe it's possible to do some multiplexing internally in Client based on what types of calls if it came to it.

Documentation, Adoption, Migration Strategy

should be additive and non-breaking if it's done.

Target crate for feature

kube-client, kube-core

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientkube Client relatedcoregeneric apimachinery style workhelp wantedNot immediately prioritised, please help!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions