IoT and other data-intensive systems produce enormous amounts of data to be processed. In this project, we explore the Edge Computing concept as additional computational power to the Cloud nodes, allowing data process computations to occur closer to their source.
Using Kubernetes/KubeEdge to manage the data processing workloads, the geolocate-scheduler aims towards substantial improvements in scalability levels, reducing the request latency and network usage, by scheduling those workloads in Edge Nodes based on the geographical location of the data and resource availability.
⚠️ First, make sure you have deployed or are running the edge-deployment-controller in the cluster by following the instructions in the project repository. This controller is responsible for the management and reconciliation of the EdgeDeployments, which are the the resource type of our workloads.
ALGORITHM
defines the method used to select target nodes for workload placement available algorithms are:
location
(default): where nodes are filtered based on if they have enough available resources, and the target node is selected based on the deployment required/preferred locations,naivelocation
: where the target node is selected based on the deployment required/preferred locationsrandom
: where any edge node is a good fit for the given workloads
kubectl apply -f examples/release_scheduler_crd.yaml
docker build -t geolocate-scheduler .
To develop geolocate-scheduler in a Kubernetes cluster we use ksync to sync files between our local system, and the cluster.
-
Install ksync. You can follow ksync installation steps here.
-
Create a deployment where we will run the scheduler by applying the example/dev_scheduler_crd.yaml.
kubectl apply -f example/dev_scheduler_crd.yaml
-
If not done before then create a ksync configuration for the current folder.
ksync create --selector=component=geolocate-scheduler --reload=false --local-read-only=true $(pwd) /code
-
Start ksync update system
ksync watch
-
Run the scheduler in the cluster pod
kubectl exec -it $(kubectl get pod -n kube-system | grep geolocate-scheduler | awk '{print $1}') -- sh cd /code ALGORITHM=naivelocation go run main.go
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.39.0
golangci-lint ./...
go test --coverprofile=coverage.out ./...
go tool cover -html=coverage.out
go fmt ./...
The geolocate-scheduler only manages Edge nodes, because the main purpose is to allow application workload to be deployed near the source of data to be processed. Therefore, the node controller filters nodes by 'node.geolocate.io' labels.
-
To add the label
kubectl label node node0 --overwrite node.geolocate.io=
-
To remove the label
kubectl label node node0 --overwrite node.geolocate.io-
Apply any of the workload examples
-
No location set
kubectl apply -f examples/workload_no_set_location.yaml
-
Required location
kubectl apply -f examples/workload_required_location.yaml
-
Preferred location
kubectl apply -f examples/workload_preferred_location.yaml