Open Source IoT
  • Introduction
  • Docker Primer
  • Cloud Containers
  • Kubernetes Primer
  • Go Primer
  • Installing Mosquitto
  • Writing an MQTT client
  • Installing InfluxDB
  • InfluxDB Primer
  • From MQTT to InfluxDB
  • REST API to InfluxDB
  • Creating a Mobile App
  • Adding an Ingress Controller
  • Adding Authentication to the REST API
  • Realtime Browser Updates
  • Application Monitoring
  • Connecting a real device
  • FaaS to the Rescue
Powered by GitBook
On this page

Was this helpful?

Cloud Containers

PreviousDocker PrimerNextKubernetes Primer

Last updated 4 years ago

Was this helpful?

In , you ran multiple containers on your local machine: a Realtime container that connected to a Redis container. The Redis container is based on the Redis container image on Docker Hub. The Realtime container is built from custom Go code. The Realtime container exposes a web page at that connects to for realtime updates. The protocol used to obtain real time updates is either XHR Polling or WebSockets. The diagram below illustrates the setup:

In the next section, we will look at running these containers (Redis and Realtime) in a public cloud context. In this book, we will primarily use Microsoft Azure.

Azure Container Instances

With Azure Container Instances (ACI), Azure provides a simple way to run one or more containers in a container group. Continuing with our socket.io example, we will run the Redis and Realtime containers in such a group.

Click + Create a resource and then click Containers. Container Instances are listed under Kubernetes Service:

The portal is great if you want to run one container. If you want to run multiple containers in a container group, you will need to create a YAML file or an Azure Resource Manager (ARM) template. We will use a YAML file first and then show the corresponding ARM template. Whether you use a YAML file or an ARM template, in both cases you will need to use a command line to submit a deployment task.

If you do not have access to an Azure subscription, go to to obtain a free account. Simply follow the steps after clicking the Start Free button. When you are done, you will see the portal:

https://azure.microsoft.com/en-us/free/
Docker Primer
http://localhost:8888
http://localhost:888/socket.io