solo-io / squash

The debugger for microservices
https://squash.solo.io
Apache License 2.0
1.74k stars 102 forks source link

Add auth plugins #167

Closed anyasabo closed 5 years ago

anyasabo commented 5 years ago

Client-go supports using different authentication plugins such as OIDC. This allows users with kubeconfigs that use these auth types to use squashctl, otherwise you'd receive output such as:

$ squashctl
Attaching debugger
? Select a debugger dlv
Error: choosing namespace: error connecting to current Kubernetes Context Host $MASTER_URL; please double check your Kubernetes environment: No Auth Provider found for name "oidc"
Usage:
  squashctl [flags]
  squashctl [command]

Available Commands:
  completion  generate auto completion for your shell
  deploy      deploy squash or a demo microservice
  help        Help about any command
  squash      manage the squash
  utils       call various squash utils

Flags:
      --container string           Container to debug
      --container-repo string      debug container repo to use (default "quay.io/solo-io")
      --container-version string   debug container version to use (default "0.5.7")
      --crisock string             The path to the CRI socket (default "/var/run/dockershim.sock")
      --debugger string            Debugger to use
  -h, --help                       help for squashctl
      --json                       output json format
      --localport int              local port to use to connect to debugger (defaults to random free port)
      --machine                    machine mode input and output
      --namespace string           Namespace to debug
      --no-clean                   don't clean temporary pod when existing
      --no-guess-debugger          don't auto detect debugger to use
      --no-guess-pod               don't auto detect pod to use
      --pod string                 Pod to debug
      --squash-namespace string    the namespace where squash resources will be deployed (default: squash-debugger) (default "squash-debugger")
      --timeout int                timeout in seconds to wait for debug pod to be ready (default 300)
      --version                    version for squashctl

Use "squashctl [command] --help" for more information about a command.

choosing namespace: error connecting to current Kubernetes Context Host $MASTER_URL; please double check your Kubernetes environment: No Auth Provider found for name "oidc"

And would be unable to proceed with using squash. This doc has more info: https://github.com/kubernetes/client-go/tree/master/examples BOT NOTES: resolves https://github.com/solo-io/squash/issues/168

soloio-bot commented 5 years ago

Waiting for approval from someone in the solo-io org to start testing.

soloio-bot commented 5 years ago

Issues linked to changelog: https://github.com/solo-io/squash/issues/168

yuval-k commented 5 years ago

/test

mitchdraft commented 5 years ago

@jonsabo this is great, thank you. Would you mind merging master again? The build is failing due to some imports that have been fixed on a recent commit to master

mitchdraft commented 5 years ago

/test