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

Remove get all entirely #1584

Closed
raxod502-plaid opened this issue Apr 9, 2024 · 16 comments
Closed

Remove get all entirely #1584

raxod502-plaid opened this issue Apr 9, 2024 · 16 comments
Labels
needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@raxod502-plaid
Copy link

This is another copy of #599 since the linked issue #151 was incorrectly closed again even though the issue is still an issue and nothing has been done to resolve it.

This is not a bug report nor question, it's a meta issue to reopen another issue.

#151 is about:

Bad documentation (which is solved now)
Kubernetes not having a reasonably simple API to query "ALL" resources in a namespace (which is not resolved yet.)
As many commented there that command doesn't work for me too with the same error they reported.

As that issue is not resolved yet and adding comments to a closed issue doesn't bring any attention I create this issue to ask you kindly reopen that issue (and do not close it nor any other issues until they're solved).

@raxod502-plaid raxod502-plaid added the kind/bug Categorizes issue or PR as related to a bug. label Apr 9, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 9, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@ah8ad3
Copy link
Member

ah8ad3 commented Apr 11, 2024

There are some limitation that you probably saw in this link and original PR of all.
And also these two comments
#151 (comment)

The all alias won't be removed for compatibility reasons but has been removed from command help for several releases. I agree it should not be promoted as it is confusing.

#151 (comment)

The all category is entirely specified server-side in discovery docs, and resolved generically client-side like any other category. It's unclear how we would communicate it was deprecated to users of that feature without adding special case logic specific to "all" client-side, which we do not want to do.

I'm putting these for the next person who wants to take a look at this issue.

@raxod502-plaid
Copy link
Author

I still have to say I do not understand the claim that "it's unclear how we would communicate it was deprecated". Kubernetes makes breaking changes all the time, there is a supported version skew between client and server versions, and users must read the changelog when upgrading their cluster.

It seems like the responses in that thread are saying "we can literally never remove this for the rest of time", and I just do not understand how that could possibly be the case.

@brianpursley
Copy link
Member

I can tell you are frustrated that the original issue was closed, but I'm not sure opening another issue is the best way to communicate the problem.

What is the specific change that you are asking for?

If it is for kubectl get all to return all resources, I think it has already been stated that the argument all is in fact referring to a resource category named "all", and not literally all resources. With kubectl get all, you are in-effect saying "give me all the resources that belong to a category named all".

You can see what I'm talking about if you run kubectl api-resources -o wide using a recent version of kubectl, which shows you the names of the categories to which each resource belongs, if any.

Notice below that only some resources belong to the "all" category (see the last column):

