OpenShift Node Selector Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 24: Line 24:




The node selector can be added after the project was created by editing the project metadata with [[oc edit]]:
The node selector can be added after the project was created by editing the namespace metadata with [[oc edit]]:


  oc edit project ''<my-project>''
  oc edit namespace ''<my-project>''


  ...
  ...
Line 33: Line 33:
     <b>openshift.io/node-selector: "env=infra"</b>
     <b>openshift.io/node-selector: "env=infra"</b>
  ...
  ...
{{Warn|Edit the "namespace", and not the "project", if attempting to edit the project you will get an error message saying that the field is immutable.}}


=Configuring a Per-Pod Node Selector=
=Configuring a Per-Pod Node Selector=

Revision as of 04:44, 6 July 2017

Internal

Overview

Operations to manipulate node selectors.

Configuring a Cluster-Wide Default Node Selector

https://docs.openshift.com/container-platform/3.5/admin_guide/managing_projects.html#setting-the-cluster-wide-default-node-selector

Sets up a cluster-wide default node selector.

Configuring a Per-Project Node Selector

https://docs.openshift.com/container-platform/3.5/admin_guide/managing_projects.html#setting-the-project-wide-node-selector

The per-project node selector can be set up when the project is created:

oadm new-project <project-name> --node-selector='keyA=valueA,keyB=valueB'

More details in:

oadm new-project


The node selector can be added after the project was created by editing the namespace metadata with oc edit:

oc edit namespace <my-project>
...
metadata:
  annotations:
    openshift.io/node-selector: "env=infra"
...

Edit the "namespace", and not the "project", if attempting to edit the project you will get an error message saying that the field is immutable.

Configuring a Per-Pod Node Selector

https://docs.openshift.com/container-platform/3.5/admin_guide/managing_projects.html#developer-specified-node-selectors

The per-pod node selector.