Closed mailsanchu closed 1 year ago
Currently it does not support such flag.
As alternative solution, you can try KUBECONFIG=${path-to-config} kubectl grep ...
instead.
Ref: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/
I do have contexts configured in KUBECONFIG. I need to use the following command to change the context I want
kubectl config use-context
svarkey@svarkey-Precision-7760:~$ kubectl grep pods -l name=test --context cs-prod1 Error: unknown flag: --context Usage: kubectl-grep pods [flags]
Aliases: pods, po, pod
Flags: -h, --help help for pods -o, --output string Output format.
Global Flags: -A, --all-namespaces If present, list the requested object(s) across all namespaces. --field-selector string Selector (field query) to filter on. (e.g. --field-selector key1=value1,key2=value2) -n, --namespace string Namespace for search. (default: "default") -l, --selector string Selector (label query) to filter on. (e.g. -l key1=value1,key2=value2)
unknown flag: --context