-
Notifications
You must be signed in to change notification settings - Fork 202
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
Added new CLI command dapr dashboard #383
Conversation
"k8s.io/client-go/transport/spdy" | ||
) | ||
|
||
type PortForward struct { |
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.
Please add comments for exported methods. It is applicable for other methods.
pkg/kubernetes/portforward.go
Outdated
host string, localPort, remotePort int, | ||
emitLogs bool, | ||
) (*PortForward, error) { | ||
time.Sleep(10 * time.Second) |
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.
I think this sleep is not needed here, almost it is quite long 10 secs.
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.
Agree, 10 secs feel a bit long. I had to introduce this 10 secs delay because portforwarding would fail since the pod takes couple of seconds to be up and running. Any ideas how to do this idiomatically using client API?
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.
Just looked into it, does this help?
https://gianarb.it/blog/programmatically-kube-port-forward-in-go
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.
Yes, that's the way to do it. Sleep is not needed.
Generally, we should only connect if the dashboard pod is in Ready status.
pkg/kubernetes/dashboard.go
Outdated
|
||
func InitDashboard() error { | ||
|
||
var dashboardManifestPath string = "https://raw.githubusercontent.com/dapr/dashboard/master/deploy/dashboard.yaml" |
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.
It would be better to create const and use that const.
cmd/dashboard.go
Outdated
false, | ||
) | ||
if err != nil { | ||
print.FailureStatusEvent(os.Stderr, "Failed to initialize port forwarding: %s\n", err) |
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.
It would be better if either you can change the error message here to "creating.." or change Line 70 to "error in port forwarding.."
because both messages conveying the same message for 2 different related things..
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.
Thanks for your contribution !
cmd/dashboard.go
Outdated
|
||
func init() { | ||
DashboardCmd.Flags().BoolVarP(&kubernetesMode, "kubernetes", "k", false, "Deploy Dapr dashboard to a Kubernetes cluster") | ||
DashboardCmd.Flags().BoolVarP(&open, "open", "o", false, "Open Dapr dashboard in a browser") |
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.
Change "open" to "start" .
@gdhuper , will you also be considering in your changes for invoking dashboard in standalone mode ? |
We discussed this in the issue, this PR will tackle Kubernetes first. Once we agree on a packaging and distribution format of the dashboard for self-hosted mode, we can later enable it in the CLI. |
This overall looks great! Yesterday in a maintainers meeting, the following decisions were made:
Thus, I think we can remove the deployment of the dashboard from this PR, and have |
yeah so that was the plan initially to support both standalone and kubernetes mode, but turns out standalone mode is a bit tricky with containers. However, as Yaron mentioned in this comment, we can download dashboard as a zip and spin it up in a local dir. IIRC, dapr/dashboard does not have a release pipeline. Any plans on setting one up for dashboard so standalone mode could be supported? EDIT: I think my question was answered as I was writing this :). I'll go ahead an remove dashboard deployment from this PR. Thanks |
@yaron2 , that's right. We can remove deployment from |
@gdhuper , Thanks @yaron2 for clarification. |
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.
Looks great! Thanks for doing this.
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.
Thanks for your valuable contribution !
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.
LGTM.
Thank you for this.
Description
Extended dapr cli to launch dapr dashboard in kubernetes.
Issue reference
This PR will close: #341
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: