Skip to content
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

kubectl: include init containers when determining pod QoS #104909

Merged
merged 2 commits into from
Nov 2, 2021

Conversation

pacoxu
Copy link
Member

@pacoxu pacoxu commented Sep 10, 2021

/kind bug
Fixes #98782
/sig cli
/assign soltysh

NONE

sync #75223 logics to kubectl like #98783

…stent with kubelet

Signed-off-by: thomassong <thomassong2012@gmail.com>
Co-authored-by: Paco Xu <paco.xu@daocloud.io>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. sig/cli Categorizes an issue or PR as relevant to SIG CLI. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 10, 2021
@pacoxu
Copy link
Member Author

pacoxu commented Sep 10, 2021

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 10, 2021
@eddiezane
Copy link
Member

Can you please add a comment to the original function?

Something like

// When this function is updated please also update staging/src/k8s.io/kubectl/pkg/util/qos/qos.go

@eddiezane
Copy link
Member

Can you please also rename the corev1 import to core so we can diff cleanly?

diff pkg/apis/core/helper/qos/qos.go staging/src/k8s.io/kubectl/pkg/util/qos/qos.go
2c2
< Copyright 2017 The Kubernetes Authors.
---
> Copyright 2015 The Kubernetes Authors.
17,18d16
< // NOTE: DO NOT use those helper functions through client-go, the
< // package path will be changed in the future.
21a20
>       corev1 "k8s.io/api/core/v1"
24d22
<       "k8s.io/kubernetes/pkg/apis/core"
27c25
< var supportedQoSComputeResources = sets.NewString(string(core.ResourceCPU), string(core.ResourceMemory))
---
> var supportedQoSComputeResources = sets.NewString(string(corev1.ResourceCPU), string(corev1.ResourceMemory))

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 15, 2021
@pacoxu
Copy link
Member Author

pacoxu commented Sep 15, 2021

Updated @eddiezane
Thanks for the comments.

➜  kubernetes git:(kubectl-qos) diff pkg/apis/core/helper/qos/qos.go staging/src/k8s.io/kubectl/pkg/util/qos/qos.go
2c2
< Copyright 2017 The Kubernetes Authors.
---
> Copyright 2015 The Kubernetes Authors.
17,18d16
< // NOTE: DO NOT use those helper functions through client-go, the
< // package path will be changed in the future.
24c22
< 	"k8s.io/kubernetes/pkg/apis/core"
---
> 	core "k8s.io/api/core/v1"
37d34
< // When this function is updated please also update staging/src/k8s.io/kubectl/pkg/util/qos/qos.go

@pacoxu pacoxu force-pushed the kubectl-qos branch 2 times, most recently from 3db4774 to ac27f29 Compare September 15, 2021 06:03
@eddiezane
Copy link
Member

Thank you!

/approve

@eddiezane
Copy link
Member

/assign @lavalamp

For the comment approval.

@pacoxu
Copy link
Member Author

pacoxu commented Nov 1, 2021

Kindly ping @liggitt @lavalamp

@pacoxu
Copy link
Member Author

pacoxu commented Nov 1, 2021

@eddiezane approved the change in kubectl staging/src/k8s.io/kubectl/OWNERS [eddiezane]
There is a small change in pkg/apis/OWNERS comment.

@liggitt
Copy link
Member

liggitt commented Nov 1, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eddiezane, liggitt, pacoxu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2021
@kerthcet
Copy link
Member

kerthcet commented Nov 2, 2021

maybe it's better to add a note like init containers are included also
whatever /lgtm

@kerthcet
Copy link
Member

kerthcet commented Nov 2, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2021
@k8s-ci-robot k8s-ci-robot merged commit 6ebd6f3 into kubernetes:master Nov 2, 2021
SIG CLI automation moved this from Needs review to Done Nov 2, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Nov 2, 2021
@pacoxu pacoxu deleted the kubectl-qos branch May 10, 2022 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging this pull request may close these issues.

Determining pod QoS should keep consistent with kubelet in kubectl library
8 participants