Skip to content

Commit

Permalink
Merge pull request openshift#15560 from deads2k/server-11-noise
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

make apiserver start less noisy

This reduces noise from informers failing to establish connections to a server that isn't listening.
  • Loading branch information
openshift-merge-robot authored Aug 1, 2017
2 parents f895b96 + 03e269f commit 8e7e995
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
18 changes: 0 additions & 18 deletions pkg/cmd/server/origin/ensure.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
kapierror "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
apirequest "k8s.io/apiserver/pkg/endpoints/request"
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/rbac"
Expand Down Expand Up @@ -220,23 +219,6 @@ func (c *MasterConfig) ensureComponentAuthorizationRules() {
glog.V(2).Infof("Ignoring bootstrap policy file because cluster policy found")
}

// Wait until the policy cache has caught up before continuing
review := &authorizationapi.SubjectAccessReview{Action: authorizationapi.Action{Verb: "get", Group: authorizationapi.GroupName, Resource: "clusterpolicies"}}
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (done bool, err error) {
result, err := c.PolicyClient().SubjectAccessReviews().Create(review)
if err == nil && result.Allowed {
return true, nil
}
if kapierror.IsForbidden(err) || (err == nil && !result.Allowed) {
glog.V(2).Infof("waiting for policy cache to initialize")
return false, nil
}
return false, err
})
if err != nil {
glog.Errorf("error waiting for policy cache to initialize: %v", err)
}

// Reconcile roles that must exist for the cluster to function
// Be very judicious about what is placed in this list, since it will be enforced on every server start
reconcileRoles := &policy.ReconcileClusterRolesOptions{
Expand Down
8 changes: 1 addition & 7 deletions pkg/cmd/server/start/start_master.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,6 @@ func (m *Master) Start() error {
if err := StartAPI(openshiftConfig, kubeMasterConfig, informers, controllerPlug); err != nil {
return err
}

informers.Start(utilwait.NeverStop)
}

return nil
Expand All @@ -561,9 +559,6 @@ func StartAPI(oc *origin.MasterConfig, kc *kubernetes.MasterConfig, informers *i
}
}

// Must start policy and quota caching immediately
oc.QuotaInformers.Start(utilwait.NeverStop)
oc.AuthorizationInformers.Start(utilwait.NeverStop)
clusterQuotaMapping := origincontrollers.ClusterQuotaMappingControllerConfig{
ClusterQuotaMappingController: oc.ClusterQuotaMappingController,
}
Expand Down Expand Up @@ -597,8 +592,7 @@ func StartAPI(oc *origin.MasterConfig, kc *kubernetes.MasterConfig, informers *i
}

// start up the informers that we're trying to use in the API server
informers.GetInternalKubeInformers().Start(utilwait.NeverStop)
informers.GetExternalKubeInformers().Start(utilwait.NeverStop)
informers.Start(utilwait.NeverStop)
oc.InitializeObjects()

if standaloneAssetConfig != nil {
Expand Down

0 comments on commit 8e7e995

Please sign in to comment.