From df2a420f41cc43fdd7e490ae66cf6444eba944ec Mon Sep 17 00:00:00 2001 From: Alex Dellapenta Date: Fri, 14 May 2021 14:25:14 -0600 Subject: [PATCH] Control pod placement using a project --- ...-taints-tolerations-adding-machineset.adoc | 2 +- ...s-scheduler-taints-tolerations-adding.adoc | 2 +- ...-scheduler-taints-tolerations-binding.adoc | 4 +- ...scheduler-taints-tolerations-projects.adoc | 45 +++++++++++++++++++ ...scheduler-taints-tolerations-removing.adoc | 2 +- modules/olm-pod-placement.adoc | 22 +++++++++ .../nodes-scheduler-node-selectors.adoc | 6 ++- .../nodes-scheduler-taints-tolerations.adoc | 9 +++- .../olm-adding-operators-to-cluster.adoc | 8 ++++ 9 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 modules/nodes-scheduler-taints-tolerations-projects.adoc create mode 100644 modules/olm-pod-placement.adoc diff --git a/modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc b/modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc index e6547493a3..a4c5accfcc 100644 --- a/modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc +++ b/modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc @@ -1,6 +1,6 @@ // Module included in the following assemblies: // -// * nodes/nodes-scheduler-taints-tolerations.adoc +// * nodes/scheduling/nodes-scheduler-taints-tolerations.adoc // * post_installation_configuration/node-tasks.adoc [id="nodes-scheduler-taints-tolerations-adding-machineset_{context}"] diff --git a/modules/nodes-scheduler-taints-tolerations-adding.adoc b/modules/nodes-scheduler-taints-tolerations-adding.adoc index 64dad9c756..e5ea1bb72a 100644 --- a/modules/nodes-scheduler-taints-tolerations-adding.adoc +++ b/modules/nodes-scheduler-taints-tolerations-adding.adoc @@ -1,6 +1,6 @@ // Module included in the following assemblies: // -// * nodes/nodes-scheduler-taints-tolerations.adoc +// * nodes/scheduling/nodes-scheduler-taints-tolerations.adoc // * post_installation_configuration/node-tasks.adoc [id="nodes-scheduler-taints-tolerations-adding_{context}"] diff --git a/modules/nodes-scheduler-taints-tolerations-binding.adoc b/modules/nodes-scheduler-taints-tolerations-binding.adoc index a9173d4c08..b891a1862f 100644 --- a/modules/nodes-scheduler-taints-tolerations-binding.adoc +++ b/modules/nodes-scheduler-taints-tolerations-binding.adoc @@ -1,6 +1,6 @@ // Module included in the following assemblies: // -// * nodes/nodes-scheduler-taints-tolerations.adoc +// * nodes/scheduling/nodes-scheduler-taints-tolerations.adoc // * post_installation_configuration/node-tasks.adoc [id="nodes-scheduler-taints-tolerations-bindings_{context}"] @@ -24,5 +24,3 @@ $ oc adm taint nodes node1 dedicated=groupName:NoSchedule ---- . Add a toleration to the pods by writing a custom admission controller. - - diff --git a/modules/nodes-scheduler-taints-tolerations-projects.adoc b/modules/nodes-scheduler-taints-tolerations-projects.adoc new file mode 100644 index 0000000000..779cc7aee4 --- /dev/null +++ b/modules/nodes-scheduler-taints-tolerations-projects.adoc @@ -0,0 +1,45 @@ +// Module included in the following assemblies: +// +// * nodes/scheduling/nodes-scheduler-taints-tolerations.adoc +// * post_installation_configuration/node-tasks.adoc + +[id="nodes-scheduler-taints-tolerations-projects_{context}"] += Creating a project with a node selector and toleration + +You can create a project that uses a node selector and toleration, which are set as annotations, to control the placement of pods onto specific nodes. Any subsequent resources created in the project are then scheduled on nodes that have a taint matching the toleration. + +.Prerequisites + +* A label for node selection has been added to one or more nodes by using a machine set or editing the node directly. +* A taint has been added to one or more nodes by using a machine set or editing the node directly. + +.Procedure + +. Create a `Project` resource definition, specifying a node selector and toleration in the `metadata.annotations` section: ++ +.Example `project.yaml` file +[source,yaml] +---- +kind: Project +apiVersion: project.openshift.io/v1 +metadata: + name: <1> + annotations: + openshift.io/node-selector: '