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

Add more columns to CRDs #588

Closed
howardjohn opened this issue Mar 19, 2021 · 7 comments
Closed

Add more columns to CRDs #588

howardjohn opened this issue Mar 19, 2021 · 7 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@howardjohn
Copy link
Contributor

What would you like to be added:
We should add more columns to the CRDs to expose useful information in kubectl. For example, we can expose Admitted for most types:

$ k get gc
NAME    CONTROLLER                    ADMITTED
istio   istio.io/gateway-controller   True

I would also suggest adding AGE to align with most other k8s types.
Why is this needed:
Useful to expose info here.

@howardjohn howardjohn added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 19, 2021
@howardjohn
Copy link
Contributor Author

Related: #586

@robscott
Copy link
Member

Agree that this would be great to have. #592 adds a "Created At" column, but I think "Admitted" is going to be more difficult here. Unfortunately additionalPrinterColumns just does not handle status conditions (or other lists) well. We could follow the same approach I proposed in #587 and add a new field to status just to improve kubectl get output. Alternatively we could push to get better support built into upstream. Of course if this API itself ever does end up becoming built into k/k, many of these problems would go away on their own.

@howardjohn
Copy link
Contributor Author

You can do it with .status.conditions[?(@.type=="Admitted")].status

Also can do it directly like kubectl get gatewayclass -o 'custom-columns=NAME:.metadata.name,HEALTHY:.status.conditions[?(@.type=="Admitted")].status'

For the ones that are nested (listener status) I don't know how to handle though.

@robscott
Copy link
Member

@howardjohn Unfortunately I haven't been able to get that to work for additionalPrinterColumns. It seems that the implementation between custom-columns in kubectl and additionalPrinterColumns is quite different. For example, running this works:

kubectl get gateway -o'custom-columns=NAME:metadata.name,TEST:.spec.listeners[?(@.protocol=="HTTP")].routes.selector'

but unfortunately adding the same logic to additionalPrinterColumns just returns empty. I've seen this kind of similar pattern for anything other than a simple path lookup.

@howardjohn
Copy link
Contributor Author

Hm.. it seems like cert-manager is doing this: https://github.com/jetstack/cert-manager/pull/1194/files#diff-4cd218a9d6c5b00138ca643ec6b983015ba906cff00011340e798d668b9dfa39R27. Not sure what the gap is. The additionalPrinterColumns stuff is a bit frustrating

@hbagdi hbagdi added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label May 25, 2021
@robscott
Copy link
Member

robscott commented Aug 6, 2021

I think one of the best solutions that's been proposed so far involves a mutating webhook that populates new fields just for kubectl output. That would allow us the ability to customize all output with a great deal of control. Of course there's a lot of overhead in a webhook. With the recent ReferencePolicy addition, it's clear that more output fields would be helpful there as well, but since it's essentially two lists of structs, it's very difficult without something like a webhook.

More info and discussion is in #629.

@shaneutt
Copy link
Member

shaneutt commented Aug 5, 2022

While grooming we saw that this one was open for a long period of time without anyone with a strong use case to champion it. We're going to close this as we don't expect anyone's ready to drive it forward, but if you still want this feature and have a strong use case we will be happy to reconsider this and re-open.

@shaneutt shaneutt closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

4 participants