Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

Appendix C. Applying labels and taints to Red Hat OpenShift node

download PDF

In order to have our control pods run on a dedicated Red Hat OpenShift node, one must set the appropriate labels and taints to the specified node.

In this example, we will select one of our Red Hat OpenShift nodes with the role worker the label aap_node_type=control.

  1. Get the name of one of the nodes you want to label running

    $ oc get nodes
  2. Choose a node from the list and note its name, e.g. worker1
  3. Apply the aap_node_type=control label to the node

    $ oc label node <node-name> aap_node_type=control
    Note

    Replace <node-name> with the name of the node you want to label.

  4. Verify the creation of the label as follows:

    $ oc get nodes --show-labels | grep <node-name>

    With the label created, the next step is to add a NoSchedule taint to the worker node we have already created a label for.

    The following command adds a NoSchedule taint to our node:

    oc adm taint nodes <node-name> dedicated=AutomationController:NoSchedule

    dedicated: This is the key of the taint that is an arbitrary string supplied that identifies the taint.

    AutomationController: This is an arbitrary value given to the taint.

    NoSchedule: This is the effect of the taint which specifies no pods that don’t tolerate this taint will be scheduled onto this node.

    By applying this taint to our node, we are telling the Kubernetes scheduler to reserve this node for certain types of workloads that tolerate the taint. In this case, we are reserving the node for workloads with the dedicated=AutomationController toleration.

  5. Verify the taint has been applied

    $ oc get nodes \
    -o jsonpath='{range.items[*]}{@.metadata.name}{"\t"}{@.spec.taints[*].key}:{@.spec.taints[*].value}{"\n"}{end}' \
    | grep AutomationController
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.