# Configuring Compute Resources for the connectware-agent Helm Chart

Compute resource requests are used by Kubernetes to schedule workloads on a node that has the required resources available. Compute resource limits are used to limit a workloads consumption.

In order to be scheduled in Kubernetes highest Quality of Service class, agents installed through the `connectware-agent` Helm chart come with a default of using the same value for requests and limits. These values are:

| Resource | Value (request and limit) |
| -------- | ------------------------- |
| CPU      | 2000m                     |
| Memory   | 2000Mi                    |

To adjust the compute resources for the agent, specify a Kubernetes Quantity for `cpu` and `memory` for `resources.requests` and `resources.limits` inside the agents entry in `protocolMapperAgents` context of your `values.yaml` file.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgents:
  - name: bender-robots
    connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
    resources:
      requests:
        cpu: 1000m
        memory: 1500Mi
      limits:
        cpu: 3000m
        memory: 2500Mi
```

{% endcode %}

Hint: `cpu` is usually specified in `m`, representing “Milli-CPU”, with `1000m` roughly meaning one CPU core. `memory` is usually specified in `Mi`, representing “Mebibytes”.

## Removing Default Values

In order to be scheduled in Kubernetes highest Quality of Service class, agents installed through the `connectware-agent` Helm chart come with a default of using the same value for requests and limits. These values are:

| Resource | Value (request and limit) |
| -------- | ------------------------- |
| CPU      | 2000m                     |
| Memory   | 2000Mi                    |

To remove either you can set the value `resources.request` and `resources.limits` inside the agents entry in `protocolMapperAgents` context of your `values.yaml` file to an empty YAML object `{}`.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgents:
  - name: bender-robots
    connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
    resources:
      limits: {} # Limits are removed from this agent
```

{% endcode %}

You can also completely remove resource definitions by setting `resources` inside the agents entry in `protocolMapperAgents` context of your `values.yaml` file to an empty YAML object `{}`.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgents:
  - name: bender-robots
    connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
    resources: {} # No resources are specified for this agent
```

{% endcode %}

## Full Example: Individual Resources for a Single Agent

In this example, we will set lower default resources, but for our agent `welder-robots` we will request more resources and remove limits, as we do want it to not be limited for its important work.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgentDefaults:
  connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
  resources:
    requests:
      cpu: 500m
      memory: 500Mi
    limits:
      cpu: 1500m
      memory: 2000Mi
protocolMapperAgents:
  - name: bender-robots # this agent will have the default resources
  - name: welder-robots # this agent will have more resource requests and no limits
    resources:
      requests:
        cpu: 2000m
        memory: 2000Mi
      limits: {}
  - name: painter-robots # this agent will have the default resources
```

{% endcode %}
