func NewKubernetesClient() (kubernetes.Interface, error) {
	config, err := clientcmd.BuildConfigFromFlags("", DefaultKubernetesConfigPath)
	if err != nil {
		return nil, err
	}
	kubeClient, err := kubernetes.NewForConfig(config)
	if err != nil {
		return nil, err
	}
	return kubeClient, nil
}
NewKubernetesClient creates Kubernetes client set.
package installbase
import (
	"context"
	"encoding/json"
	"fmt"
	"strconv"
	"github.com/megaease/easemeshctl/cmd/common"
	admissionregv1 "k8s.io/api/admissionregistration/v1"
	appsV1 "k8s.io/api/apps/v1"
	v1 "k8s.io/api/core/v1"
	rbacv1 "k8s.io/api/rbac/v1"
	apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
	apiextensions "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/api/meta"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/serializer"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/tools/clientcmd"
)
var (
	scheme         = runtime.NewScheme()
	codecs         = serializer.NewCodecFactory(scheme)
	parameterCodec = runtime.NewParameterCodec(scheme)
	encoder = unstructured.NewJSONFallbackEncoder(codecs.LegacyCodec(scheme.PrioritizedVersionsAllGroups()...))
	metadataAccessor = meta.NewAccessor()
)
type (
	createResourceFunc func() error
	getResourceRunc    func() (runtime.Object, error)
	updateResourceFunc func() error
	PredictFunc func(interface{}) bool
	PodStatus struct {
		Name            string
		ReadyContainer  int
		ExpectContainer int
		Status          string
		Restarts        int
	}
	deleteResourceFunc func(kubernetes.Interface, string, string, string) error
	ListPodFunc func(kubernetes.Interface, string) []PodStatus
)