-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Stabilize map order in kubectl describe #26046
Stabilize map order in kubectl describe #26046
Conversation
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
2 similar comments
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
@@ -2033,9 +2035,39 @@ const ( | |||
// Number of Pods that may be running on this Node: see ResourcePods | |||
) | |||
|
|||
// ResourceNameList is a collection of ResourceName values. | |||
type ResourceNameList []ResourceName |
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.
The sort functions should go in a separate package. Probably somewhere under a util. That said, since a resource name is just a string can we just cast to a string slice and use sort strings?
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.
To elaborate, we tend to keep types.go as just holding the structs and all the utility functions should go elsewhere. It makes it easier to work with the versioned types files if we don't tend to have the utility functions mixed in.
cc @kubernetes/kubectl |
ok to test |
See: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/describe.go#L304 And: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/sorted_resource_name_list.go Can we localize sort logic to that second file? And have a utility to does what's required there? |
@derekwaynecarr Thanks for the pointer to those files. Very helpful, I missed to see Let me know what you think. |
@derekwaynecarr did you have a chance to look at the PR again? Thanks! |
@@ -842,21 +842,25 @@ func describeContainers(label string, containers []api.Container, containerStatu | |||
if len(resourceToQoS) > 0 { | |||
fmt.Fprintf(out, " QoS Tier:\n") | |||
} | |||
for resource, qos := range resourceToQoS { | |||
for _, resource := range SortedQoSResourceNames(resourceToQoS) { |
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 we should stop reporting qos per resource in 1.3
@bgrant0607 @vishh - now that we have merged #14943 should we update the CLI to just output the QoS of the pod?
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. We should do that. I can post a patch for it later today, unless we
want to make that change in this PR itself.
On Wed, May 25, 2016 at 2:43 PM, Derek Carr notifications@github.com
wrote:
In pkg/kubectl/describe.go
#26046 (comment)
:@@ -842,21 +842,25 @@ func describeContainers(label string, containers []api.Container, containerStatu
if len(resourceToQoS) > 0 {
fmt.Fprintf(out, " QoS Tier:\n")
}
for resource, qos := range resourceToQoS {
for _, resource := range SortedQoSResourceNames(resourceToQoS) {
I think we should stop reporting qos per resource in 1.3
@bgrant0607 https://github.com/bgrant0607 @vishh
https://github.com/vishh - now that we have merged #14943
#14943 should we update
the CLI to just output the QoS of the pod?—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/26046/files/c8a14e376e3df237d6d0d6a2d5266056cbfeab87#r64658693
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 we should stop reporting qos per resource in 1.3
Does this mean that if I have a deployment and describe it I won't be able to see its QoS anymore?
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 could be wrong here, but my understanding is that QoS just moves one layer up from containers to pods.
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.
Qos has changed this release to be at the pod level and not for individual
compute resources. A follow on PR was made that now reports the effective
QoS for a pod in describe.
On Thursday, May 26, 2016, Michail Kargakis notifications@github.com
wrote:
In pkg/kubectl/describe.go
#26046 (comment)
:@@ -842,21 +842,25 @@ func describeContainers(label string, containers []api.Container, containerStatu
if len(resourceToQoS) > 0 {
fmt.Fprintf(out, " QoS Tier:\n")
}
for resource, qos := range resourceToQoS {
for _, resource := range SortedQoSResourceNames(resourceToQoS) {
I think we should stop reporting qos per resource in 1.3
Does this mean that if I have a deployment and describe it I won't be able
to see its QoS anymore?—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/26046/files/c8a14e376e3df237d6d0d6a2d5266056cbfeab87#r64710897
@timoreimann - just the one open question that this PR triggered where I think we should stop showing per resource qos information, will let some others weigh in before merging this. |
can you squash your commits in the interim? |
Includes container and QoS resources.
c8a14e3
to
32aa740
Compare
@derekwaynecarr done. |
@derekwaynecarr @vishh I'm open to providing another / extending this PR to move QoS information to the pod level but might lag a bit due to a long weekend ahead. If you're in a hurry to get things in for the upcoming 1.3 release, I'd happily leave it to another PR of yours. Just let me know. |
@timoreimann I will most likely tackle pod level QoS reporting this week. I can open a tracker issue in case you are interested. |
@vishh A tracker issue would be great. Thanks for the feedback! |
First time contributor here. @@derekwaynecarr, do I understand correctly that I still need LGTM and ok-to-merge labels? |
This PR looks good. Applying all the required labels. Thanks for the contribution! |
Because submit queue is blocked, I'm going to kick off re-tests of the top 5 PRs in the queue, then merge them if they pass. |
Apologies for not looking into this particular test failure, using IGNORE bypass as buildcop. |
@alex-mohr my PR still seems to be stuck. is the submit queue still having issues? |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 32aa740. |
Automatic merge from submit-queue |
Refs #25251.
Add
SortedResourceNames()
methods to map type aliases in order to achieve stable output order forkubectl
descriptors.This affects QoS classes, resource limits, and resource requests.
A few remarks:
sort.Interface
implementation and the changed logic inkubectl.describeContainers()
.map[<key type>]interface{}
is different from any other map type and thus requires explicit iteration on the caller site to convert back and forth. Unfortunately, this makes it hard to completely avoid code/test duplication.Please let me know what you think.