📌 For instructions on how to use and how to contribute a node to EdgeNet, please see the EdgeNet website.
This repository contains the code necessary to automatically deploy an EdgeNet node. It consists of three parts:
- The bootstrap script which installs Ansible and runs the node playbook with ansible-pull.
- The Ansible roles, which setups SSH access, containerd, Kubernetes and the EdgeNet service.
- The EdgeNet service, which is run on every boot, via systemd, to configure the node hostname and network. It will also join the node to the cluster, if not already joined.
In most cases users will run the bootstrap script and wait until the node is ready. However, it is also possible to run the node playbook directly on the target machines with ansible-playbook.
The bootstrap.sh
script installs Ansible and Git, and runs the node playbook.
It can be configured with the following environment variables:
Name | Default | Description |
---|---|---|
EDGENET_ASK_CONFIRMATION |
1 | Whether to ask to continue or not. |
EDGENET_PLAYBOOK |
edgenet-node.yml | Name of the playbook to run. |
EDGENET_REF |
main | Git reference to use. |
EDGENET_REPOSITORY |
https://github.com/EdgeNet-project/node.git | URL of the Git repository containing the playbook to run. |
Create an EdgeNet user with SSH access and passwordless sudo.
Variable | Default | Description |
---|---|---|
edgenet_ssh_user |
edgenet | EdgeNet SSH user |
edgenet_ssh_port_alt |
25010 | Alternative SSH port if port 22 is unavailable |
edgenet_ssh_public_key |
[...] edgenet.planet-lab.eu (2021) | Public SSH key of the EdgeNet user |
Setup Docker and Kubernetes.
Variable | Default | Description |
---|---|---|
edgenet_service_state |
restarted | State of the EdgeNet systemd service |
edgenet_node_version |
- | The release of the EdgeNet service to install |
containerd_version |
- | The containerd version to install |
kubernetes_version |
- | The kubernetes version to install |
The EdgeNet service is written in Go, in the main.go
file and the pkg/
directory.
git clone git@github.com:EdgeNet-project/node.git && cd node
env EDGENET_REF="$(git rev-parse HEAD)" EDGENET_REPOSITORY="file://$(pwd)" ./bootstrap.sh
git clone git@github.com:EdgeNet-project/node.git && cd node
ansible-playbook --connection=local --inventory localhost, edgenet-node.yml
export EDGENET_REF=my-branch
bash -ci "$(wget -O - https://raw.githubusercontent.com/EdgeNet-project/node/${EDGENET_REF}/bootstrap.sh)"
- Create a GitHub release and wait for the completion of the associated workflow
- Update
edgenet_node_version
in vars/edgenet-production.yml
Alternatively, for debugging, you can compile the node binary locally and directly upload it to /opt/edgenet/node
on the remote node.
To run a playbook across all the nodes of the cluster:
kubectl get nodes -l node-role.kubernetes.io/control-plane!= -o json | jq -r '.items[].status.addresses[0].address' > nodes.ini
ansible-playbook -i nodes.ini ...
The EdgeNet software is free and open source, licensed under the Apache 2.0 license; we invite you to contribute. For more information, see EdgeNet-project/edgenet.