Unlocking the living dimension of Cyber-Physical Systems across the computing continuum.
This repository is part of the MYRTUS Project, an EU initiative that pioneers a new generation of Cyber-Physical Systems (CPS) by embracing the principles of the EUCloudEdgeIoT Initiative.
MYRTUS envisions a unified computing continuum where 🌐 edge, ☁️ cloud, and ⚙️ fog environments cooperate seamlessly. To achieve this, it reinvents programming models, languages, and orchestration tools for collaborative, distributed, and decentralized systems.
myrtus-nodebinding provides a Kubernetes mutating admission webhook that enables scheduling pods onto specific nodes using custom annotations. It just takes the annotations content and mutates the pod spec accordingly. It supports the following scheduling mechanisms:
- NodeName annotation: Directly assign a pod to a node by name.
- NodeSelector annotation: Set a node selector to match nodes with specific labels.
- NodeAffinity annotation: Apply node affinity rules for more complex scheduling logic.
When you need to schedule a pod on a remote cluster using Liqo, you can just target a Virtual Node, but you don't have control over which physical node the pod will run on. This webhook allows you to specify the exact node or set of nodes where the pod should be scheduled.
Note: This webhook must be deployed on the provider cluster.
Schedule a pod on the consumer node and specify the annotation you want to use for scheduling. The webhook will intercept the pod creation request, read the annotations, and mutate the pod spec accordingly before it is sent to the Kubernetes API server.
Use these annotations to control the scheduling:
myrtus-nodebind.io/node-name: Specify the exact node name where the pod should be scheduled.myrtus-nodebind.io/node-selector: Provide a JSON string for node selector to match nodes with specific labels.myrtus-nodebind.io/node-affinity: Provide a JSON string for node affinity rules to define complex scheduling criteria.
Note: The values for
myrtus-nodebind.io/node-selectorandmyrtus-nodebind.io/node-affinitymust be valid JSON strings.
Deploy the webhook on the provider cluster using the provided Helm chart in the deployments/myrtus-nodebind/ directory.
You can install it with the following command:
helm install myrtus-nodebinding ./deployments/myrtus-nodebind/ --namespace myrtus-nodebind --create-namespaceAdd one of the annotations to your pod manifest:
apiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
myrtus-nodebind.io/node-affinity: "<node-name>"
spec:
containers:
- name: my-container
image: nginxDeploy the pod in an offloaded namespace. Liqo will handle automatically the offloading adding the node selector to target a virtual node.
- pod-nodename.yml: Schedule by node name
- pod-nodeselector.yml: Schedule by node selector
- pod-nodeaffinity.yml: Schedule by node affinity
