Skip to content

Instantly share code, notes, and snippets.

@toddysm
Created April 16, 2021 01:28
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/3aec198a24cb9579299ba5728e174cd0 to your computer and use it in GitHub Desktop.
Save toddysm/3aec198a24cb9579299ba5728e174cd0 to your computer and use it in GitHub Desktop.
Hierarchical Azure IoT Edge - Layer 5 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": "https://mcr.microsoft.com"
}
},
"status": "running",
"restartPolicy": "always"
},
"iotEdgeApiProxy": {
"settings": {
"image": "mcr.microsoft.com/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": "mcr.microsoft.com/azureiotedge-agent:1.2",
"createOptions": "{}"
},
"type": "docker"
},
"edgeHub": {
"settings": {
"image": "mcr.microsoft.com/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"
},
"https_proxy": {
"value": "http://10.16.8.4:3128"
}
},
"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