Skip to content

Commit

Permalink
Add a nodeAffinity rule to the controller and webhook deployments
Browse files Browse the repository at this point in the history
This commit prevents controller and webhook pods from being
scheduled on Windows nodes. Without these affinity rules, the
controller or webhook will fail to deploy to a cluster if they
are scheduled on a Windows node by Kubernetes.

There is no need for these two components to run on Windows nodes
for Tekton to support mixed Linux + Windows clusters.
  • Loading branch information
aiden-deloryn committed Apr 30, 2021
1 parent 06ae777 commit 4947431
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ spec:
app: tekton-pipelines-controller
version: "devel"
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
serviceAccountName: tekton-pipelines-controller
containers:
- name: tekton-pipelines-controller
Expand Down
8 changes: 8 additions & 0 deletions config/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ spec:
version: "devel"
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
Expand Down

0 comments on commit 4947431

Please sign in to comment.