Can't get Node JS Edge Modules running under kubernetes

Iain White 146 Reputation points
2021-09-07T15:40:40.43+00:00

We have some Edge Modules that we're trying to get running on K8s (k3os), using the edge k8s mini-site as a reference https://microsoft.github.io/iotedge-k8s-doc/.

We've had success with our C# modules - they're running fine, but our NodeJS modules are failing at initialisation.:

Error: connect ECONNREFUSED 127.0.0.1:35001                                                                                                                             ││     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14) 

The problem is when the module tries to connect to the iotedged runtime (Using WORKLOADURI which is defined as http://localhost:35001)

It seems that somewhere in nodejs it is resolving that URL, so instead of localhost it's calling 127.0.0.1.

When we exec's on to the module we tried to curl 127.0.0.1:35001 which wasn't responding but it was responding to localhost:35001, so I expect that's what's causing the problem.

Is this an issue that anyone else has encountered? Has anyone managed to get NodeJS modules running on K8s? It seems to me to be failing at the point that every NodeJS module would fail , in the boilerplate code that sets up the client transport - this isn't something that appears to be unique to anything in my module.

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
553 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful