Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NODE_SELECTOR parameter on TSB template #16539

Merged
merged 1 commit into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion install/templateservicebroker/apiserver-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kind: TemplateServiceBrokerConfig
apiVersion: config.templateservicebroker.openshift.io/v1
templateNamespaces:
- openshift
- openshift
5 changes: 4 additions & 1 deletion install/templateservicebroker/apiserver-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ parameters:
apiVersion: config.templateservicebroker.openshift.io/v1
templateNamespaces:
- openshift
- name: NODE_SELECTOR
value: "{}"
objects:

# to create the tsb server
Expand Down Expand Up @@ -59,6 +61,7 @@ objects:
path: /healthz
port: 8443
scheme: HTTPS
nodeSelector: "${{NODE_SELECTOR}}"
volumes:
- name: serving-cert
secret:
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions pkg/oc/bootstrap/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions test/extended/templates/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
8 changes: 6 additions & 2 deletions test/extended/testdata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.