Affinity/toleration support for Daemonsets?

Hi,

I am deploying Gitpod on a shared GKE cluster with multiple nodepools.
Affinity works fine for Deployments
I am using something like in my values.yaml file:

affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
        - matchExpressions:
            - key: "gitpod.io"
              operator: "In"
              values: ["true"]

But it looks like the Daemonsets (registry-facade, ws-daemon) don’t use the affinity spec that is defined this way.
There is also doesn’t seems to be a way to set tolerations for Gitpod resources.

Any idea, how to ensure these Daemonsets are only spawned on nodes that will serve Gitpod workspaces ?

I

Hi,

I think your answer is here self-hosted/node-affinity.yaml at master · gitpod-io/self-hosted · GitHub

Regards

Actually the self-hosted repo is deprecated and the above doesn’t seem to work anymore.

Instead looking at gitpod/ws-daemon-daemonset.yaml at main · gitpod-io/gitpod · GitHub , gitpod/registry-facade-daemonset.yaml at main · gitpod-io/gitpod · GitHub and gitpod/_helpers.tpl at main · gitpod-io/gitpod · GitHub

I figured out that to control affinity for those daemonset you would need something like :

components:
  workspace:
    affinity:
      default: "gitpod.io"

In your values.yaml file

Although I have no idea what/how the other “prebuild”,“probe”,“regular” impact the behavior.

This still doesn’t allow to control tolerations as this doesn’t seem to be templated in the template.spec of the daemonset.