Networking
The Nerve Data Gateway can be used to connect to data sources and sinks over the network, as well as to connect to applications that run locally on the same edge device.
External connections can simply be addressed using standard mechanisms like IP addresses or urls.
Connecting to applications that run locally on the same edge device can be done using a custom docker network. However, using a complete custom docker network might lead to issues when undeploying workloads. A custom network needs to be created in one workload (either the Nerve Data Gateway or the connected application) and is then used in the other workload as external network. This will lead to an issue when trying to undeploy the workload that created the network while the other workload is still using it. In the default workload, the Nerve DataGateway application creates the datagateway_network network.Other applications can use this network as external network in the compose file. In this case make sure, that the applications that use the network are always undeployed before the Nerve Data Gateway is undeployed.
A more convenient way to connect local applications to the Nerve Data Gateway is to use one of the isolated networks provided by the Nerve platform. By default, the Data Gateway is connected to the isolated1 network. So another application that is connected to the isolated1 network ( use external: true for the isolated1 network in the Docker Compose file ) can be addressed by the Data Gateway via container name resolution.
Isolated networks are automatically created by the Nerve platform and are not removed when a workload is undeployed. This will avoid any issues with undeployment.
When using a custom network to connect the Data Gateway to another application, or when using a network other than isolated1, first add the network to the networks section of the Data Gateways Docker Compose file (example with customnetwork):
...
networks:
isolated1:
external: true
customnetwork:
driver: bridge
datagateway_config_network:
driver: bridge
internal: true
datagateway_messagebus_network:
driver: bridge
internal: true
datagateway_network:
driver: bridge
services:
...
Then connect all protocol handler (all services with service names that end in handler) to the desired network:
...
services:
...
opcuaclienthandler:
...
networks:
...
customnetwork:
...
mqttclienthandler:
...
networks:
...
customnetwork:
...