How to configure project node selector in RHOCP 4
Environment
- Red Hat OpenShift Container Platform (RHOCP) 4
Issue
- How to configure project node selector in RHOCP 4?
Resolution
The default project node selector defaultNodeSelector will be applied to all projects that don't have an openshift.io/node-selector annotation.
To set up the default project node selector globally:
$ oc patch scheduler cluster --type=merge -p '{"spec":{"defaultNodeSelector":"type=app"}}'
To remove it:
$ oc patch scheduler cluster --type=merge -p '{"spec":{"defaultNodeSelector":null}}'
To disable the global node selector at the project level:
$ oc annotate namespace $PROJECT openshift.io/node-selector=
To configure the node selector at the project level:
$ oc annotate namespace $PROJECT openshift.io/node-selector=type=app
To remove it:
$ oc annotate namespace $PROJECT openshift.io/node-selector-
SBR
Product(s)
Components
Category
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.