diff --git a/install/templateservicebroker/apiserver-config.yaml b/install/templateservicebroker/apiserver-config.yaml index 9c8294183985..e4048d1da426 100644 --- a/install/templateservicebroker/apiserver-config.yaml +++ b/install/templateservicebroker/apiserver-config.yaml @@ -1,4 +1,4 @@ kind: TemplateServiceBrokerConfig apiVersion: config.templateservicebroker.openshift.io/v1 templateNamespaces: -- openshift \ No newline at end of file +- openshift diff --git a/install/templateservicebroker/apiserver-template.yaml b/install/templateservicebroker/apiserver-template.yaml index 22c4f391c6d1..035e4734b996 100644 --- a/install/templateservicebroker/apiserver-template.yaml +++ b/install/templateservicebroker/apiserver-template.yaml @@ -15,6 +15,8 @@ parameters: apiVersion: config.templateservicebroker.openshift.io/v1 templateNamespaces: - openshift +- name: NODE_SELECTOR + value: "{}" objects: # to create the tsb server @@ -59,6 +61,7 @@ objects: path: /healthz port: 8443 scheme: HTTPS + nodeSelector: "${{NODE_SELECTOR}}" volumes: - name: serving-cert secret: @@ -101,7 +104,7 @@ objects: targetPort: 8443 # This service account will be granted permission to call the TSB. -# The token for this SA will be provided to the service catalog for +# The token for this SA will be provided to the service catalog for # use when calling the TSB. - apiVersion: v1 kind: ServiceAccount diff --git a/test/extended/templates/helpers.go b/test/extended/templates/helpers.go index 3bfac909fa00..8564a79e86a1 100644 --- a/test/extended/templates/helpers.go +++ b/test/extended/templates/helpers.go @@ -120,6 +120,16 @@ func setUser(cli *exutil.CLI, user *userapi.User) { } } +func setEmptyNodeSelector(tsbOC *exutil.CLI) { + namespace, err := tsbOC.AdminKubeClient().CoreV1().Namespaces().Get(tsbOC.Namespace(), metav1.GetOptions{}) + o.Expect(err).NotTo(o.HaveOccurred()) + + namespace.Annotations["openshift.io/node-selector"] = "" + + _, err = tsbOC.AdminKubeClient().CoreV1().Namespaces().Update(namespace) + o.Expect(err).NotTo(o.HaveOccurred()) +} + // EnsureTSB makes sure a TSB is present where expected and returns a client to // speak to it and a close method which provides the proxy. The caller must // call the close method, usually done in AfterEach @@ -137,6 +147,13 @@ func EnsureTSB(tsbOC *exutil.CLI) (osbclient.Client, func() error) { } } + // Set an empty node selector on our namespace. For now this ensures we + // don't trigger a spinning state (see bz1494709) with the DaemonSet if + // projectConfig.defaultNodeSelector is set in the master config and some + // nodes don't match the nodeSelector. The spinning state wastes CPU and + // fills the node logs, but otherwise isn't particularly harmful. + setEmptyNodeSelector(tsbOC) + configPath := exutil.FixturePath("..", "..", "install", "templateservicebroker", "apiserver-template.yaml") err := tsbOC.AsAdmin().Run("new-app").Args(configPath, "-p", "LOGLEVEL=4", "-p", "NAMESPACE="+tsbOC.Namespace()).Execute()