func read(configPath string) (*Config, error) {
	f, err := os.Open(configPath)
	if os.IsNotExist(err) {
		return &Config{}, nil
	} else if err != nil {
		return nil, errors.WithStack(err)
	}
	cfg := &Config{}
	rawExisting, err := ioutil.ReadAll(f)
	if err != nil {
		return nil, errors.WithStack(err)
	}
	if err := yaml.Unmarshal(rawExisting, cfg); err != nil {
		return nil, errors.WithStack(err)
	}
	return cfg, nil
}
read loads a KUBECONFIG file from configPath
package kubeconfig
import (
	"io/ioutil"
	"os"
	yaml "gopkg.in/yaml.v3"
	"sigs.k8s.io/kind/pkg/errors"
)
func KINDFromRawKubeadm(rawKubeadmKubeConfig, clusterName, server string) (*Config, error) {
	cfg := &Config{}
	if err := yaml.Unmarshal([]byte(rawKubeadmKubeConfig), cfg); err != nil {
		return nil, err
	}
	if err := checkKubeadmExpectations(cfg); err != nil {
		return nil, err
	}
	key := KINDClusterKey(clusterName)
	cfg.Clusters[0].Name = key
	cfg.Users[0].Name = key
	cfg.Contexts[0].Name = key
	cfg.Contexts[0].Context.User = key
	cfg.Contexts[0].Context.Cluster = key
	cfg.CurrentContext = key
	if server != "" {
		cfg.Clusters[0].Cluster.Server = server
	}
	return cfg, nil
}