kubernetes client-go plugin exec command not found on Windows 10

Kubernetes client-go already have helper methods for authentication using kubeconfig. It contains two variants with good examples:

  • Out of cluster authentication example
  • In cluster authentication example

I would recommend to use two built-in helper methods instead of rolling a custom variant. You may perhaps want to add an argument so that you can switch between the two, e.g. using out-of-cluster when running locally on Windows and in-cluster when the app (if your code is an app?) is running as a service in the cluster.