Update web server to use tap APIService#3208
Conversation
Signed-off-by: Kevin Leimkuhler <[email protected]>
Signed-off-by: Kevin Leimkuhler <[email protected]>
Signed-off-by: Kevin Leimkuhler <[email protected]>
|
A @siggy should this be a specific section on that page for the dashboard? We'll need to explain the web service account and such. |
|
Integration test results for 04e6178: fail 😕 |
|
@grampelberg Once #3203 ships the dashboard should just work, and this error will be more exception than rule, but I do think some special treatment here is warranted. Recommend in increasing order of effort (and descending order of whether we should include it for 2.5, I think we should just do the first two):
|
Signed-off-by: Kevin Leimkuhler <[email protected]>
Signed-off-by: Kevin Leimkuhler <[email protected]>
|
@siggy Thanks for the comments I addressed them all above. @grampelberg I changed the error message so that it now only displays: The more significant change in this commit is that tap errors now return a
|
|
It looks like this line in the CI logs indicates something in |
|
Integration test results for 5a0e887: fail 😕 |
|
@kleimkuhler re: the ci failure, locally i get: $ go test ./...
...
# github.com/linkerd/linkerd2/pkg/protohttp [github.com/linkerd/linkerd2/pkg/protohttp.test]
pkg/protohttp/protohttp_test.go:106:26: undefined: httpError
pkg/protohttp/protohttp_test.go:153:16: undefined: httpError
... |
Signed-off-by: Kevin Leimkuhler <[email protected]>
|
Ah jeez thank you. I was looking for build issues with |
siggy
left a comment
There was a problem hiding this comment.
lgtm modulo @scottcarol's eyes, and bin/lint and l5d-bot passing. 👍 🚢
Signed-off-by: Kevin Leimkuhler <[email protected]>
|
Yep just fixed that lint. Sounds good! |
|
Integration test results for c57bee7: fail 😕 |
scottcarol
left a comment
There was a problem hiding this comment.
This looks good! Thanks @siggy for help demoing it.
To linkify the URL in the error message, you want to add react-linkify to package.json:
"react-iframe": "1.7.16",
+ "react-linkify": "1.0.0-alpha",
"react-router": "4.3.1",```then surround line 72 of ErrorBanner.jsx with Linkify:
- { !error ? null : <div>{error}</div> }
+ <Linkify>{ !error ? null : <div>{error}</div> }</Linkify>to style it so it's readable, add a class to styles.css:
.tapGrayed {
color: lightgray;
}
+
+.errorMessage a {
+ color: white;
+}and change line 67 of ErrorBanner.jsx:
- <div id="message-id" >
+ <div id="message-id" className="errorMessage">Signed-off-by: Kevin Leimkuhler <[email protected]>
|
@scottcarol Oh awesome thanks for looking more into that! I'll get this change in now. |
Signed-off-by: Kevin Leimkuhler <[email protected]>
|
Integration test results for 96c7c43: fail 😕 |
|
Your updated branch works for me, the error message was rendered and linked properly. 👍 I'm still seeing that l5d-bot is failing, but it failed in a different place this time: |
|
Hm yea not sure why it says it failed. It passed CI this time. |
Signed-off-by: Kevin Leimkuhler <[email protected]>
|
Integration test results for 6bbb95a: fail 😕 |
|
Okay I ran the integration tests locally and everything passed. I'm going to merge this. |
|
Thanks for doing the extra tests! 💪 |
|
This is awesome! I may have missed the boat on the high level UX discussion, but what do folks think about replacing the content of the "Live requests" and "Tap" sections with a friendly message rather than using error banners? Especially since the error banner can be dismissed and then you're left with a UI that doesn't work. I think replacing the section entirely communicates "This feature is disabled" rather than "This feature is broken". WDYT? |
|
@adleong I agree that dashboard-wide we could do a better job explaining the reasons why no data exists and whether or not that is a concern. This aligns with #2998 which came out of conversation with @grampelberg about what to do if no data is found (currently in the dashboard we show an empty table if there are no rows to display, with no additional message). |
|
Is it possible for a dashboard user to have Top/Tap access for certain traffic streams and not others? If the user would be blocked from all traffic streams when using the dashboard and we could check with just one query, the above suggestion seems simple to implement. If the user could have access to some streams but not others, we'd need to allow the user to formulate their desired query before telling them "yes" or "no." I think a separate ticket would make sense for this while keeping in mind #2998. Happy to make the ticket later today. |
|
I would like to always fire off the request and handle the 403 response in-panel instead of as part of a popup. |
|
Wrote up the issue here: #3220 |




Motivation
PR #3167 introduced the tap APIService and migrated
linkerd tapto use it.Subsequent PRs (#3186 and #3187) updated
linkerd topandlinkerd profile --tapto use the tap APIService. This PR moves the web's Go server to now alsouse the tap APIService instead of the public API. It also ensures an error
banner is shown to the user when unauthorized taps fail via
linkerd topcommand in Overview and Top, and
linkerd tapcommand in Tap.Details
The majority of these changes are focused around piping through the HTTP error
that occurs and making sure the error banner generated displays the error
message explaining to view the tap RBAC docs.
httpErroris now public (HTTPError) and the error message generated is shortenough to fit in a control frame (explained here).
Testing
The error we are testing for only occurs when the linkerd-web service account is
not authorzied to tap resources. Unforutnately that is not the case on Docker
For Mac (assuming that is what you use locally), so you'll need to test on a
different cluster. I chose a GKE cluster made through the GKE console--not made
through cluster-utils because it adds cluster-admin.
Checkout the branch locally and
bin/docker-buildorares-buildif you haveit setup. It should produce a linkerd with the version
git-04e61786. I havealready pushed the dependent components, so you won't need to
bin/docker-push git-04e61786.Install linkerd on this GKE cluster and try to run
taportopcommands viathe web. You should see the following errors:
Tap
Top
Signed-off-by: Kevin Leimkuhler [email protected]