Use IoT Edge module to run a Kubernetes stateless application on your Azure Stack Edge Pro GPU device
APPLIES TO: Azure Stack Edge Pro - GPUAzure Stack Edge Pro 2Azure Stack Edge Pro RAzure Stack Edge Mini R
This article describes how you can use an IoT Edge module to deploy a stateless application on your Azure Stack Edge Pro device.
To deploy the stateless application, you'll take the following steps:
- Ensure that prerequisites are completed before you deploy an IoT Edge module.
- Add an IoT Edge module to access compute network on your Azure Stack Edge Pro.
- Verify the module can access the enabled network interface.
In this how-to article, you'll use a webserver app module to demonstrate the scenario.
Prerequisites
Before you begin, you'll need:
An Azure Stack Edge Pro device. Make sure that:
- Compute network settings are configured on the device.
- Device is activated as per the steps in Tutorial: Activate your device.
You've completed Configure compute step as per the Tutorial: Configure compute on your Azure Stack Edge Pro device on your device. Your device should have an associated IoT Hub resource, an IoT device, and an IoT Edge device.
Add webserver app module
Take the following steps to add a webserver app module on your Azure Stack Edge Pro device.
In the IoT Hub resource associated with your device, go to Automatic Device Management > IoT Edge.
Select and click the IoT Edge device associated with your Azure Stack Edge Pro device.
Select Set modules. On Set modules on device, select + Add and then select IoT Edge Module.
In the Add IoT Edge module:
Specify a Name for your webserver app module that you want to deploy.
Under Module settings tab, provide an Image URI for your module image. A module matching the provided name and tags is retrieved. In this case,
mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine
will pull an nginx image (tagged as 1.15.5-alpine) from the publicmcr.microsoft.com
registry.In the Container Create Options tab, paste the following sample code:
{ "HostConfig": { "PortBindings": { "80/tcp": [ { "HostPort": "8080" } ] } } }
This configuration lets you access the module using the compute network IP over http on TCP port 8080 (with the default webserver port being 80). Select Add.
Select Review + create. Review the module details and select Create.
Verify module access
Verify the module is successfully deployed and is running. On the Modules tab, the runtime status of the module should be running.
To get the external endpoint of the webserver app, access the Kubernetes dashboard.
In the left-pane of the dashboard, filter by iotedge namespace. Go to Discovery and Load balancing > Services. Under the list of services listed, locate the external endpoint for the webserver app module.
Select the external endpoint to open a new browser window.
You should see that the webserver app is running.
Next steps
- Learn how to Expose stateful application via an IoT Edge module.