~ $ kubectl api-resources -o wide
NAME                                SHORTNAMES   APIVERSION                        NAMESPACED   KIND                               VERBS                                                        CATEGORIES
bindings                                         v1                                true         Binding                            create                                                       
componentstatuses                   cs           v1                                false        ComponentStatus                    get,list                                                     
configmaps                          cm           v1                                true         ConfigMap                          create,delete,deletecollection,get,list,patch,update,watch   
endpoints                           ep           v1                                true         Endpoints                          create,delete,deletecollection,get,list,patch,update,watch   
events                              ev           v1                                true         Event                              create,delete,deletecollection,get,list,patch,update,watch   
limitranges                         limits       v1                                true         LimitRange                         create,delete,deletecollection,get,list,patch,update,watch   
namespaces                          ns           v1                                false        Namespace                          create,delete,get,list,patch,update,watch                    
nodes                               no           v1                                false        Node                               create,delete,deletecollection,get,list,patch,update,watch   
persistentvolumeclaims              pvc          v1                                true         PersistentVolumeClaim              create,delete,deletecollection,get,list,patch,update,watch   
persistentvolumes                   pv           v1                                false        PersistentVolume                   create,delete,deletecollection,get,list,patch,update,watch   
pods                                po           v1                                true         Pod                                create,delete,deletecollection,get,list,patch,update,watch   all
podtemplates                                     v1                                true         PodTemplate                        create,delete,deletecollection,get,list,patch,update,watch   
replicationcontrollers              rc           v1                                true         ReplicationController              create,delete,deletecollection,get,list,patch,update,watch   all
resourcequotas                      quota        v1                                true         ResourceQuota                      create,delete,deletecollection,get,list,patch,update,watch   
secrets                                          v1                                true         Secret                             create,delete,deletecollection,get,list,patch,update,watch   
serviceaccounts                     sa           v1                                true         ServiceAccount                     create,delete,deletecollection,get,list,patch,update,watch   
services                            svc          v1                                true         Service                            create,delete,deletecollection,get,list,patch,update,watch   all
mutatingwebhookconfigurations                    admissionregistration.k8s.io/v1   false        MutatingWebhookConfiguration       create,delete,deletecollection,get,list,patch,update,watch   api-extensions
validatingadmissionpolicies                      admissionregistration.k8s.io/v1   false        ValidatingAdmissionPolicy          create,delete,deletecollection,get,list,patch,update,watch   api-extensions
validatingadmissionpolicybindings                admissionregistration.k8s.io/v1   false        ValidatingAdmissionPolicyBinding   create,delete,deletecollection,get,list,patch,update,watch   api-extensions
validatingwebhookconfigurations                  admissionregistration.k8s.io/v1   false        ValidatingWebhookConfiguration     create,delete,deletecollection,get,list,patch,update,watch   api-extensions
customresourcedefinitions           crd,crds     apiextensions.k8s.io/v1           false        CustomResourceDefinition           create,delete,deletecollection,get,list,patch,update,watch   api-extensions
apiservices                                      apiregistration.k8s.io/v1         false        APIService                         create,delete,deletecollection,get,list,patch,update,watch   api-extensions
controllerrevisions                              apps/v1                           true         ControllerRevision                 create,delete,deletecollection,get,list,patch,update,watch   
daemonsets                          ds           apps/v1                           true         DaemonSet                          create,delete,deletecollection,get,list,patch,update,watch   all
deployments                         deploy       apps/v1                           true         Deployment                         create,delete,deletecollection,get,list,patch,update,watch   all
replicasets                         rs           apps/v1                           true         ReplicaSet                         create,delete,deletecollection,get,list,patch,update,watch   all
statefulsets                        sts          apps/v1                           true         StatefulSet                        create,delete,deletecollection,get,list,patch,update,watch   all
selfsubjectreviews                               authentication.k8s.io/v1          false        SelfSubjectReview                  create                                                       
tokenreviews                                     authentication.k8s.io/v1          false        TokenReview                        create                                                       
localsubjectaccessreviews                        authorization.k8s.io/v1           true         LocalSubjectAccessReview           create                                                       
selfsubjectaccessreviews                         authorization.k8s.io/v1           false        SelfSubjectAccessReview            create                                                       
selfsubjectrulesreviews                          authorization.k8s.io/v1           false        SelfSubjectRulesReview             create                                                       
subjectaccessreviews                             authorization.k8s.io/v1           false        SubjectAccessReview                create                                                       
horizontalpodautoscalers            hpa          autoscaling/v2                    true         HorizontalPodAutoscaler            create,delete,deletecollection,get,list,patch,update,watch   all
cronjobs                            cj           batch/v1                          true         CronJob                            create,delete,deletecollection,get,list,patch,update,watch   all
jobs                                             batch/v1                          true         Job                                create,delete,deletecollection,get,list,patch,update,watch   all
certificatesigningrequests          csr          certificates.k8s.io/v1            false        CertificateSigningRequest          create,delete,deletecollection,get,list,patch,update,watch   
leases                                           coordination.k8s.io/v1            true         Lease                              create,delete,deletecollection,get,list,patch,update,watch   
endpointslices                                   discovery.k8s.io/v1               true         EndpointSlice                      create,delete,deletecollection,get,list,patch,update,watch   
events                              ev           events.k8s.io/v1                  true         Event                              create,delete,deletecollection,get,list,patch,update,watch   
flowschemas                                      flowcontrol.apiserver.k8s.io/v1   false        FlowSchema                         create,delete,deletecollection,get,list,patch,update,watch   
prioritylevelconfigurations                      flowcontrol.apiserver.k8s.io/v1   false        PriorityLevelConfiguration         create,delete,deletecollection,get,list,patch,update,watch   
ingressclasses                                   networking.k8s.io/v1              false        IngressClass                       create,delete,deletecollection,get,list,patch,update,watch   
ingresses                           ing          networking.k8s.io/v1              true         Ingress                            create,delete,deletecollection,get,list,patch,update,watch   
networkpolicies                     netpol       networking.k8s.io/v1              true         NetworkPolicy                      create,delete,deletecollection,get,list,patch,update,watch   
runtimeclasses                                   node.k8s.io/v1                    false        RuntimeClass                       create,delete,deletecollection,get,list,patch,update,watch   
poddisruptionbudgets                pdb          policy/v1                         true         PodDisruptionBudget                create,delete,deletecollection,get,list,patch,update,watch   
clusterrolebindings                              rbac.authorization.k8s.io/v1      false        ClusterRoleBinding                 create,delete,deletecollection,get,list,patch,update,watch   
clusterroles                                     rbac.authorization.k8s.io/v1      false        ClusterRole                        create,delete,deletecollection,get,list,patch,update,watch   
rolebindings                                     rbac.authorization.k8s.io/v1      true         RoleBinding                        create,delete,deletecollection,get,list,patch,update,watch   
roles                                            rbac.authorization.k8s.io/v1      true         Role                               create,delete,deletecollection,get,list,patch,update,watch   
priorityclasses                     pc           scheduling.k8s.io/v1              false        PriorityClass                      create,delete,deletecollection,get,list,patch,update,watch   
csidrivers                                       storage.k8s.io/v1                 false        CSIDriver                          create,delete,deletecollection,get,list,patch,update,watch   
csinodes                                         storage.k8s.io/v1                 false        CSINode                            create,delete,deletecollection,get,list,patch,update,watch   
csistoragecapacities                             storage.k8s.io/v1                 true         CSIStorageCapacity                 create,delete,deletecollection,get,list,patch,update,watch   
storageclasses                      sc           storage.k8s.io/v1                 false        StorageClass                       create,delete,deletecollection,get,list,patch,update,watch   
volumeattachments                                storage.k8s.io/v1                 false        VolumeAttachment                   create,delete,deletecollection,get,list,patch,update,watch   

