Skip to content

Instantly share code, notes, and snippets.

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/592b64264485d0fe210448fc3802fda5 to your computer and use it in GitHub Desktop.
Save toddysm/592b64264485d0fe210448fc3802fda5 to your computer and use it in GitHub Desktop.
Hierarchical Azure IoT Edge - Layer 4 Modules (ACR Connected Registry with Connection String and API Proxy)
{
"modulesContent": {
"$edgeAgent": {
"properties.desired": {
"modules": {
"connectedRegistry": {
"settings": {
"image": "10.16.7.4/acr/connected-registry:0.2.0",
"createOptions": "{\"HostConfig\":{\"Binds\":[\"/home/azureuser/connected-registry:/var/acr/data\",\"/usr/local/share/ca-certificates:/usr/local/share/ca-certificates\",\"/etc/ssl/certs:/etc/ssl/certs\"]}}"
},
"type": "docker",
"env": {
"ACR_REGISTRY_CONNECTION_STRING": {
"value": "ConnectedRegistryName=<replace_with_the_connected_registry_name>;SyncTokenName=<replace_with_the_sync_token_name>;SyncTokenPassword=<replace_with_the_sync_token_password>;ParentGatewayEndpoint=10.16.7.4;ParentEndpointProtocol=<https or http>"
}
},
"status": "running",
"restartPolicy": "always",
"version": "1.0"
},
"IoTEdgeApiProxy": {
"settings": {
"image": "10.16.7.4/azureiotedge-api-proxy:latest",
"createOptions": "{\"HostConfig\": {\"PortBindings\": {\"443/tcp\": [{\"HostPort\": \"443\"}]}}}"
},
"type": "docker",
"version": "1.0",
"env": {
"NGINX_DEFAULT_PORT": {
"value": "443"
},
"CONNECTED_ACR_ROUTE_ADDRESS": {
"value": "connectedRegistry:8080"
},
"NGINX_CONFIG_ENV_VAR_LIST": {
"value": "NGINX_DEFAULT_PORT,BLOB_UPLOAD_ROUTE_ADDRESS,CONNECTED_ACR_ROUTE_ADDRESS,IOTEDGE_PARENTHOSTNAME,DOCKER_REQUEST_ROUTE_ADDRESS"
},
"BLOB_UPLOAD_ROUTE_ADDRESS": {
"value": "AzureBlobStorageonIoTEdge:11002"
}
},
"status": "running",
"restartPolicy": "always",
"startupOrder": 3
}
},
"runtime": {
"settings": {
"minDockerVersion": "v1.25",
"registryCredentials": {
"iotedgeforiiotACR": {
"address": "10.16.7.4",
"password": "<replace_with_the_sync_token_password>",
"username": "<replace_with_the_sync_token_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