Table of Contents maxLevel 2
...
Modify the hosts
file in the deploy/playbook
directory with the host names and IP addresses of the master, build, cicd, and edge nodes.
all:
hosts:
children:
deploy:
hosts:
localhost:
master:
hosts:
sdt-master: # hostname of master node
edge_nodes:
hosts:
jet03: # hostname of first edge node
ip: 192.168.2.27 # IP address of first edge node
lora_id: 1
jet04: # hostname of second edge node
ip: 192.168.2.29 # IP address of second edge node
lora_id: 4
vars:
ansible_user: edge
ansible_ssh_private_key_file: ~/.ssh/edge
build:
hosts:
sdt-build: # hostname of build node
ip: 192.168.10.203 # IP address of build node
cicd:
hosts:
sdt-cicd: # hostname of cicd node
ip: 192.168.10.200 # IP address of cicd node
Modify the host names and ip IP addresses of the master, build, cicd and deploy nodes in the cicd/playbook/hosts
file.
...
- Make sure there are entries for the cicd, build, master and edge node names in
/etc/hosts
- Install required software packages including Docker, Kubernetes, pip, and mosquitto
- Install Python packages used by other playbooks (
kubernetes
andcryptography
) - Make sure the user can run Docker commands
- Prepare basic configuration for Docker and Kubernetes
- Set up a user name and password for the MQTT service
...
Once the key files have been created, the following command can be run from the deploy node to copy the key to build node so a password will not be required for each login. (The administrative user's password will be requested when running this command.)
ssh-copy-id -
i ~/.ssh/lfedge_build.pub sdt-admin@nodename
Note, if you use an administrative account with a different name, change the variable ansible_user
in the build
group in the cicd/playbook/hosts
file to match the user name you are using.
...
The playbook will perform the following initialization tasks:
- Make sure there is an entry are entries for the master node and deploy node nodes in
/etc/hosts
- Install required software packages including Docker and Go and Robot Framework
- Make sure the user can run Docker commands
- Configure Docker, including adding the certificates to secure access to the private registry
...
Once the key files have been created, the following command can be run from the deploy node to copy the key to build node so a password will not be required for each login. (The administrative user's password will be requested when running this command.)
ssh-copy-id -
i ~/.ssh/lfedge_cicd.pub sdt-admin@nodename
Note, if you use an administrative account with a different name, change the variable ansible_user
in the cicd
group in the cicd/playbook/hosts
file to match the user name you are using.
...
Note, limited by base image NVIDIA L4T CUDA which only supports arm architecture, so custom service imageservice image-
app also app
also only supports arm architecture. Other custom services support both arm64 and amd64 architectures.
This command executed on the deploy node will build local docker images of the custom microservices:
...
The build command can take some time, depending on connection speed and the load on the deploy host, especially the compilation of cross-compiled images.
This command executed on the deploy node will push the images to the private registry:
...
This command only starts the master node in the Kubernetes cluster. The state of the master node can be confirmed using the kubectl get node
command command on the master node.
sdt-admin@sdt-master:~$ kubectl get node
NAME STATUS ROLES AGE VERSION
master Ready control-plane,master 3d5h v1.22.9
...
ansible-playbook -i ./hosts join_cluster.yml
The kubectl get nodenodes
command on the master node can be used to confirm the state of the edge nodes.
...
- Modify the file
edgex.yml
in thedeploy/playbook/group_vars/all
directory to decide which services will be started. For details, please refer to the sectionEnabling and Disabling Optional Services
below. - If the custom service
device-camera
will be started, set thecamera_ip
value to the IP address of the camera node in thedeploy\playbook\host_vars\jet03.yml
file and thedeploy\playbook\host_vars\jet04.yml
file. - If you are using different hostnames host names of the edge nodes, change the file name of files in the
deploy\playbook\host_vars
directory, and changedestination_host
value in the files in thedeploy\playbook\host_vars
directory.
...
Note, during initialization of the services you may see some containers restart one or more times. This is part of the timeout and retry behavior of the services waiting for other services to complete initialization and does not indicate a problem.
Camera Nodes
Consult the installation instructions for the H.View HV-500E6A hardware.
Readings received from Camera nodes should appear in the core-data
database and be possible to monitor using the edgex-events-nodename
channel. For example, the following command run on the master node should show the readings arriving at an edge node named "jet03":
...
*** Settings ***
Library SSHLibrary
Library String
*** Variables ***
${HOME} /home/sdt-admin # host directory of build and deploydeploy node
${DEPLOY_HOST} sdt-deploy # hostname of deploy node
${DEPLOY_USER} sdt-admin # username of deploy node
${DEPLOY_KEY} ${HOME}/.ssh/lfedge_deploy # private key in build node to access deploy node
${DEPLOY_PWD} password
${PLAYBOOK_PATH} lf-edge/deploy/playbook # playbook path of build and deploy node
${EDGE_HOST1} jet03 # hostname of edge node#1
${EDGE_HOST2} jet04 # hostname of edge node#2
${EDGE_USER} edge # username of edge node
${EDGE_KEY} ${HOME}/.ssh/edge # private key in deploy node to access edge node
*** Keywords ***
……
……
...
The custom services can be rebuilt by running the build_images.yml
playbook in cicd/playbook
. After successfully building a new version of a service, use push_images.yml to push the images to the private Docker registry. The source for the services is found in edgex/sync-app, edgex/image-app, edgex/device-camera,
and edgex/device-lora
.
License
...
LoRa Device Service
The LoRa device service is linked with the following packages when compiled:
Image Application
The image application is linked with the following packages when compiled:
Camera Device Service
The camera device service is linked with the following packages when compiled:
References
- EdgeX Foundry Documentation (release 2.1): https://docs.edgexfoundry.org/2.1/
...
- CPS: Cyber-Physical System
- MQTT: A lightweight, publish-subscribe network protocol designed for connecting remote devices, especially when there are bandwidth constraints. (MQTT is not an acronym.)