func NewProxyServerDefault(config *options.ProxyServerConfig) (*ProxyServer, error) {
	// Create a Kube Client
	// define api config source
	if config.Kubeconfig == "" && config.Master == "" {
		glog.Warningf("Neither --kubeconfig nor --master was specified. Using default API client. This might not work")
	}
	// This creates a client, first loading any specified kubeconfig
	// file, and then overriding the Master flag, if specified.
	kubeconfig, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
		&clientcmd.ClientConfigLoadingRules{ExplicitPath: config.Kubeconfig},
		&clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: config.Master}}).ClientConfig()
	if err != nil {
		return nil, err
	}

	// Override kubeconfig qps/burst settings from flags
	kubeconfig.QPS = config.KubeAPIQPS
	kubeconfig.Burst = config.KubeAPIBurst

	client, err := kubeclient.New(kubeconfig)
	if err != nil {
		glog.Fatalf("Invalid API configuration: %v", err)
	}

	proxierConfig := template.ProxierConfig{config.Device, config.KeepalivedConfig, config.HaproxyConfig}
	proxier, err := template.NewProxier(proxierConfig)
	if err != nil {
		return nil, err
	}

	controller := controller.New(client, proxier, config.SyncPeriod)
	return NewProxyServer(client, controller, config)
}
// NewProxyServerDefault creates a new ProxyServer object with default parameters.
NewProxyServerDefault creates a new ProxyServer object with default parameters.
// NewProxyServerDefault creates a new ProxyServer object with default parameters .
func NewProxyServerDefault(config *options.ProxyServerConfig) (*ProxyServer, error) {
	if config.Kubeconfig == "" && config.Master == "" {
		glog.Warningf("Neither --kubeconfig nor --master was specified. Using default API client. This might not work")
	}
	kubeconfig, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
		&clientcmd.ClientConfigLoadingRules{ExplicitPath: config.Kubeconfig},
		&clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: config.Master}}).ClientConfig()
	if err != nil {
		return nil, err
	}
	kubeconfig.QPS = config.KubeAPIQPS
	kubeconfig.Burst = config.KubeAPIBurst
	client, err := kubeclient.New(kubeconfig)
	if err != nil {
		glog.Fatalf("Invalid API configuration: %v", err)
	}
	proxierConfig := template.ProxierConfig{config.Device, config.KeepalivedConfig, config.HaproxyConfig}
	proxier, err := template.NewProxier(proxierConfig)
	if err != nil {
		return nil, err
	}
	controller := controller.New(client, proxier, config.SyncPeriod)
	return NewProxyServer(client, controller, config)
}
func NewProxyServerDefault ( config * options . ProxyServerConfig ) ( * ProxyServer , error ) { if config . Kubeconfig == " " && config . Master == " " { glog . Warningf ( " " ) } kubeconfig , err := clientcmd . NewNonInteractiveDeferredLoadingClientConfig ( & clientcmd . ClientConfigLoadingRules { ExplicitPath : config . Kubeconfig } , & clientcmd . ConfigOverrides { ClusterInfo : clientcmdapi . Cluster { Server : config . Master } } ) . ClientConfig ( ) if err != nil { return nil , err } kubeconfig . QPS = config . KubeAPIQPS kubeconfig . Burst = config . KubeAPIBurst client , err := kubeclient . New ( kubeconfig ) if err != nil { glog . Fatalf ( " " , err ) } proxierConfig := template . ProxierConfig { config . Device , config . KeepalivedConfig , config . HaproxyConfig } proxier , err := template . NewProxier ( proxierConfig ) if err != nil { return nil , err } controller := controller . New ( client , proxier , config . SyncPeriod ) return NewProxyServer ( client , controller , config ) }
NewProxyServerDefault creates a new ProxyServer object with default parameters.
NewProxyServerDefault creates a new ProxyServer object with default parameters .
// Create a Kube Client // define api config source // This creates a client, first loading any specified kubeconfig // file, and then overriding the Master flag, if specified. // Override kubeconfig qps/burst settings from flags