-
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
Wire up stats commands for daemonsets (#2006) #2086
Conversation
ValidationTo test, took the example project clilinkerd stat all -n emojivoto linkerd stat daemonset/emoji -n emojivoto linkerd stat daemonsets --to ds/emoji -n emojivoto
web UIPages checked;
grafanaChecked dashboard, and links from above pages of the web ui |
cc9917d
to
c5625f8
Compare
Awesome, thanks for submitting this @zknill! |
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
@zknill awesome! would you mind sharing your modified emojivoto/daemonsets config? bonus points for submitting it as a PR to https://github.com/BuoyantIO/emojivoto ;) |
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 really great work @zknill! Thank you so much for the contribution!
Had a few minor nits but overall this is good to go. 👍 💥
controller/k8s/api.go
Outdated
@@ -33,6 +35,7 @@ type APIResource int | |||
// These constants enumerate Kubernetes resource types. | |||
const ( | |||
CM APIResource = iota | |||
Daemonset |
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.
mind naming this DS
?
controller/k8s/api.go
Outdated
sp spinformers.ServiceProfileInformer | ||
svc coreinformers.ServiceInformer | ||
cm coreinformers.ConfigMapInformer | ||
daemonset appv1informers.DaemonSetInformer |
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.
ds
err: nil, | ||
k8sConfigs: []string{` | ||
apiVersion: apps/v1 | ||
kind: DaemonSet |
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.
🙏
@@ -59,6 +59,7 @@ func newCmdStat() *cobra.Command { | |||
Examples: | |||
* deploy | |||
* deploy/my-deploy | |||
* ds/my-daemonset |
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.
a few lines below this, add daemonsets
under Valid resource types include:
@siggy very happy to open a PR, but not super sure where / how it would fit into that project. It seems more logical for that repo to hold deployments for the services... anyhow, linked below is the daemonset config that I used for testing. https://gist.github.com/zknill/c2253bad3cc2da0a0b3b10617d2f2bc8 |
@zknill just create a secondary yaml named |
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.
@zknill Awesome work! So cool to see this wired all the way through.
It looks like your most recent commit doesn't include a DCO signoff. Can I trouble you to rewrite that commit to include it so that we can get this merged?
I also noticed that there's no live tap data showing up on the daemonset detail page in the web UI. This is because we haven't updated the linkerd tap
and linkerd top
commands to support daemonsets. For instance, on your branch, I get:
$ bin/linkerd tap ds/emoji -n emojivoto
Error: unsupported resource type [daemonset]
And in the web UI, I see:
(Note that for unrelated reasons that error doesn't show up when you run bin/linkerd dashboard
(it silently swallows websocket errors), but it does show up when you run bin/web run
)
Anyhow, I actually don't think it would be a lot more work to support daemonsets in tap and top, and it would be fine to do that as part of this branch or in a follow up branch -- whatever's easiest for you.
@@ -142,6 +142,7 @@ class Namespaces extends React.Component { | |||
<NetworkGraph namespace={this.state.ns} deployments={metrics.deployment} /> | |||
} | |||
{this.renderResourceSection("deployment", metrics.deployment)} | |||
{this.renderResourceSection("daemonset", metrics.daemonset)} |
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 super nit-picky: the renderResourceSection
method converts the resource string "daemonset" to title-case, using the friendlyTitle
method from web/app/js/components/util/Utils.js. There's a special case inside that function to convert "replicationcontroller" to "Replication Controllers", here:
linkerd2/web/app/js/components/util/Utils.js
Lines 128 to 130 in dacd881
if (resource === "replicationcontroller") { | |
titleCase = _startCase("replication controller"); | |
} |
My preference is to treat daemonsets similarly, by adding an additional special case for "daemonset", so that the headers are displayed as "Daemon Sets" instead of "Daemonsets".
grafana/dashboards/daemonset.json
Outdated
] | ||
}, | ||
"timezone": "", | ||
"title": "Linkerd Daemonset", |
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.
Can we call this "Linkerd DaemonSet" to match the Kubernetes casing?
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
Sorry for slow response, on holiday at the moment. I will be able to look into things on Sunday / Monday |
Hi there @klingerf, I intentionally omitted the I can look at adding it as that experience for users of the UI isn't great. It might be worth updating the other similar tickets for |
dfbd77f
to
0747ea9
Compare
I am looking into top and tap commands next |
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
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 all the updates @zknill ! one small doc nit (and a rebase from master), and then this is good to go.
cli/cmd/top.go
Outdated
@@ -283,9 +283,11 @@ func newCmdTop() *cobra.Command { | |||
* deploy | |||
* deploy/my-deploy | |||
* deploy my-deploy | |||
* ds/my-deploy |
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.
ds/my-daemonset
;)
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 all looks great @zknill! The only thing left to do is just rebase off of master like siggy mentioned
Yes ofc, sorry all! I'm sure you appreciate it's sometimes hard to find the time to do all the things - I've not forgotten! |
DaemonSet stats are not currently shown in the cli stat command, web ui or grafana dashboard. This commit adds daemonset support for stat. Update stat command's help message to reference daemonsets. Update the public-api to support stats for daemonsets. Add tests for stat summary and api. Add daemonset get/list/watch permissions to the linkerd-controller cluster role that's created using the install command. Update golden expectation test files for install command yaml manifest output. Update web UI with daemonsets Update navigation, overview and pages to list daemonsets and the pods associated to them. Add daemonset paths to server, and ui apps. Add grafana dashboard for daemonsets; a clone of the deployment dashboard. Update dependencies and dockerfile hashes Fixes of linkerd#2006 Signed-off-by: Zak Knill <zrjknill@gmail.com>
Update daemonset in controller to use short form name Reorder the fields and methods to still be alphabetical List daemonset as one of the supported stat resources in cli help text Signed-off-by: Zak Knill <zrjknill@gmail.com>
Update grafana dashboard name to match kubernetes case; DasemonSet Update friendlyTitle for web UI to be "daemon set" Signed-off-by: Zak Knill <zrjknill@gmail.com>
The web UI support DaemonSets but the Live Calls section will error without support for the tap and top commands. Update tap and top commands with DaemonSet support. Signed-off-by: Zak Knill <zrjknill@gmail.com>
d017abc
to
895d29f
Compare
Signed-off-by: Zak Knill <zrjknill@gmail.com>
I think I've got everything; rebase and all Let me know if there are other tweaks to be made! 🙏 |
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
Relates to #2086 Signed-off-by: Andrew Seigner <siggy@buoyant.io>
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.
Relates to linkerd#2086 Signed-off-by: Andrew Seigner <siggy@buoyant.io>
@siggy thank you so much for this! (not quite sure how this slipped through the net) I've picked the commit, and rechecked the UI and stat, top and tap cli comamnds. Thanks for all your help, I appreciate your time! |
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.
Awesome work @zknill ! Thanks for sticking with us through all the review!
DaemonSet stats are not currently shown in the cli stat command, web ui
or grafana dashboard. This commit adds daemonset support for stat.
Update stat command's help message to reference daemonsets.
Update the public-api to support stats for daemonsets.
Add tests for stat summary and api.
Add daemonset get/list/watch permissions to the linkerd-controller
cluster role that's created using the install command.
Update golden expectation test files for install command
yaml manifest output.
Update web UI with daemonsets
Update navigation, overview and pages to list daemonsets and the pods
associated to them.
Add daemonset paths to server, and ui apps.
Add grafana dashboard for daemonsets; a clone of the deployment
dashboard.
Fixes of #2006
Signed-off-by: Zak Knill zrjknill@gmail.com