kubeswitch icon indicating copy to clipboard operation
kubeswitch copied to clipboard

Can it work without permissions to scan for namespaces ?

Open mar1ged opened this issue 1 year ago • 1 comments

At the company I work for we are not allowed to scan for namespaces. When I try to do so I am denied and when using kubectl I have to pay attention not to forget the -n foo parameter.

I gave kubeswitch a try and it seems to fail for the same reason:

2023/02/23 08:14:16 error from api: namespaces is forbidden: User "menotyou" cannot list resource "namespaces" in API group "" at the cluster scope

Using the switch config I told kubeswitch to use a single kubeconfig file. All of my kubeconfig files (I have one per cluster/context) have the namespace configured so that I only need to do something like KUBECONFIG=~/config/config1.yml kubectl get po and can dump the -n.

- context:
    cluster: ...
    user: ...
  name: ...
  namespace: foo

I assume that kubeswitch always scans for namespaces even if (in my scenario) this is undesired / not necessary. I really would like to use kubeswitch but I guess in the current state I can't use it. Am I right ? Or is there a workaround ?

mar1ged avatar Feb 23 '23 07:02 mar1ged