# Assigning Agents to Kubernetes Nodes for the connectware-agent Helm Chart

## Assigning Agents to Kubernetes Nodes

You can target specific Kubernetes nodes with your agent using the Kubernetes node selector. This can for example be used to select a remote node close to your shop floor.

Kubernetes node selector is a set of one or more labels, that the target Kubernetes node must have, to be eligible to run the agent.

To set these node selector labels, use the `nodeSelector` value inside the agent’s entry in the `protocolMapperAgents` context of your `values.yaml` file.

**Example**

{% code lineNumbers="true" %}

```yaml
protocolMapperAgents:
  - name: bender-robots
    connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
    nodeSelector:
      mycompany.tld/node-location: shopfloor
      mycompany.tld/building: 1a
```

{% endcode %}

## Unsetting protocolMapperAgentDefaults Node Selector Labels

If you used the `nodeSelector` value in the `protocolMapperAgentDefaults` context of your `values.yaml` file, you can unset them for individual agents by setting the value of `nodeSelector` to `{}` inside the agents entry in the `protocolMapperAgents` context of your `values.yaml`.

**Example**

{% code lineNumbers="true" %}

```yaml
protocolMapperAgentDefaults:
  connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
  nodeSelector:
    mycompany.tld/node-location: shopfloor
    mycompany.tld/building: 1a
protocolMapperAgents:
  - name: bender-robots # this agent will use the node selector labels
  - name: welder-robots # this agent will NOT use the node selector labels
    nodeSelector: {}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cybus.io/2-1-2/documentation/agents/agents-in-kubernetes/configuring-agents-with-the-connectware-agent-helm-chart/assigning-agents-to-kubernetes-nodes-for-the-connectware-agent-helm-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
