kubernetes: `kubectl get all` does not include ingress resources

Is this a request for help?: It’s a bug. What keywords did you search in Kubernetes issues before filing this one?

  • kubectl get ing all
  • kubectl get ingress all

Kubernetes version (use kubectl version):

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"2017-02-15T06:40:50Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"2017-02-15T06:34:56Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration: OpenStack
  • OS (e.g. from /etc/os-release): Ubuntu 16.04
  • Kernel (e.g. uname -a): Linux ee92b6b188ca 3.19.0-pf4+ #1 SMP Sat Jan 2 11:59:23 UTC 2016 x86_64 Linux

What you expected to happen: I expected command kubectl get all to include Ingress Kubernetes resources. It did not.

How to reproduce it: When I list resources to be printed, it works as expected:

$ kubectl get deploy,pod,rs,svc,ing -n testing
NAME                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/nginx-testing   1         1         1            1           2h

NAME                                READY     STATUS    RESTARTS   AGE
po/nginx-testing-2964101761-v39tl   1/1       Running   0          26m

NAME                          DESIRED   CURRENT   READY     AGE
rs/nginx-testing-2964101761   1         1         1         2h

NAME                CLUSTER-IP    EXTERNAL-IP   PORT(S)    AGE
svc/nginx-testing   10.32.0.233   <none>        8000/TCP   2h

NAME                HOSTS                          ADDRESS   PORTS     AGE
ing/nginx-testing   nginx-testing.example.com             80        2h

When instead of a resources list, I use: all, Ingress resources are not included:

$ kubectl get all -n testing
NAME                                READY     STATUS    RESTARTS   AGE
po/nginx-testing-2964101761-v39tl   1/1       Running   0          26m

NAME                CLUSTER-IP    EXTERNAL-IP   PORT(S)    AGE
svc/nginx-testing   10.32.0.233   <none>        8000/TCP   2h

NAME                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/nginx-testing   1         1         1            1           2h

NAME                          DESIRED   CURRENT   READY     AGE
rs/nginx-testing-2964101761   1         1         1         2h

Anything else: I am not sure if using all instead if a resources list is the official feature, because it is not documented on: https://kubernetes.io/docs/user-guide/kubectl/kubectl_get/

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 24
  • Comments: 35 (9 by maintainers)

Most upvoted comments

@Nowaker thanks for your feedback. We will not be revisiting this issue.

The all alias is no longer documented or its use encouraged, because it cannot be safely changed without breaking existing scripts. Ingress resources won’t be added to that alias.

/close

The all alias is no longer documented or its use encouraged, because it cannot be safely changed without breaking existing scripts. Ingress resources won’t be added to that alias.

What a silly reason to close. “Do not use or depend on the behavior” but at the same time “won’t fix because it would break existing scripts”.

Not only ingress, but also daemonset etc

@PMende just do a terminal alias for kubectl get pods; kubectl get services; kubectl get ...

if “get all” can’t be changed because it would break existing scripts, then why not just add “get any” and then people can still have the old way and the new way at the same time without conflicts.

also, why is “get all” being removed? It was decided but there is no explanation why it was decided and where it was discussed? I don’t find this very a useful description of why this was closed and where I can read about it.

can you please post a link to the discussion where this decision was made? I personally don’t think it’s a good solution to remove the alias because changing it would break too many things, just remove the old one and create another. There are plenty of words in the english language to simulate the idea of “all”, you can use “any”, “everything”, “*”, etc, etc.

If you screwed up and now you can’t change it, fine. But please don’t remove functionality people like to use. I’ll give you a good use case for this “all” flag which is to remove an entire app from my cluster filtering by label, I can list all the resources, check them, then if I’m ok with it, ask kubectl to delete them all.

What’s the current situation of this? 👀

For those who stumble into the issue trying to find all your ingresses, the command is:

kubectl get ing -A

Changing what resources are returned by the “all” alias can break existing scripts, etc. see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-cli/kubectl-conventions.md#rules-for-extending-special-resource-alias---all for guidelines on which resources were included.

I was going to create a bug report but see one already exists. I’m seeing similar problems (maybe because my CLI version is ahead of cluster version?), but wanted to make it noted that it’s not just ingresses that might be missing…

kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.2", GitCommit:"bdaeafa71f6c7c04636251031f93464384d54963", GitTreeState:"clean", BuildDate:"2017-10-24T19:48:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7+", GitVersion:"v1.7.8-gke.0", GitCommit:"a7061d4b09b53ab4099e3b5ca3e80fb172e1b018", GitTreeState:"clean", BuildDate:"2017-10-10T18:48:45Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

Otherwise, I’d say there’s quite a few missing resources - considering the “all” flag:

$ kubectl get all -l allRelated=someRandom
NAME                       DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/someRandom-deploy   2         2         2            2           1d

NAME                              DESIRED   CURRENT   READY     AGE
rs/someRandom-deploy-1444389605   2         2         2         11h

NAME                       DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/someRandom-deploy   2         2         2            2           1d

NAME                 REFERENCE                      TARGETS    MINPODS   MAXPODS   REPLICAS   AGE
hpa/someRandom-hpa   Deployment/someRandom-deploy   6% / 50%   2         6         2          1d

NAME                                    READY     STATUS    RESTARTS   AGE
po/someRandom-deploy-1444389605-1ldtt   1/1       Running   0          11h
po/someRandom-deploy-1444389605-32hxt   1/1       Running   0          11h

$ kubectl get svc -l allRelated=someRandom
NAME             TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
someRandom-svc   ClusterIP   X.X.X.X   <none>        80/TCP    11h

$ kubectl get pdb -l allRelated=someRandom
NAME             MIN AVAILABLE   MAX UNAVAILABLE   ALLOWED DISRUPTIONS   AGE
someRandom-pdb   N/A             1                 1                     6d

$ kubectl get ing -l allRelated=someRandom
NAME                 HOSTS                             ADDRESS            PORTS     AGE
ing-int-someRandom   someRandom-staging.dock-yard.io   X.X.X.X...   80, 443   11h

Also two deployments were in the results above, but if i try to return just deployments only one is returned (which is expected as I don’t have two with the same label attached)

$ kubectl get deploy -l allRelated=someRandom
NAME                DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
someRandom-deploy   2         2         2            2           1d

I’m trying to understand the rationale beyond the guidelines referenced for what is to be included or not be included. For example, no namespace admin level resource, if a person doesn’t have privileges to access or edit those privileges then there is protection that way.

It seems like perhaps we should have some variations of it. For example:

  • all
  • all-admin

I would really interested in a resolution. I make ready use of kubectl get all combined with awk to troubleshoot borked prototype kubectl applys. It would be nice if I were actually able to get all when I get all. Is there anything that would be helpful for resolving this?

/remove-lifecycle stale

The issue is still valid for:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.4", GitCommit:"5ca598b4ba5abb89bb773071ce452e33fb66339d", GitTreeState:"clean", BuildDate:"2018-06-06T08:13:03Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.4", GitCommit:"5ca598b4ba5abb89bb773071ce452e33fb66339d", GitTreeState:"clean", BuildDate:"2018-06-06T08:00:59Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

I’d like to see ingresses shown in “get all”. (I tried filing a bug in the ingress repo, was directed here to the k/k repo. See kubernetes/ingress#1483 )

try to fix in https://github.com/kubernetes/kubernetes/pull/42954, but still need to @liggitt confirm whether we should do that.