func NewKubernetesClient(kubeconfig string) (*KubernetesClientImpl, error) {
	var config *rest.Config
	var err error
	if kubeconfig != "" {
		config, err = clientcmd.BuildConfigFromFlags("", kubeconfig)
	} else {
		config, err = rest.InClusterConfig()
	}
	if err != nil {
		return nil, err
	}
	clientset, err := kubernetes.NewForConfig(config)
	if err != nil {
		return nil, err
	}
	return &KubernetesClientImpl{
		clientset: clientset,
	}, nil
}
NewKubernetesClient returns a client capable of talking to the API server
of a Kubernetes cluster specified in the given kubeconfig filepath. If no
kubeconfig filepath is specified, it assumes it's running inside a Kubernetes
cluster, and will try to connect to it via the exposed service account.
package kubernetes
import (
	"regexp"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"
	apiv1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type KubernetesClient interface {
	ListAllPods(namespace []*string) ([]*apiv1.Pod, error)
}
type KubernetesClientImpl struct {
	clientset *kubernetes.Clientset
}