Annotation-based Scheduling
Annotation-based scheduling allows a workload to be placed on a specific workload cluster by adding a Nova annotation to the workload manifest.
Use annotation-based scheduling when the target workload cluster is already known and the workload should be placed directly on that workload cluster.
When to Use This
Use annotation-based scheduling when:
- you want to explicitly place a workload on a specific workload cluster
- you are testing Nova placement behavior
- you need direct placement control for a small number of resources
For most production workloads, policy-based scheduling is usually preferred because it allows placement rules to be managed separately from workload manifests.
Placement Annotation
The nova.elotl.co/cluster annotation specifies the target workload cluster.
metadata:
annotations:
nova.elotl.co/cluster: workload-dev-1
Example Deployment
The following example places the nginx deployment on the workload cluster named workload-dev-1.
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: default
annotations:
nova.elotl.co/cluster: workload-dev-1
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:stable
Example Verification
After Nova places the workload, the scheduled object may include metadata that identifies the target workload cluster.
kubectl --context=nova get deployment nginx -o yaml
Example output:
metadata:
annotations:
nova.elotl.co/cluster: workload-dev-1
labels:
nova.elotl.co/target-cluster: workload-dev-1
Limitations
Annotation-based scheduling is simple, but it tightly couples the workload manifest to a specific workload cluster.
Use policy-based scheduling when:
- placement should be determined dynamically
- multiple workload clusters may be eligible
- placement rules should be managed independently from workload manifests
- workloads may need to move over time