// Module included in the following assemblies:
//
// * backup_and_restore/application_backup_and_restore/installing/installing-oadp-aws.adoc
// * backup_and_restore/application_backup_and_restore/installing/installing-oadp-azure.adoc
// * backup_and_restore/application_backup_and_restore/installing/installing-oadp-gcp.adoc
// * backup_and_restore/application_backup_and_restore/installing/installing-oadp-mcg.adoc
// * backup_and_restore/application_backup_and_restore/installing/installing-oadp-ocs.adoc
// * backup_and_restore/application_backup_and_restore/installing/installing-oadp-kubevirt.adoc
// * backup_and_restore/application_backup_and_restore/oadp-api.adoc
// * virt/backup_restore/virt-backup-restore-overview.adoc

:_mod-docs-content-type: PROCEDURE
[id="oadp-configuring-node-agents_{context}"]
= Configuring node agents and node labels

The DPA of {oadp-short} uses the `nodeSelector` field to select which nodes can run the node agent. The `nodeSelector` field is the simplest recommended form of node selection constraint.

Any label specified must match the labels on each node.

The correct way to run the node agent on any node you choose is for you to label the nodes with a custom label:

[source,terminal]
----
$ oc label node/<node_name> node-role.kubernetes.io/nodeAgent=""
----

Use the same custom label in the `DPA.spec.configuration.nodeAgent.podConfig.nodeSelector`, which you used for labeling nodes. For example:

[source,terminal]
----
configuration:
  nodeAgent:
    enable: true
    podConfig:
      nodeSelector:
        node-role.kubernetes.io/nodeAgent: ""
----

The following example is an anti-pattern of `nodeSelector` and does not work unless both labels, `'node-role.kubernetes.io/infra: ""'` and `'node-role.kubernetes.io/worker: ""'`, are on the node:

[source,terminal]
----
    configuration:
      nodeAgent:
        enable: true
        podConfig:
          nodeSelector:
            node-role.kubernetes.io/infra: ""
            node-role.kubernetes.io/worker: ""
----