Does this help explain why kubectl get all does not return all resources?

If you really need the all behavior, I recommend checking out this plugin to see if it works for you:
https://github.com/corneliusweig/ketall

@raxod502-plaid
Copy link
Author

I'm not sure opening another issue is the best way to communicate the problem.

Is there a better way? Commenting on the original issue thread would not accomplish anything.

What is the specific change that you are asking for?

As was stated by a large number of people in the original issue thread, the ask is that kubectl get all be removed since it is unofficially deprecated, recommended against, undocumented, and misleading.

Does this help explain why kubectl get all does not return all resources?

Yes, but that is not the question being asked.

@sftim
Copy link
Contributor

sftim commented Apr 23, 2024

As was stated by a large number of people in the original issue thread, the ask is that kubectl get all be removed since it is unofficially deprecated, recommended against, undocumented, and misleading.

You could open a feature request issue calling for that outcome @raxod502-plaid. Consider a title such as:
Remove kubectl get all

@sftim
Copy link
Contributor

sftim commented Apr 23, 2024

/remove-kind bug

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. and removed kind/bug Categorizes issue or PR as related to a bug. labels Apr 23, 2024
@sftim
Copy link
Contributor

sftim commented Apr 23, 2024

I don't see that the closure was done by mistake. #151 (comment) looks intentional.

/priority awaiting-more-evidence

@k8s-ci-robot k8s-ci-robot added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Apr 23, 2024
@raxod502-plaid
Copy link
Author

The closure may have been "intentional" by the person who executed it, but issue reactions show that 132 people disagreed with that decision, and 0 people agreed with it. Also, it was (correctly) re-opened later upon request in #599 because the issue was not resolved.

Anyway, I filed #1591 per your request to have a fourth issue tracking this problem. Let me know if anything else is required.

@ardaguclu
Copy link
Member

@raxod502-plaid Due to backwards compatibility issues, I don't think we'll ever remove get all entirely. Yes, it will stay as deprecated and we'll continue recommending people to NOT using it. But we can't simply remove.

This issue is already open, why do you prefer to track this work in another #1591 issue?.

@ardaguclu ardaguclu changed the title Unresolved issue mistakenly closed, please reopen (again) Remove get all entirely Apr 25, 2024
@ardaguclu
Copy link
Member

I think this comment #1584 (comment) explains well about the issue and since we can't remove get all. I think, we can also close this issue as won't fix.

@raxod502-plaid
Copy link
Author

This issue is already open, why do you prefer to track this work in another #1591 issue?

I don't prefer that, in fact I think #1591 is a needless duplicate. The only reason I opened it is because @sftim specifically asked me to do so in #1584 (comment).

Due to backwards compatibility issues, I don't think we'll ever remove get all entirely

This does not make sense to me. Could you address #1584 (comment)?

@brianpursley
Copy link
Member

It's not really possible to "deprecate" the all category because it is metadata provided by the resource types.

It's not like there is code in kubectl looking for a keyword of all and choosing only to return those resource types.

Therefore, this isn't even something kubectl can do, and it needs to be raised in the k/k repo for discussion there. I'm not sure which sig that would be, but it is not CLI.

Arguing about it here will accomplish nothing.

@raxod502-plaid
Copy link
Author

It's not really possible to "deprecate" the all category because it is metadata provided by the resource types.

I think I see the problem. When statements like this have been made, what was actually meant has been: It's not really possible to "deprecate" the all category in kubectl specifically because it is metadata provided by the resource types, so it's necessary to perform the deprecation on the server side instead.

This issue probably could have been moved along a lot faster if somebody had mentioned before that it had been filed against the wrong tracker, as opposed to just saying "this is impossible", since it clearly isn't impossible to solve the problem.

I've filed kubernetes/kubernetes#124538 and hopefully we can get the ball rolling after 7 years.

@brianpursley
Copy link
Member

This issue probably could have been moved along a lot faster if somebody had mentioned before that it had been filed against the wrong tracker, as opposed to just saying "this is impossible", since it clearly isn't impossible to solve the problem.

Everyone here has tried to be helpful 🤷‍♂️

I'm going to go ahead and close this issue, since you now have opened the other one in k/k.

@brianpursley
Copy link
Member

/close not-planned
/triage duplicate

@k8s-ci-robot k8s-ci-robot added the triage/duplicate Indicates an issue is a duplicate of other open issue. label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

6 participants