Cluster-autoscaler: precheck that the api server link is ok
@@ -231,6 +231,13 @@ func main() {
}
kubeClient := createKubeClient()
+
+ // Validate that the client is ok.
+ _, err = kubeClient.Core().Nodes().List(metav1.ListOptions{})
+ if err != nil {
+ glog.Fatalf("Failed to get nodes from apiserver: %v", err)
+ }
+
kube_leaderelection.RunOrDie(kube_leaderelection.LeaderElectionConfig{
Lock: &resourcelock.EndpointsLock{
EndpointsMeta: metav1.ObjectMeta{
