Skip to content

Latest commit

 

History

History
125 lines (114 loc) · 7.53 KB

INSTALL-1.md

File metadata and controls

125 lines (114 loc) · 7.53 KB

Part 1 - Provision resources (Edge and Cloud)

Prepare and provision Cloud platform

  • Download the file 1_cloud-provision.yaml
  • Download the file variables_template.yaml and rename it to variables.yaml
  • Define variables in file variables.yaml to create Azure resources:
    SUBSCRIPTION_ID: ""                   # Id of your Azure subscription
    LOCATION: ""                          # Location (Azure region) where to create resources
    RESOURCE_GROUP: ""                    # Name of the Resource Group
    KEYVAULT_NAME: ""                     # Name of the Key Vault
    STORAGEACCOUNT_NAME: ""               # Name of the Storage Account. Length: 3-24. Valid Characters: lowercase letters and numbers.
    AIO_SERVICE_PRINCIPAL: ""             # Name of the Service Principal (service account) to manage Azure from the Edge Cluster, using Azure CLI (command-line interface)
    AIO_MANAGED_IDENTITY_SECRETS: ""      # Name of the Managed Identity for Azure IoT Operations secrets
    AIO_MANAGED_IDENTITY_COMPONENTS: ""   # Name of the Managed Identity for Azure IoT Operations components
    AIO_SCHEMA_REGISTRY_NAMESPACE: ""     # Name of the Schema Registry. Valid Characters: lowercase letters and numbers.
    AIO_CLUSTER_NAME: ""                  # Name of the Azure IoT Operations Cluster you want to deploy
    EVENTHUB_NAMESPACE: ""                # Name of the Event Hub Namespace
    EVENTHUB_NAME: ""                     # Name of the Event Hub inside the Event Hub Namespace
    FACTORY_AGENT_SERVICE_PRINCIPAL: ""   # Name of the Service Principal (service account) for the Factory Agent
    AZURE_OPENAI_NAME: ""                 # Name of the Azure Open AI service
  • Open a browser and navigate to the Azure Portal
  • Use the Azure Cloud Shell (Bash)
  • Once the variables defined in file variables.yaml, upload the files variables.yaml and 1_cloud-provision.yaml via Manage files > Upload.
  • Execute the playbook in Azure Cloud Shell to provision Azure Cloud resources
    ansible-playbook 1_cloud-provision.yaml
  • You should see the following when the playbook has finished successfully: ansible-prov-cloud-1
    ansible-prov-cloud-2
  • Now, open the variables.yaml file. It should contain additional information at the end (BEGIN/END ANSIBLE MANAGED BLOCK):
    # BEGIN ANSIBLE MANAGED BLOCK
    AIO_SP_APPID: ""
    AIO_SP_SECRET: ""
    AIO_SCHEMA_REGISTRY_ID: ""
    AIO_MANAGED_IDENTITY_SECRETS_ID: ""
    AIO_MANAGED_IDENTITY_COMPONENTS_ID: ""
    TENANT: ""
    ARC_OBJECT_ID: ""
    KEYVAULT_ID: ""
    FACTORY_AGENT_SP_APPID: ""
    FACTORY_AGENT_SP_SECRET: ""
    EVENTHUB_ID: ""
    EVENTHUB_KEY: ""
    # END ANSIBLE MANAGED BLOCK
  • Download the file variables.yaml via Manage files > Download > type variables.yaml > Download.
  • Copy the file variables.yaml to your Edge Cluster.
  • You should now see the following new resources in your Azure Resource Group (including hidden types):
    azure-deployed-1
  • You should now see the following 2 new App registrations in your Azure Entra ID:
    azure-deployed-1-1

Prepare and provision Edge Cluster

  • Hardware requirements

    • Resources:

      • CPU: 4 vCPU
      • Memory: 16GB
      • Storage: 30GB
    • Operating System: the solution requires a Linux-based system, specifically a VM or physical machine running Linux Ubuntu 24.04. This system will perform as an Edge Cluster, handling queries directly from the production line and interfacing with other operational systems.

  • Option A (Virtual Machine in Azure Cloud)

    • If you want to use a Virtual Machine in Azure, you can deploy it using the Deploy button below:
      Deploy to Azure
      azure-deployed-2
    • Fill the required information and click Review + create > Create

      Note: Standard_D4s_v3 is the recommended size for the Azure VM.

    • You should now see the following new resources in your Azure Resource Group (including hidden types): azure-deployed-2-2
  • Option B (your own Industrial PC or Virtual Machine)

    • Install Linux Ubuntu 24.04
  • Copy the file variables.yaml to your Edge Cluster (in your home user directory)

  • Login and execute the following commands on your Edge Cluster

    • Install Ansible:
      sudo apt update && sudo apt install ansible -y
    • Execute the playbook to install Azure IoT Operations to your Edge Cluster
      curl -O https://raw.githubusercontent.com/chriscrcodes/talk-to-your-factory/main/artifacts/templates/deploy/2_edge-install_aio.yaml
      ansible-playbook 2_edge-install_aio.yaml
      edge-deployed-1 edge-deployed-2
    • You should now see the following additional resources in Azure: azure-deployed-3
    • Execute the playbook to deploy demo components
      curl -O https://raw.githubusercontent.com/chriscrcodes/talk-to-your-factory/main/artifacts/templates/deploy/3_edge-deploy_demo_components.yaml
      ansible-playbook 3_edge-deploy_demo_components.yaml

Confirm Factory MQTT Simulator is running on the Edge Cluster

  • Deploy MQTT Client

    kubectl apply -f https://raw.githubusercontent.com/chriscrcodes/talk-to-your-factory/main/artifacts/templates/k3s/pods/mqtt-client/pod.yaml
  • Connect to the container running the MQTT client

    kubectl exec --stdin --tty mqtt-client -n azure-iot-operations -- sh
  • From within the container, launch the MQTT client:

    mqttui --broker mqtt://aio-broker-insecure:1883 --insecure
  • Confirm if the 2 following topics are present:

    • LightningCars (data coming from the Factory MQTT Simulator)
    • Silver (data coming from Azure IoT Operations 'bronze to silver' Data Flow)

    MQTT Broker Client

Confirm Data is flowing from Edge (Azure IoT Operations) to Cloud (Azure Event Hub)