Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding import necessary plugin to authenticate to K8S #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,18 @@ Skbn uses `AZURE_STORAGE_ACCOUNT` and `AZURE_STORAGE_ACCESS_KEY` environment var

1. [In-cluster example](/examples/in-cluster)
2. [Code example](/examples/code)

## Troubleshooting

### Auth Plugin issue

It may happens when skbn try to authenticate to K8S cluster. You get the following error:

```
No Auth Provider found for name "XXX"
```
When XXX may be: azure, gcp, oidc...

To solve it, you have to uncomment the import of plugin that you need on `pkg/skbn/kube.go`

Finally, build the project and it should work.
9 changes: 9 additions & 0 deletions pkg/skbn/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ import (
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/remotecommand"
//
// Uncomment to load all auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth"
//
// Or uncomment to load specific auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth/azure"
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
// _ "k8s.io/client-go/plugin/pkg/client/auth/openstack"
)

// K8sClient holds a clientset and a config
Expand Down