Skip to content

Instantly share code, notes, and snippets.

@toddysm
Created May 11, 2021 01:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toddysm/69004e6b20441bc696900cee1a2c246d to your computer and use it in GitHub Desktop.
Save toddysm/69004e6b20441bc696900cee1a2c246d to your computer and use it in GitHub Desktop.
Hierarchical Azure IoT Edge - Layer 4 Modules (OSS Registry + API Proxy)
{
"modulesContent": {
"$edgeAgent": {
"properties.desired": {
"modules": {
"registry": {
"settings": {
"image": "registry:latest",
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5000/tcp\":[{\"HostPort\":\"5000\"}]}}}"
},
"type": "docker",
"version": "1.0",
"env": {
"REGISTRY_PROXY_REMOTEURL": {
"value": "http://10.16.7.4"
}
},
"status": "running",
"restartPolicy": "always"
},
"iotEdgeApiProxy": {
"settings": {
"image": "10.16.7.4/azureiotedge-api-proxy:1.0",
"createOptions": "{\"HostConfig\": {\"PortBindings\": {\"443/tcp\": [{\"HostPort\": \"443\"}]}}}"
},
"type": "docker",
"version": "1.0",
"env": {
"NGINX_DEFAULT_PORT": {
"value": "443"
},
"DOCKER_REQUEST_ROUTE_ADDRESS": {
"value": "dockerContainerRegistry:5000"
}
},
"status": "running",
"restartPolicy": "always",
"startupOrder": 3
}
},
"runtime": {
"settings": {
"minDockerVersion": "v1.25",
"registryCredentials": {
"iotedgeforiiotACR": {
"address": "<replace_with_your_ACR_login_server>",
"password": "<replace_with_your_ACR_login_password>",
"username": "<replace_with_your_ACR_login_name>"
}
}
},
"type": "docker"
},
"schemaVersion": "1.1",
"systemModules": {
"edgeAgent": {
"settings": {
"image": "10.16.7.4/azureiotedge-agent:1.2",
"createOptions": "{}"
},
"type": "docker"
},
"edgeHub": {
"settings": {
"image": "10.16.7.4/azureiotedge-hub:1.2",
"createOptions": "{\"HostConfig\": {\"PortBindings\": {\"5671/tcp\": [{\"HostPort\": \"5671\"}],\"8883/tcp\": [{\"HostPort\": \"8883\"}]}}}"
},
"type": "docker",
"env": {
"experimentalFeatures:enabled": {
"value": "true"
},
"experimentalFeatures:nestedEdgeEnabled": {
"value": "true"
}
},
"status": "running",
"restartPolicy": "always"
}
}
}
},
"$edgeHub": {
"properties.desired": {
"routes": {
"ToUpstream": "FROM /messages/* INTO $upstream"
},
"schemaVersion": "1.1",
"storeAndForwardConfiguration": {
"timeToLiveSecs": 7200
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment