testkube icon indicating copy to clipboard operation
testkube copied to clipboard

Support ServiceAccount in Testkube CLI

Open rangoo94 opened this issue 1 year ago • 4 comments

Describe the enhancement you'd like to see

At the moment, when Testkube CLI is running within Kubernetes, we need to either:

  • try to convert service account to kubeconfig, or
  • use --client direct with internal API URL

It would be great if Testkube CLI would use the provided Service Account, similarly to kubernetes/client-go's example.

The logic responsible for connecting with Kubernetes is here.

Additional context

As an example, using bitnami/kubectl image with service account in Kubernetes will lead to kubectl working automatically.

rangoo94 avatar Jan 17 '24 12:01 rangoo94

can you give an example of the command that the user is going to write ?

TheBrunoLopes avatar Jan 17 '24 12:01 TheBrunoLopes

Any kind of command. As an example, testkube run test example-test to schedule a test from within Kubernetes cluster.

rangoo94 avatar Jan 17 '24 12:01 rangoo94

Yes. Is there an alternative, perhaps more declarative pattern for triggering a test other than invoking testkube CLI?

It's one thing to sync the test definitions to Kubernetes with a GitOps approach.

But what about invoking the tests using similar GitOps approach? Demo/docs only mention testkube CLI.

Screenshot_20240227-164426

CLI could be run as a (Cron)Job but doesn't support ServiceAccount-mapped tokens.

kennethredler avatar Feb 27 '24 22:02 kennethredler

sure, http://docs.testkube.io/articles/test-executions

vsukhin avatar Feb 28 '24 05:02 vsukhin