New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated to use konnectivity client v0.0.21, and implemented placehold… #103126
Conversation
Hi @jdnurme. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
@@ -203,7 +203,8 @@ func (u *udsGRPCConnector) connect() (proxier, error) { | |||
return c, err | |||
}) | |||
|
|||
tunnel, err := client.CreateSingleUseGrpcTunnel(udsName, dialOption, grpc.WithInsecure()) | |||
ctx := context.TODO() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't the delta have been limited to this, and defer the proxier change until used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not possible due to KNP v0.0.21. Due to the breaking change merged in v0.0.21 here: https://github.com/jkh52/apiserver-network-proxy/blob/89eb6ca8c58f2085f1de5e7e699cc0a75d9cd4dc/konnectivity-client/pkg/client/client.go#L178
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JD points out that g.tunnel.Dial("tcp", addr)
changes to return g.tunnel.DialContext(ctx, "tcp", addr)
so the proxy signature has to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, thanks.
/ok-to-test |
/triage accepted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vendor changes LGTM
/lgtm |
/assign @liggitt |
@@ -234,7 +235,7 @@ func (d *dialerCreator) createDialer() utilnet.DialFunc { | |||
egressmetrics.Metrics.ObserveDialFailure(d.options.protocol, d.options.transport, egressmetrics.StageConnect) | |||
return nil, err | |||
} | |||
conn, err := proxier.proxy(addr) | |||
conn, err := proxier.proxy(ctx, addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also plumb ctx to the proxier, err := d.connector.connect()
call on line 233 so the request lifetime informs how long we wait for a dial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, tho proxier is only updated out of necessity. The goal was just to update the singleUseGrpcTunnel in this change
ctx := context.TODO() | ||
tunnel, err := client.CreateSingleUseGrpcTunnel(ctx, udsName, dialOption, grpc.WithInsecure()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context.TODO() here is not good... it means the timeout of the dial is not connected to the timeout of the triggering request... plumbing the request context into connect() would let us connect those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intended to be a placeholder while we determine what actual context should be plumbed through
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cheftako can elaborate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. @cheftako will follow-up to wire this up once he confirms the lifetime of the request context matches
as is, this PR gets us context timeouts on the dial and connection to the backend, which is the most critical
@@ -144,7 +144,7 @@ type httpConnectProxier struct { | |||
proxyAddress string | |||
} | |||
|
|||
func (t *httpConnectProxier) proxy(addr string) (net.Conn, error) { | |||
func (t *httpConnectProxier) proxy(ctx context.Context, addr string) (net.Conn, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we not using the context for http connect at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not currently, just had to add it to all implementations of Proxier because of a breaking change in 0.0.21. This PR is intended to only update gRPC, but this change is unavoidable
dependency bump looks good, but the placeholder context means that it's not actually accomplishing anything in kube-apiserver yet... |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, cheftako, jdnurme, liggitt 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 |
/lgtm |
/retest |
/lgtm |
/retest Review the full test history for this PR. Silence the bot with an |
…3126-upstream-release-1.21 Automated cherry pick of #103126 upstream release 1.21: Updated to use konnectivity client v0.0.21, and implemented placehold…
…er context
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR implements konnectivity client fixes that were recently merged
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
NONE
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: