import ( k8sClientSet "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_2" "k8s.io/kubernetes/pkg/client/rest" ) // GetConfig returns the client configuration for the Kubernetes API server. func GetConfig() (*rest.Config, error) { // Assume the configuration file is present in the current directory. kubeConfigPath := "./config" // Use the provided kubeconfig to create a rest.Config object. config, err := clientcmd.BuildConfigFromFlags("", kubeConfigPath) if err != nil { return nil, err } return config, nil } // CreateClientSet creates and returns a new instance of the Kubernetes client API. func CreateClientSet(config *rest.Config) (*k8sClientSet.Clientset, error) { return k8sClientSet.NewForConfig(config) }This example shows how to use the GetConfig and CreateClientSet functions to create a clientset instance for version 1.2 of the Kubernetes API. The k8s.io/kubernetes/pkg/client/clientset_generated/release_1_2 package library provides many clientset functions, including creating and updating Kubernetes resources, monitoring and logging, and authentication and authorization.