eathar icon indicating copy to clipboard operation
eathar copied to clipboard

Doesn't work with GKE

Open raesene opened this issue 3 years ago • 1 comments

At the moment this tool doesn't work with GKE, due to the way their authentication plugin is setup

eathar rbac wildcardusers
{"level":"debug","time":"2022-12-22T17:21:22Z","message":"initKubeClient: failed creating Clientset with%!(EXTRA *errors.errorString=no Auth Provider found for name \"gcp\")"}
{"level":"debug","time":"2022-12-22T17:21:22Z","message":"no Auth Provider found for name \"gcp\""}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x128 pc=0x11ff233]

goroutine 1 [running]:
k8s.io/client-go/kubernetes.(*Clientset).RbacV1(...)
        /home/runner/go/pkg/mod/k8s.io/[email protected]/kubernetes/clientset.go:357
github.com/raesene/eathar/pkg/eathar.WildcardAccess(0x0?)
        /home/runner/work/eathar/eathar/pkg/eathar/rbac.go:335 +0xd3
github.com/raesene/eathar/cmd.glob..func29(0x2033a00?, {0x14adb86?, 0x0?, 0x0?})
        /home/runner/work/eathar/eathar/cmd/wildcarduser.go:21 +0x3b
github.com/spf13/cobra.(*Command).execute(0x2033a00, {0x20784d0, 0x0, 0x0})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0x2033000)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:918
github.com/raesene/eathar/cmd.Execute()
        /home/runner/work/eathar/eathar/cmd/root.go:25 +0x25
main.main()
        /home/runner/work/eathar/eathar/main.go:10 +0x17

raesene avatar Dec 22 '22 17:12 raesene

This can be fixed, we need to use the new external plugin for GKE auth

export USE_GKE_GCLOUD_AUTH_PLUGIN=True

and then get the creds for the cluster again. At that point it should work.

Need docs for this case.

raesene avatar Dec 22 '22 17:12 raesene