func NewKubernetesDataStore() (DataStore, error) {
	overrides := &kclientcmd.ConfigOverrides{}
	rules := &kclientcmd.ClientConfigLoadingRules{}
	config, err := kclientcmd.NewNonInteractiveDeferredLoadingClientConfig(rules, overrides).ClientConfig()
	if err != nil {
		return nil, err
	}
	kubClient, err := kclient.New(config)
	if err != nil {
		return nil, err
	}
	return &kubernetesDataStore{
		kubClient: kubClient,
	}, nil
}
NewKubernetesDataStore creates a data store capable of sync'ing Kubernetes
services and pods.
package datasources
import (
	"crypto/tls"
	"encoding/json"
	"fmt"
	"time"
	"github.com/kelproject/router/reverseproxy"
	"github.com/kelproject/router/server"
	"golang.org/x/net/context"
	kapi "k8s.io/kubernetes/pkg/api"
	kcache "k8s.io/kubernetes/pkg/client/cache"
	kclient "k8s.io/kubernetes/pkg/client/unversioned"
	kclientcmd "k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
	kframework "k8s.io/kubernetes/pkg/controller/framework"
	kSelector "k8s.io/kubernetes/pkg/fields"
)
const (
	resyncPeriod = 5 * time.Minute
)
type kubernetesServiceConfig struct {
	Hosts []string `json:"hosts,omitempty"`
	Mode  string   `json:"mode,omitempty"`
	TLS   struct {
		Key         []byte `json:"key"`
		Certificate []byte `json:"certificate"`
	} `json:"tls,omitempty"`
	Port int `json:"port"`
}
type kubernetesDataStore struct {
	kubClient *kclient.Client
	srvCache  []*kapi.Service
}