# Configuring Target Connectware for the connectware-agent Helm Chart

## Configuring the Target Connectware Hostname

By default agents will target a Connectware installation in the same Kubernetes namespace. If your Connectware installation is in a different namespace or outside of this Kubernetes cluster, you need to specify the hostname under which Connectware is reachable for this agent.

In the default configuration the following network ports on Connectware must be reachable for the agent:

* TCP/443
* TCP/1883

Specify the hostname of Connectware that the agent connects to by setting the Helm value `connectwareHost` inside the agents entry in `protocolMapperAgents` context of your values.yaml file. For Connectware deployments in a different Kubernetes namespace this is `connectware.<namespace>`.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgents:
    - name: bender-robots
      connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
```

{% endcode %}

## Configuring Agents for Connectware with Separate control-plane-broker

To connect to a Connectware that uses the separate control-plane-broker, you need to set the Helm value `controlPlaneBrokerEnabled` to `true` 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
      controlPlaneBrokerEnabled: true
```

{% endcode %}

{% hint style="warning" %}
This adds TCP/1884 to required network ports.
{% endhint %}

## Enabling TLS for MQTT

To enable Transport Layer Security encryption for MQTT you set the parameter `mqtt.tls` inside the agents entry in `protocolMapperAgents` context of your values.yaml file to `true`.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgents:
    - name: bender-robots
      connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
      mqtt:
          tls: true
```

{% endcode %}

{% hint style="warning" %}
This adds TCP/8883 and TCP/8884 to required network ports.
{% endhint %}

## (Advanced) Overriding MQTT Target Parameters

By default, the `connectware-agent` Helm chart will control the parameters in this section, and adjust them according to your chosen configuration, however, optionally you can override these values in advanced setups.

### Override MQTT Data Host

To override the hostname which the agent will connect to using MQTT to move data, you set the parameter `mqtt.dataHost` 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
      mqtt:
          dataHost: broker.cybus
```

{% endcode %}

### Override MQTT Control Host

To override the hostname which the agent will connect to using MQTT to exchange control-plane information, you set the parameter `mqtt.controlHost` 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
      mqtt:
          controlHost: control-plane-broker.cybus
```

{% endcode %}

### Override MQTT Data Port

To override the TCP port which the agent will connect to using MQTT to move data, you set the parameter `mqtt.dataPort` 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
      mqtt:
          dataPort: 10883
```

{% endcode %}

### Override MQTT control-plane Port

To override the TCP port which the agent will connect to using MQTT to exchange control-plane information, you set the parameter `mqtt.controlPort` 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
      mqtt:
          controlPort: 10884
```

{% 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/1-10-2/documentation/agents/agents-in-kubernetes/configuring-agents-with-the-connectware-agent-helm-chart/configuring-target-connectware-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.
