-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Setup port-forwarding for linkerd dashboard command #2052
Conversation
Woah, now that's an awesome PR. |
Note that there's still a lot of code in the |
@klingerf I'm totally behind removing support for viewing the dashboard it via |
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.
pkg/k8s/portforward.go
Outdated
ports := []string{fmt.Sprintf("%d:%d", pf.localPort, pf.remotePort)} | ||
dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, pf.method, pf.url) | ||
|
||
fw, err := portforward.New(dialer, ports, pf.stopCh, pf.readyCh, ioutil.Discard, ioutil.Discard) |
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.
consider os.Stdout, os.Stderr
, perhaps when verbose
is enabled?
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.
Great idea! Have added that in the latest commit.
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.
👍 🚢
ports := []string{fmt.Sprintf("%d:%d", pf.localPort, pf.remotePort)} | ||
dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, pf.method, pf.url) | ||
|
||
fw, err := portforward.New(dialer, ports, pf.stopCh, pf.readyCh, ioutil.Discard, ioutil.Discard) | ||
fw, err := portforward.New(dialer, ports, pf.stopCh, pf.readyCh, out, errOut) |
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.
nice!
Forwarding from 127.0.0.1:51328 -> 8084
Forwarding from [::1]:51328 -> 8084
Linkerd dashboard available at:
http://127.0.0.1:51328
Grafana dashboard available at:
http://127.0.0.1:51328/grafana
Handling connection for 51328
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
8e10e3b
to
cfba841
Compare
* Setup port-forwarding for linkerd dashboard command * Output port-forward logs when --verbose flag is set Signed-off-by: Kevin Lingerfelt <kl@buoyant.io> Signed-off-by: Cody Vandermyn <cody.vandermyn@nordstrom.com>
* Setup port-forwarding for linkerd dashboard command * Output port-forward logs when --verbose flag is set Signed-off-by: Kevin Lingerfelt <kl@buoyant.io> Signed-off-by: Cody Vandermyn <cody.vandermyn@nordstrom.com>
This branch switches the
linkerd dashboard
command from using the kubernetes service proxy to access the web UI, to instead using port-forward to access the web pod directly. This simplifies the URLs displayed in the dashboard, and it removes our direct dependency on "k8s.io/kubernetes" 🎉As part of this change, I fixed a bug with
linkerd dashboard
, where the proxy would not start until after the dashboard had been successfully loaded in a browser (relates to #2047). And I've updated the integration tests to use port-forwarding instead of proxying to access pods running in the test environment.Fixes #1696.