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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃尡 Add desired number column to KCP, MD, MS, MachinePool #6164
馃尡 Add desired number column to KCP, MD, MS, MachinePool #6164
Conversation
Welcome @Bo0km4n! |
Hi @Bo0km4n. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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 this @Bo0km4n! I see at the moment we have:
KubeadmControlPlane
NAME CLUSTER INITIALIZED API SERVER AVAILABLE REPLICAS READY UPDATED UNAVAILABLE AGE VERSION
cloister-9l2n7 cloister true true 3 3 3 0 24h v1.21.2
MachineDeployments:
NAME CLUSTER REPLICAS READY UPDATED UNAVAILABLE PHASE AGE VERSION
cloister-linux-workers-jd4qq cloister 3 3 3 0 Running 24h v1.21.2
MachineSets:
NAME CLUSTER REPLICAS READY AVAILABLE AGE VERSION
my-cluster-default-worker-topo-bjn28-66767779f7 my-cluster 1 21h v1.22.0
Kubernetes deployment:
NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
capd-system capd-controller-manager 1/1 1 1 25h
Kubernetes daemonset:
NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
kube-system kindnet 1 1 1 1 1 <none> 25h
I think if we're going to add desired to our KCP machines we should do the same for machineDeployments.
But I think there's a broader question of whether we want to align more with the Kubernetes is doing things here (and how wide is too wide 馃槃 ) We could also implement an -o wide option which I don't think we have anywhere (not certain how hard that would be to implement)
@killianmuldoon Thanks. I will add also desired number column to We can set priority param to comment such as
So I want to add column like aboves with priority param to |
Thanks for looking into that! I'd like to get a few more folks' insight before getting you to do the implementation. @fabriziopandini @sbueringer @ykakarap WDYT? |
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
Would be nice to have |
If you worry about number of colums is too large, I suggest to combine 'desired' column with 'ready' column
|
I +1 to make this consistent across all the CAPI objects and use Kubernetes as a reference. |
IIRC the last time I did a deep-dive into kubectl about how that works, the result was that it's a client-side implementation in kubectl and impossible to do with CRDs. But it would be very nice if we can achieve it |
Here is the implementation for Deployments: https://github.com/kubernetes/kubernetes/blob/cd91e59f7c351fce47c064a5162c2cb79075159c/pkg/printers/internalversion/printers.go#L2007-L2012 But maybe there is a way to configure that behavior in a CRD that I'm not aware of. |
I was looking into how to print column such as
Is changing print-column included in breaking change api-version ? |
If you are just adding new columns without changing any of the existing columns then I don't think it will be considered a breaking change. |
In this PR, I would like to add only |
This might be okay. I will let @fabriziopandini confirm. |
If we are achieving consistency across all the CAPI objects and we are in line with Kubernetes by adding this column I'm ok, but as far as I remember showing the desired state vs the current state is a broader problem (see e.g #5332 as linked by @sbueringer in the issue). |
@fabriziopandini We have MachineDeployments, MachineSets, KubeadmControlPlane here #6164 (review) . Is there something missing that has replicas? (I'm assuming we can leave MachinePools out of the conversation for now) |
Looks like the current state is:
|
Since the |
Can I add |
Sounds good to me. Relevant prior art for me is the Daemonset and ReplicaSet Given that we consider the columns APIs and there is no way to deprecate them, I would really like to hear opinions of other maintainers before going ahead with this (or at least before merging). |
@sbueringer @killianmuldoon thanks for investigating this cross the board! Let's wait for some more feedback before acting; my two cents:
|
@Bo0km4n thank you for your patience, really appreaciated it! |
9412333
to
4e5587c
Compare
@fabriziopandini Thanks, I fixed it. |
// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this machineset" | ||
// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="Total number of machines desired by this machineset",priority=10 |
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.
// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this machineset" | |
// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="Total number of machines desired by this machineset",priority=10 | |
// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="Total number of machines desired by this machineset",priority=10 | |
// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this machineset" |
Let's use the same order in all CRDs
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.
Also in MachinePool
/retitle 馃尡 Add desired number column to KCP, MD, MS, MachinePool (to make the GitHub check happy) |
Thanks! I'm +1 to this and follow up with "current". I can't think of any drawback while it provides clear and consistent output. |
Hm does priority 10 mean it's only visible with --wide currently? |
Exactly |
I wonder if we should add this column without priority. Doesn't seem that useful if it's not visible in most cases |
It could be an idea to use -o wide as a way to 'deprecate' and add columns between API revisions, and document in the migration guide before making the change to the default output in the next version. |
I really don't like to use -o wide as a way to show/hide deprecated columns. It's purpose is that we're able to define which columns should only be shown with wide. I think we shouldn't overthink the deprecation :). Clear documentation has to be enough for things like changing columns of CRDs. |
/lgtm thanks @Bo0km4n for your first contribution to CAPI 馃コ |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
/retest |
What this PR does / why we need it:
I want to look the desired replicas number of KCP's machines when
kubectl get kcp
.So I added print column desired replicas of
KubeadmControlPlane
.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #6165