Skip to content

Conversation

@chrischdi
Copy link
Member

@chrischdi chrischdi commented Oct 28, 2025

What this PR does / why we need it:

  • enables KCP to use websockets if supported by the APIServer
    • websockets are enabled on kube-apiserver per default since k8s v1.31
  • Note: in-memory provider still only supports SPDY.

Note: tested via the debugger that:

  • on v1.34: websockets are used successfully
  • on v1.30: spdy is used via the fallback

I think we are fine with our in-memory implementation to keep using spdy as long as we don't drop it.

Didn't find a easy way to implement it for in-memory, but should definetly be possible.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

/area provider/control-plane-kubeadm

@k8s-ci-robot k8s-ci-robot added area/provider/control-plane-kubeadm Issues or PRs related to KCP cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 28, 2025
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 28, 2025
@chrischdi
Copy link
Member Author

@chrischdi
Copy link
Member Author

/test help

@k8s-ci-robot
Copy link
Contributor

@chrischdi: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test pull-cluster-api-build-main
/test pull-cluster-api-e2e-blocking-main
/test pull-cluster-api-e2e-conformance-ci-latest-main
/test pull-cluster-api-e2e-conformance-main
/test pull-cluster-api-e2e-latestk8s-main
/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-mink8s-main
/test pull-cluster-api-e2e-upgrade-1-34-1-35-main
/test pull-cluster-api-test-main
/test pull-cluster-api-test-mink8s-main
/test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

/test pull-cluster-api-apidiff-main

Use /test all to run the following jobs that were automatically triggered:

pull-cluster-api-apidiff-main
pull-cluster-api-build-main
pull-cluster-api-e2e-blocking-main
pull-cluster-api-test-main
pull-cluster-api-verify-main

In response to this:

/test help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@chrischdi
Copy link
Member Author

/test pull-cluster-api-e2e-conformance-ci-latest-main
/test pull-cluster-api-e2e-conformance-main
/test pull-cluster-api-e2e-latestk8s-main
/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-mink8s-main
/test pull-cluster-api-e2e-upgrade-1-34-1-35-main


dialer := spdy.NewDialer(d.upgrader, httpClient, "POST", req.URL())

// Configure websocket dialer and keep spdy as fallback
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks easy enough. Any ideas on how I can validate if this is correct? (e.g. is there some prior art somewhere else?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did via using tilt.

I added a breakpoint here for KCP accordingly to check if it uses websocket or does the fallback.

For v1.34: it did not do the fallback and successfully used websockets (verified via the dial method)

For v1.30 it did use the fallback / old code SPDY

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbueringer
Copy link
Member

Thank you very much!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: de6e2d1331db7d0e37dd7e4b0149fa91d1b338c9

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 28, 2025
@sbueringer
Copy link
Member

Let's not implement it for the in-memory provider. Just additional code that we would have to maintain, and the test coverage that we get for the SPDY fallback doesn't hurt

@k8s-ci-robot k8s-ci-robot merged commit 06aae54 into kubernetes-sigs:main Oct 28, 2025
31 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Oct 28, 2025
@chrischdi
Copy link
Member Author

/cherry-pick release-1.11

@k8s-infra-cherrypick-robot

@chrischdi: new pull request created: #12931

In response to this:

/cherry-pick release-1.11

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/control-plane-kubeadm Issues or PRs related to KCP cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants