func GetAppsClient() *appsv1client.AppsV1Client {
	if RestConfig == nil {
		RestConfig = getRestConfig(getKubeConfig())
	}
	client, err := appsv1client.NewForConfig(RestConfig)
	if err != nil {
		panic(err)
	}
	return client
}
Returns a Apps client
package k8sclient
import (
	"flag"
	"os"
	"path/filepath"
	"runtime"
	argocdv1alpha1client "github.com/argoproj/argo-cd/pkg/client/clientset/versioned/typed/application/v1alpha1"
	monitoringv1client "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1"
	appsv1client "github.com/openshift/client-go/apps/clientset/versioned/typed/apps/v1"
	buildv1client "github.com/openshift/client-go/build/clientset/versioned/typed/build/v1"
	imagev1client "github.com/openshift/client-go/image/clientset/versioned/typed/image/v1"
	routev1client "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1"
	"k8s.io/client-go/kubernetes"
	corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"
	log "k8s.io/klog"
)
var RestConfig *rest.Config
func getHomeDir() string {
	if runtime.GOOS == "windows" {
		home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
		if home == "" {
			home = os.Getenv("USERPROFILE")
		}
		return home
	}
	return os.Getenv("HOME")
}
func getKubeConfig() string {
	var kubeconfig string
	if home := getHomeDir(); home != "" {
		kubeconfig = *flag.String(
			"kubeconfig", filepath.Join(home, ".kube", "config"),
			"(optional) path to a kubeconfig file")
	} else {
		kubeconfig = *flag.String("kubeconfig", "", "(optional) path to a kubeconfig file")
	}
	flag.Parse()
	return kubeconfig
}
func getRestConfig(kc string) *rest.Config {
	log.V(1).Infof("kubeconfig: %v", kc)
	var config *rest.Config
	if _, err := os.Stat(kc); os.IsNotExist(err) {
		var err error
		config, err = rest.InClusterConfig()
		if err != nil {
			log.Infof("Did not find InClusterConfig: %v", err)
		}
	} else {
		var err error
		config, err = clientcmd.BuildConfigFromFlags("", kc)
		if err != nil {
			log.Errorf("Unable to build config from flags: %v", err)
			os.Exit(1)
		}
	}
	return config
}
func GetCoreClient() *corev1client.CoreV1Client {
	if RestConfig == nil {
		RestConfig = getRestConfig(getKubeConfig())
	}
	client, err := corev1client.NewForConfig(RestConfig)
	if err != nil {
		panic(err)
	}
	return client
}
func GetImageClient() *imagev1client.ImageV1Client {
	if RestConfig == nil {
		RestConfig = getRestConfig(getKubeConfig())
	}
	client, err := imagev1client.NewForConfig(RestConfig)
	if err != nil {
		panic(err)
	}
	return client
}