## 5 The COGNIFOG Project
### Technology Demonstrator
This provides a foundation using real data, with the flexibility to scale up in complexity by adding more simulated weather stations or simulated cameras. The application is deployed using Quick Start and is composed of two different clusters--see Figure 3:  
* The Management cluster is the central control plane responsible for managing other Kubernetes clusters. Its role is to check the managed clusters, schedule workload, and verify the state of the other clusters. In Quick Start, this cluster hosts COGNIFOG components from the modelling, DevOps, and governance layers. * The Working cluster supports the policies, governance, and execution workload defined by the management cluster. This is the cluster where user applications are deployed. In this cluster, there are COGNIFOG components from runtime and governance layers. For the Technology Demonstrator, the environment to run Quick Start is a Cloud provided 20-core CPU with 64 GB of RAM. Quick Start uses Vagrant to create eight virtual machines with specific roles:  
Figure 3: Deploying the technology demonstrator using the COGNIFOG architecture. * Manager (x1): This node is the control plane for the management cluster. At this point, it hosts the components receiving the monitoring data and the components to deploy data on working nodes. * Master (x1): This node is the control plane of the working cluster. It hosts the Smart Allocator responsible for selecting how the applications are deployed and the native components of Kubernetes. * Edge node (x2): These nodes are mainly present to host application code including Object detection and webpages to display results of computation. Additionally, they support a Prometheus monitor node to monitor CPU, RAM, and energy consumption. They are hosted in the working cluster. * Heavy edge node (x1): This node is responsible for hosting components needed by the COGNIFOG framework in the working nodes: Polygraph monitoring (latency, period, and bandwidth application monitoring), an MQTT Broker and Prometheus monitor (CPU, RAM, and energy consumption monitoring). It is hosted in the working cluster. * Relays (x3): In Quick Start, they represent the entry points of the sensors (weather station data and camera frames) in the COGNIFOG platform. In the use cases of the project, these relays correspond to the IoT Edge Gateway. The components hosted in these VMs are the MQTT Broker, an application responsible for adding localisation metadata in MQTT messages, and the Prometheus monitor. Prometheus is an open-source monitoring and alerting tool. It collects and stores data (like CPU usage, RAM usage, and energy consumption) from configured targets. They are hosted in the working cluster. One of the key goals of Quick Start and the underlying COGNIFOG platform is to reduce the setup and installation time of the various physical devices needed to run CEI apps. In a traditional scenario, it would typically take 45-60 min to install OS, configure networking, and install and configure Kubernetes for each machine. However, by using Quick Start (which in turn uses Vagrant and Ansible) we can reduce the setup time including creation and configuration of the VMs with K3s and network configuration to less than 5 min. The drastic reduction in setup time, from 45 to 60 min to under 5 min, is achieved by leveraging Vagrant for automated VM provisioning and Ansible for declarative configuration management, eliminating manual, time-consuming steps like OS installation, network setup, and Kubernetes configuration on each individual machine. Perhaps more importantly, by leveraging the COGNIFOG capabilities, we are able to scale our deployment by multiplying the number of working clusters as computing needs increase. As discussed in Section 5.2, multi-cluster management is achieved by using OCM (Open Cluster Management) and the Orchestrator Scheduler. OCM provides a single control plane to avoid the manual context switches in Kubernetes. It helps in the deployment of the applications by ensuring the placement of the workload in the most suitable cluster.