Description: Disable kubernetes SD, until dependencies are more reasonable.
--- a/config/config.go
+++ b/config/config.go
@@ -169,12 +169,6 @@
 		scfg.TLSConfig.KeyFile = join(scfg.TLSConfig.KeyFile)
 	}
 	sdPaths := func(cfg *sd_config.ServiceDiscoveryConfig) {
-		for _, kcfg := range cfg.KubernetesSDConfigs {
-			kcfg.BearerTokenFile = join(kcfg.BearerTokenFile)
-			kcfg.TLSConfig.CAFile = join(kcfg.TLSConfig.CAFile)
-			kcfg.TLSConfig.CertFile = join(kcfg.TLSConfig.CertFile)
-			kcfg.TLSConfig.KeyFile = join(kcfg.TLSConfig.KeyFile)
-		}
 		for _, mcfg := range cfg.MarathonSDConfigs {
 			mcfg.BearerTokenFile = join(mcfg.BearerTokenFile)
 			mcfg.TLSConfig.CAFile = join(mcfg.TLSConfig.CAFile)
--- a/config/testdata/conf.good.yml
+++ b/config/testdata/conf.good.yml
@@ -144,25 +144,6 @@
 
   bearer_token: mysecret
 
-- job_name: service-kubernetes
-
-  kubernetes_sd_configs:
-  - role: endpoints
-    api_server: 'https://localhost:1234'
-
-    basic_auth:
-      username: 'myusername'
-      password: 'mysecret'
-
-- job_name: service-kubernetes-namespaces
-
-  kubernetes_sd_configs:
-  - role: endpoints
-    api_server: 'https://localhost:1234'
-    namespaces:
-      names:
-        - default
-
 - job_name: service-marathon
   marathon_sd_configs:
   - servers:
--- a/discovery/kubernetes/endpoints.go
+++ b/discovery/kubernetes/endpoints.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/endpoints_test.go
+++ b/discovery/kubernetes/endpoints_test.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/kubernetes.go
+++ b/discovery/kubernetes/kubernetes.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/node.go
+++ b/discovery/kubernetes/node.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/node_test.go
+++ b/discovery/kubernetes/node_test.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/pod.go
+++ b/discovery/kubernetes/pod.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/pod_test.go
+++ b/discovery/kubernetes/pod_test.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/service.go
+++ b/discovery/kubernetes/service.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/service_test.go
+++ b/discovery/kubernetes/service_test.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/cmd/promtool/main.go
+++ b/cmd/promtool/main.go
@@ -148,12 +148,6 @@
 			return nil, err
 		}
 
-		for _, kd := range scfg.ServiceDiscoveryConfig.KubernetesSDConfigs {
-			if err := checkTLSConfig(kd.TLSConfig); err != nil {
-				return nil, err
-			}
-		}
-
 		for _, filesd := range scfg.ServiceDiscoveryConfig.FileSDConfigs {
 			for _, file := range filesd.Files {
 				files, err := filepath.Glob(file)
--- a/discovery/kubernetes/ingress.go
+++ b/discovery/kubernetes/ingress.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/discovery/kubernetes/ingress_test.go
+++ b/discovery/kubernetes/ingress_test.go
@@ -11,6 +11,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// +build ignore
+
 package kubernetes
 
 import (
--- a/cmd/prometheus/main.go
+++ b/cmd/prometheus/main.go
@@ -40,7 +40,6 @@
 	"github.com/prometheus/common/model"
 	"github.com/prometheus/common/version"
 	"gopkg.in/alecthomas/kingpin.v2"
-	k8s_runtime "k8s.io/apimachinery/pkg/util/runtime"
 
 	"github.com/mwitkow/go-conntrack"
 	"github.com/prometheus/common/promlog"
@@ -216,15 +215,6 @@
 
 	logger := promlog.New(cfg.logLevel)
 
-	// XXX(fabxc): Kubernetes does background logging which we can only customize by modifying
-	// a global variable.
-	// Ultimately, here is the best place to set it.
-	k8s_runtime.ErrorHandlers = []func(error){
-		func(err error) {
-			level.Error(log.With(logger, "component", "k8s_client_runtime")).Log("err", err)
-		},
-	}
-
 	level.Info(logger).Log("msg", "Starting Prometheus", "version", version.Info())
 	level.Info(logger).Log("build_context", version.BuildContext())
 	level.Info(logger).Log("host_details", Uname())
--- a/discovery/config/config.go
+++ b/discovery/config/config.go
@@ -20,7 +20,6 @@
 	"github.com/prometheus/prometheus/discovery/ec2"
 	"github.com/prometheus/prometheus/discovery/file"
 	"github.com/prometheus/prometheus/discovery/gce"
-	"github.com/prometheus/prometheus/discovery/kubernetes"
 	"github.com/prometheus/prometheus/discovery/marathon"
 	"github.com/prometheus/prometheus/discovery/openstack"
 	"github.com/prometheus/prometheus/discovery/targetgroup"
@@ -46,8 +45,6 @@
 	NerveSDConfigs []*zookeeper.NerveSDConfig `yaml:"nerve_sd_configs,omitempty"`
 	// MarathonSDConfigs is a list of Marathon service discovery configurations.
 	MarathonSDConfigs []*marathon.SDConfig `yaml:"marathon_sd_configs,omitempty"`
-	// List of Kubernetes service discovery configurations.
-	KubernetesSDConfigs []*kubernetes.SDConfig `yaml:"kubernetes_sd_configs,omitempty"`
 	// List of GCE service discovery configurations.
 	GCESDConfigs []*gce.SDConfig `yaml:"gce_sd_configs,omitempty"`
 	// List of EC2 service discovery configurations.
--- a/discovery/manager.go
+++ b/discovery/manager.go
@@ -30,7 +30,6 @@
 	"github.com/prometheus/prometheus/discovery/ec2"
 	"github.com/prometheus/prometheus/discovery/file"
 	"github.com/prometheus/prometheus/discovery/gce"
-	"github.com/prometheus/prometheus/discovery/kubernetes"
 	"github.com/prometheus/prometheus/discovery/marathon"
 	"github.com/prometheus/prometheus/discovery/openstack"
 	"github.com/prometheus/prometheus/discovery/triton"
@@ -208,14 +207,6 @@
 		}
 		app("marathon", i, t)
 	}
-	for i, c := range cfg.KubernetesSDConfigs {
-		k, err := kubernetes.New(log.With(m.logger, "discovery", "k8s"), c)
-		if err != nil {
-			level.Error(m.logger).Log("msg", "Cannot create Kubernetes discovery", "err", err)
-			continue
-		}
-		app("kubernetes", i, k)
-	}
 	for i, c := range cfg.ServersetSDConfigs {
 		app("serverset", i, zookeeper.NewServersetDiscovery(c, log.With(m.logger, "discovery", "zookeeper")))
 	}
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -28,7 +28,6 @@
 	"github.com/prometheus/prometheus/discovery/dns"
 	"github.com/prometheus/prometheus/discovery/ec2"
 	"github.com/prometheus/prometheus/discovery/file"
-	"github.com/prometheus/prometheus/discovery/kubernetes"
 	"github.com/prometheus/prometheus/discovery/marathon"
 	"github.com/prometheus/prometheus/discovery/targetgroup"
 	"github.com/prometheus/prometheus/discovery/triton"
@@ -320,52 +319,6 @@
 			},
 		},
 		{
-			JobName: "service-kubernetes",
-
-			ScrapeInterval: model.Duration(15 * time.Second),
-			ScrapeTimeout:  DefaultGlobalConfig.ScrapeTimeout,
-
-			MetricsPath: DefaultScrapeConfig.MetricsPath,
-			Scheme:      DefaultScrapeConfig.Scheme,
-
-			ServiceDiscoveryConfig: sd_config.ServiceDiscoveryConfig{
-				KubernetesSDConfigs: []*kubernetes.SDConfig{
-					{
-						APIServer: kubernetesSDHostURL(),
-						Role:      kubernetes.RoleEndpoint,
-						BasicAuth: &config_util.BasicAuth{
-							Username: "myusername",
-							Password: "mysecret",
-						},
-						NamespaceDiscovery: kubernetes.NamespaceDiscovery{},
-					},
-				},
-			},
-		},
-		{
-			JobName: "service-kubernetes-namespaces",
-
-			ScrapeInterval: model.Duration(15 * time.Second),
-			ScrapeTimeout:  DefaultGlobalConfig.ScrapeTimeout,
-
-			MetricsPath: DefaultScrapeConfig.MetricsPath,
-			Scheme:      DefaultScrapeConfig.Scheme,
-
-			ServiceDiscoveryConfig: sd_config.ServiceDiscoveryConfig{
-				KubernetesSDConfigs: []*kubernetes.SDConfig{
-					{
-						APIServer: kubernetesSDHostURL(),
-						Role:      kubernetes.RoleEndpoint,
-						NamespaceDiscovery: kubernetes.NamespaceDiscovery{
-							Names: []string{
-								"default",
-							},
-						},
-					},
-				},
-			},
-		},
-		{
 			JobName: "service-marathon",
 
 			ScrapeInterval: model.Duration(15 * time.Second),
@@ -566,7 +519,7 @@
 	yamlConfig := string(config)
 
 	matches := secretRe.FindAllStringIndex(yamlConfig, -1)
-	testutil.Assert(t, len(matches) == 6, "wrong number of secret matches found")
+	testutil.Assert(t, len(matches) == 5, "wrong number of secret matches found")
 	testutil.Assert(t, !strings.Contains(yamlConfig, "mysecret"),
 		"yaml marshal reveals authentication credentials.")
 }
@@ -648,18 +601,6 @@
 		filename: "bearertoken_basicauth.bad.yml",
 		errMsg:   "at most one of basic_auth, bearer_token & bearer_token_file must be configured",
 	}, {
-		filename: "kubernetes_bearertoken.bad.yml",
-		errMsg:   "at most one of bearer_token & bearer_token_file must be configured",
-	}, {
-		filename: "kubernetes_role.bad.yml",
-		errMsg:   "role",
-	}, {
-		filename: "kubernetes_namespace_discovery.bad.yml",
-		errMsg:   "unknown fields in namespaces",
-	}, {
-		filename: "kubernetes_bearertoken_basicauth.bad.yml",
-		errMsg:   "at most one of basic_auth, bearer_token & bearer_token_file must be configured",
-	}, {
 		filename: "marathon_no_servers.bad.yml",
 		errMsg:   "Marathon SD config must contain at least one Marathon server",
 	}, {
@@ -741,8 +682,3 @@
 			"Expected %q to be %v", test.str, test.valid)
 	}
 }
-
-func kubernetesSDHostURL() config_util.URL {
-	tURL, _ := url.Parse("https://localhost:1234")
-	return config_util.URL{URL: tURL}
-}
