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)
@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
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 alsodaemonset
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:
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…
Otherwise, I’d say there’s quite a few missing resources - considering the “all” flag:
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)
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 prototypekubectl apply
s. It would be nice if I were actually able to get all when Iget all
. Is there anything that would be helpful for resolving this?/remove-lifecycle stale
The issue is still valid for:
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.