Allow a wildcard in identifying a name (shown with an example) #1685
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
needs-sig
Indicates an issue or PR lacks a `sig/foo` label and requires one.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
sig/cli
Categorizes an issue or PR as relevant to SIG CLI.
Enhancement Description
Allow a wildcard (* OR %) for long podnames for those who do not like to do copy/paste
Here is my example i am talking about:
I only have two pods, but they have long names. Instead of doing copy/paste of the whole podname, I would like
to have to get the whole name by using a wild card-
Here is my scenerio
++++++++++++
[sysadmin@localhost mp_k8s_exercise]$ kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
helloworld-cc47658f5-zs9nq 1/1 Running 0 17d 10.1.102.152 localhost.localdomain
nginx-webserver-7fc8bbdbb7-twmhg 1/1 Running 0 18d 10.1.102.148 localhost.localdomain
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx* -- cat /etc/hosts
Error from server (NotFound): pods "nginx*" not found
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx-webserver-* -- cat /etc/hosts
Error from server (NotFound): pods "nginx-webserver-*" not found
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx-webserver-7fc8bbdbb7-twmhg -- cat /etc/hosts
Kubernetes-managed hosts file.
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters
10.1.102.148 nginx-webserver-7fc8bbdbb7-twmhg
[sysadmin@localhost mp_k8s_exercise]$ pwd
/home/sysadmin/mp_k8s_exercise
[sysadmin@localhost mp_k8s_exercise]$
+++++++++++++
What I would have liked to see is if i could what i was trying to do earlier:
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx* -- cat /etc/hosts (* for all chars following nginx*) (% for single char )
Error from server (NotFound): pods "nginx*" not found
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx-webserver-* -- cat /etc/hosts
Error from server (NotFound): pods "nginx-webserver-*" not found
[sysadmin@localhost mp_k8s_exercise]$
I should be able to use a wild card like (* for all chars - and % for single char) to get the rest of the podname -
As far as there is no conflict, kubectl should be able to give me and identify long podnames by using wildcard.
I believe this will be beneficial to all kubectl users - not just me who is not always comfortable doing copy/paste.
I hope this reaches to the right team.
Regards
MPattani
The text was updated successfully, but these errors were encountered: