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/pkg/oc/bootstrap/bindata.go b/pkg/oc/bootstrap/bindata.go index 350572508374..bb5a59a14a7a 100644 --- a/pkg/oc/bootstrap/bindata.go +++ b/pkg/oc/bootstrap/bindata.go @@ -14098,7 +14098,8 @@ func installServiceCatalogBrokerResourcesTemplateServiceBrokerRegistrationYaml() var _installTemplateservicebrokerApiserverConfigYaml = []byte(`kind: TemplateServiceBrokerConfig apiVersion: config.templateservicebroker.openshift.io/v1 templateNamespaces: -- openshift`) +- openshift +`) func installTemplateservicebrokerApiserverConfigYamlBytes() ([]byte, error) { return _installTemplateservicebrokerApiserverConfigYaml, nil @@ -14132,6 +14133,8 @@ parameters: apiVersion: config.templateservicebroker.openshift.io/v1 templateNamespaces: - openshift +- name: NODE_SELECTOR + value: "{}" objects: # to create the tsb server @@ -14176,6 +14179,7 @@ objects: path: /healthz port: 8443 scheme: HTTPS + nodeSelector: "${{NODE_SELECTOR}}" volumes: - name: serving-cert secret: @@ -14218,7 +14222,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() diff --git a/test/extended/testdata/bindata.go b/test/extended/testdata/bindata.go index d3edaceb0af0..2278688b3d01 100644 --- a/test/extended/testdata/bindata.go +++ b/test/extended/testdata/bindata.go @@ -27968,7 +27968,8 @@ func installServiceCatalogBrokerResourcesTemplateServiceBrokerRegistrationYaml() var _installTemplateservicebrokerApiserverConfigYaml = []byte(`kind: TemplateServiceBrokerConfig apiVersion: config.templateservicebroker.openshift.io/v1 templateNamespaces: -- openshift`) +- openshift +`) func installTemplateservicebrokerApiserverConfigYamlBytes() ([]byte, error) { return _installTemplateservicebrokerApiserverConfigYaml, nil @@ -28002,6 +28003,8 @@ parameters: apiVersion: config.templateservicebroker.openshift.io/v1 templateNamespaces: - openshift +- name: NODE_SELECTOR + value: "{}" objects: # to create the tsb server @@ -28046,6 +28049,7 @@ objects: path: /healthz port: 8443 scheme: HTTPS + nodeSelector: "${{NODE_SELECTOR}}" volumes: - name: serving-cert secret: @@ -28088,7 +28092,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