Skip to main content

Agent YAML Specification

Agents are components of an ECN which run on edge nodes. They communicate with Controllers to allow your edge nodes to host Microservices.

apiVersion: datasance.com/v3
kind: Agent
metadata:
name: meerkat
namespace: default
spec:
host: 30.40.50.6
ssh:
user: foo
keyFile: ~/.ssh/id_rsa
port: 22
config:
description: agent running on VM
latitude: 46.204391
longitude: 6.143158
agentType: auto
dockerUrl: unix:///var/run/docker.sock
diskLimit: 50
diskDirectory: /var/lib/iofog-agent/
memoryLimit: 4096
cpuLimit: 80
logLimit: 10
logDirectory: /var/log/iofog-agent/
logFileCount: 10
statusFrequency: 10
changeFrequency: 10
deviceScanFrequency: 60
bluetoothEnabled: true
watchdogEnabled: false
abstractedHardwareEnabled: false
upstreamRouters: ['default-router']
networkRouter: ''
routerConfig:
routerMode: edge
messagingPort: 5672
edgeRouterPort: 56721
interRouterPort: 56722
dockerPruningFrequency: 1
logLevel: INFO
availableDiskThreshold: 90
scripts:
dir: /tmp/my-scripts
deps:
entrypoint: install_deps.sh
install:
entrypoint: install_iofog.sh
args:
- 3.0.0-alpha1
uninstall:
entrypoint: uninstall_iofog.sh

Required Fields

The following fields are necessary for every Agent YAML specification.

FieldDescription
nameUser-defined unique identifier of Agent instance within an potctl namespace. Must start and end with lowercase alphanumeric character. Can include '-' character.
hostHostname of remote host that potctl must SSH into to install Agent service.
ssh.userUsername of remote host that potctl must SSH into to install Agent service.
ssh.keyFilePath to private SSH key that potctl must use to SSH into remote host to install Agent service.
ssh.portPort to use with SSH. Optional (default: 22).

Installation Plugin Fields

Agents can be specified to require user-defined installation scripts to be executed instead of the default potctl installation procedures.

Custom installation scripts are specified through the optional scripts field in the Agent YAML.

FieldDescription
dirSource directory containing all scripts to be used in Agent installation and uninstallation procedures. All files in this directory are copied to /etc/iofog/agent/ on the Agent host.
depsDetails pertaining to the script in scripts.dir which serves as the entrypoint to installing pre-requisites of ioFog Agent.
installDetails pertaining to the script in scripts.dir which serves as the entrypoint to installing ioFog Agent.
uninstallDetails pertaining to the script in scripts.dir which serves as the entrypoint to uninstalling ioFog Agent.
*.entrypointName of the script in scripts.dir which serves as the entrypoint to a procedure run on the Agent host.
.*.argsList of arguments to be provided to the entrypoint when invoked on the Agent host.

Configuration Fields

The following fields can be specified to modify Agent behaviour.

Note that these values can be overidden after Agent deployment through the AgentConfig kind specified here.

Configuration details are specified through the optional config field in the Agent YAML.

FieldDescription
nameUser-defined unique identifier of an agent within an ioFog Controller. Must start and end with lowercase alphanumeric character. Can include '-' character.
descriptionShort description of the agent
latitudeLatitude coordinate of the agent. The ioFog Agent will automatically try to detect its own latitude if it has access to the internet
longitudeLongitude coordinate of the agent. The ioFog Agent will automatically try to detect its own longitude if it has access to the internet
agentTypeArchitecture type of agent. It will be used to determine which image gets deployed. The accepted values are auto, x86 and arm. auto will have the ioFog agent detect the architecture it is running on, and report it to the ioFog controller. It defaults to auto if it fails to parse the value.
dockerUrlDocker engine socket
diskLimitLimit, in GiB, of disk space that the software is allowed to use
diskDirectorySet the directory to use for disk storage
memoryLimitSet the limit, in MiB, of RAM memory that the software is allowed to use for messages
cpuLimitSet the limit, in percentage, of CPU time that the software is allowed to use
logLimitSet the limit, in GiB, of disk space that the log files can consume
logDirectorySet the directory to use for log file storage
logFileCountSet the number of log files to evenly split the log storage limit
statusFrequencySet the status update frequency in seconds
changeFrequencySet the get changes frequency in seconds
deviceScanFrequencySet the scan devices frequency in seconds
bluetoothEnabledBoolean. Set on/off for the bluetooth service. If ON, this will install the restblue microservice
watchdogEnabledBoolean. If enabled, watchdog will kill all docker containers running on the agent if they are not part of the microservices deployed by ioFog. If enabled, only docker containers started by the agent process will be allowed to run
abstractedHardwareEnabledBoolean. Set on/off the HAL services. If ON, this will install the HAL microservice
upstreamRoutersSet the upstream routers (using Agent names or default-router)
networkRouterSet the network router (using Agent names or default-router)
hostHostname used for router communication and public ports. Default: host provided at deploy time.
routerConfigSet the router configuration
routerConfig.routerModeSet the router mode. Available values are edge, interior and none. Default: edge
routerConfig.messagingPortSet the router messaging port. Default: 5672
routerConfig.edgeRouterPortSet the router edge router port. Only valid if routerMode is interior. Default: 56721
routerConfig.interRouterPortSet the router interior router port. Only valid if routerMode is interior. Default: 56722
logLevelSet the standard logging levels that can be used to control logging output
dockerPruningFrequencySet the docker pruning frequency in hours
availableDiskThresholdSet the available disk threshold

Agent Configuration YAML Specification

Agent Configuration YAML files let you configure an ioFog Agent provisioned with your Controller. You can use Agent Configuration to modify the behaviour of an Agent after it is deployed.

An Agent Configuration can be retrieved using potctl describe agent-config <AGENT_NAME>

An Agent Configuration can be deployed using potctl deploy -f agent-config.yaml

apiVersion: datasance.com/v3
kind: AgentConfig
metadata:
name: agent-1 # ioFog Agent name
spec:
# All fields are optional - Only the specified fields will be updated
name: agent-1
description: agent running on VM
latitude: 46.204391
longitude: 6.143158
agentType: auto
dockerUrl: unix:///var/run/docker.sock
diskLimit: 50
diskDirectory: /var/lib/iofog-agent/
memoryLimit: 4096
cpuLimit: 80
logLimit: 10
logDirectory: /var/log/iofog-agent/
logFileCount: 10
statusFrequency: 10
changeFrequency: 10
deviceScanFrequency: 60
bluetoothEnabled: true
watchdogEnabled: false
abstractedHardwareEnabled: false
upstreamRouters: ['default-router']
networkRouter: ''
host: 123.123.123.123
routerConfig:
routerMode: edge
messagingPort: 5672
edgeRouterPort: 56721
interRouterPort: 56722
dockerPruningFrequency: 1
logLevel: INFO
availableDiskThreshold: 90