mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-01 17:29:00 +00:00
Merge pull request #8389 from smarterclayton/chatty_endpoints_controller
Endpoints controller is logging too much
This commit is contained in:
@@ -312,11 +312,11 @@ func (e *EndpointController) syncService(key string) {
|
||||
portProto := servicePort.Protocol
|
||||
portNum, err := findPort(pod, servicePort)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to find port for service %s/%s: %v", service.Namespace, service.Name, err)
|
||||
glog.V(4).Infof("Failed to find port for service %s/%s: %v", service.Namespace, service.Name, err)
|
||||
continue
|
||||
}
|
||||
if len(pod.Status.PodIP) == 0 {
|
||||
glog.Errorf("Failed to find an IP for pod %s/%s", pod.Namespace, pod.Name)
|
||||
glog.V(4).Infof("Failed to find an IP for pod %s/%s", pod.Namespace, pod.Name)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/cache"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/controller/framework"
|
||||
@@ -244,7 +245,11 @@ func (factory *ConfigFactory) createServiceLW() *cache.ListWatch {
|
||||
|
||||
func (factory *ConfigFactory) makeDefaultErrorFunc(backoff *podBackoff, podQueue *cache.FIFO) func(pod *api.Pod, err error) {
|
||||
return func(pod *api.Pod, err error) {
|
||||
glog.Errorf("Error scheduling %v %v: %v; retrying", pod.Namespace, pod.Name, err)
|
||||
if err == scheduler.ErrNoNodesAvailable {
|
||||
glog.V(4).Infof("Unable to schedule %v %v: no nodes are registered to the cluster; waiting", pod.Namespace, pod.Name)
|
||||
} else {
|
||||
glog.Errorf("Error scheduling %v %v: %v; retrying", pod.Namespace, pod.Name, err)
|
||||
}
|
||||
backoff.gc()
|
||||
// Retry asynchronously.
|
||||
// Note that this is extremely rudimentary and we need a more real error handling path.
|
||||
@@ -257,7 +262,9 @@ func (factory *ConfigFactory) makeDefaultErrorFunc(backoff *podBackoff, podQueue
|
||||
pod = &api.Pod{}
|
||||
err := factory.Client.Get().Namespace(podNamespace).Resource("pods").Name(podID).Do().Into(pod)
|
||||
if err != nil {
|
||||
glog.Errorf("Error getting pod %v for retry: %v; abandoning", podID, err)
|
||||
if !errors.IsNotFound(err) {
|
||||
glog.Errorf("Error getting pod %v for retry: %v; abandoning", podID, err)
|
||||
}
|
||||
return
|
||||
}
|
||||
if pod.Spec.Host == "" {
|
||||
|
@@ -36,6 +36,8 @@ type FitError struct {
|
||||
FailedPredicates FailedPredicateMap
|
||||
}
|
||||
|
||||
var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")
|
||||
|
||||
// implementation of the error interface
|
||||
func (f *FitError) Error() string {
|
||||
output := fmt.Sprintf("failed to find fit for pod: %v", f.Pod)
|
||||
@@ -59,7 +61,7 @@ func (g *genericScheduler) Schedule(pod *api.Pod, minionLister algorithm.MinionL
|
||||
return "", err
|
||||
}
|
||||
if len(minions.Items) == 0 {
|
||||
return "", fmt.Errorf("no minions available to schedule pods")
|
||||
return "", ErrNoNodesAvailable
|
||||
}
|
||||
|
||||
filteredNodes, failedPredicateMap, err := findNodesThatFit(pod, g.pods, g.predicates, minions)
|
||||
|
Reference in New Issue
Block a user