Pod Compatibility for Joulie

Joulie uses Kubernetes scheduling constraints as the single source of truth for workload placement intent.

Power profile supply is exposed on node label:

  • joulie.io/power-profile=performance
  • joulie.io/power-profile=draining-performance (temporary transition state)
  • joulie.io/power-profile=eco

Workload behavior:

  • performance workload: require joulie.io/power-profile=performance
  • eco workload: require joulie.io/power-profile=eco
  • unconstrained workload: no power-profile affinity, can run on either profile

Base Pod Spec

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-workload
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-workload
  template:
    metadata:
      labels:
        app: my-workload
    spec:
      containers:
      - name: app
        image: ghcr.io/example/app:latest

Performance-only Pod (lines to add)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-workload
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-workload
  template:
    metadata:
      labels:
        app: my-workload
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: joulie.io/power-profile
                operator: In
                values: ["performance"]
      containers:
      - name: app
        image: ghcr.io/example/app:latest

Eco-only Pod (lines to add)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-workload
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-workload
  template:
    metadata:
      labels:
        app: my-workload
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: joulie.io/power-profile
                operator: In
                values: ["eco"]
      containers:
      - name: app
        image: ghcr.io/example/app:latest

Unconstrained Pod

Do not set power-profile affinity. Kubernetes can schedule it on either eco or performance nodes.

Note on transitions:

  • during performance -> eco safeguard phase, operator may set node label to draining-performance;
  • strict performance and strict eco affinity pods do not match that temporary label;
  • this helps avoid admitting new strict placements while a node is draining.

Reference manifests: