I am seeking to how to be able to use multiple parameter on kubernetes. For example:
kubectl get pods -n default || kube-system
(but the results of this query come out only the result of default namespace).
How can I use multiple params?
try this
kubectl get po --all-namespaces | grep kube-system
or even better
kubectl get po --all-namespaces | grep -iE 'dns|api'
You can't query for multiple namespaces resources in one command. As there is explanation why it is not worth to do that on this github issue
But you can query for multiple resources across one or --all-namespaces
. For example got get services
and pods
for namespace kube-dns
and default
(this will include workaround as @PEkambaram suggested)
kubectl get svc,pods --all-namespaces |egrep -e 'kube-dns|default'