Skip to content

ArubaKube/myrtus-nodebind

Repository files navigation

myrtus-nodebinding: Pod Scheduling Webhook

🌿 MYRTUS Project Component

Unlocking the living dimension of Cyber-Physical Systems across the computing continuum.

🧭 Overview

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.

Overview

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.

How It Works

Schema

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-selector and myrtus-nodebind.io/node-affinity must be valid JSON strings.

Usage

1. Install the Webhook

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-namespace

2. Annotate Your Pods

Add 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: nginx

3. Deploy in an offloaded namespace

Deploy the pod in an offloaded namespace. Liqo will handle automatically the offloading adding the node selector to target a virtual node.

Example Manifests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •