Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host env. vars in Deployment (proxy) #7416

Open
frankvdbh opened this issue Jan 27, 2025 · 2 comments
Open

Host env. vars in Deployment (proxy) #7416

frankvdbh opened this issue Jan 27, 2025 · 2 comments

Comments

@frankvdbh
Copy link

We have the requirement to use proxy servers for connecting various Edge devices.
The problem is that the proxy server is always different.

When a device is staged or first set-up, we can configure the device unique proxy settings in various places (docker runtime, edgeAgent container , .. following https://learn.microsoft.com/en-us/azure/iot-edge/how-to-configure-proxy-support?view=iotedge-1.5.)

However the problem is that we are not able to have dynamic proxy settings or variables inside a deployment:

Configure the edgeAgent module environment variables manually on the device itself, so that the IoT Edge agent can make the initial connection to IoT Hub. After the initial connection, you can configure the edgeAgent module remotely

Is there no possibility to take the proxy settings or environment variables from the host Edge device only ? We would now require unique deployments for each such device which is not possible given the deployment limits in Iot Hub.

@frankvdbh
Copy link
Author

Similar Topic on Learn Q&A : https://learn.microsoft.com/en-us/answers/questions/2154202/iot-edge-variables-per-device-(proxy-setting)?comment=answer-1909937&page=1#comment-1894770

We configure variables in [agent.env] section of config.toml.
They are active when the edgeAgent container is first created.
As soon as the Iot Edge deployment is retrieved, the environment variables from config.toml are no longer in place. They are also not specified in the deployment manifest.
Is this by design or is there a way to always have merged set of variables from config.toml file and optionally override from deployment manifest?

@frankvdbh
Copy link
Author

I implemented the following workaround:

  • custom docker images based on the normal edgeAgent and edgeHub images.
  • adding volume mapping for edgeAgent and edgeHub modules in the deployment manifest

The custom docker image has a wrapper entrypoint script that fetches the proxy setting from config file (visible via volume mapping) and then sets the https_proxy environment variable before starting the edgeAgent / edgeHub app.

This seems to work fine and allows me to use a same deployment manifest for all devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant