Skip to content

Commit

Permalink
enhance: use soft node affinity instead of hard nodeSelector (#32676)
Browse files Browse the repository at this point in the history
pr: #32677

Signed-off-by: Liang Huang <[email protected]>
  • Loading branch information
samhuang-z committed Apr 29, 2024
1 parent 3a7154b commit 4e82bc4
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 35 deletions.
81 changes: 64 additions & 17 deletions tests/scripts/values/ci/pr-4am.yaml
Expand Up @@ -4,8 +4,14 @@ metrics:
log:
level: debug

nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand Down Expand Up @@ -73,8 +79,14 @@ pulsar:
components:
autorecovery: false
proxy:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand All @@ -96,8 +108,14 @@ pulsar:
memory: "100Mi"
cpu: "0.1"
broker:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand Down Expand Up @@ -131,8 +149,14 @@ pulsar:
backlogQuotaDefaultRetentionPolicy: producer_exception

bookkeeper:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand Down Expand Up @@ -165,8 +189,14 @@ pulsar:
memory: "4Gi"

zookeeper:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand All @@ -191,8 +221,14 @@ pulsar:
cpu: "0.3"
memory: "512Mi"
kafka:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"
tolerations:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"
Expand All @@ -209,9 +245,14 @@ kafka:
cpu: "0.3"
memory: "512Mi"
etcd:
nodeSelector:
node-role/nvme: "true"
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand All @@ -225,8 +266,14 @@ etcd:
cpu: "0.3"
memory: "100Mi"
minio:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand Down
82 changes: 64 additions & 18 deletions tests/scripts/values/ci/pr.yaml
Expand Up @@ -2,8 +2,14 @@ metrics:
serviceMonitor:
enabled: true

nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand Down Expand Up @@ -73,8 +79,14 @@ pulsar:
components:
autorecovery: false
proxy:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand All @@ -96,8 +108,14 @@ pulsar:
memory: "100Mi"
cpu: "0.1"
broker:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand Down Expand Up @@ -131,8 +149,14 @@ pulsar:
backlogQuotaDefaultRetentionPolicy: producer_exception

bookkeeper:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand Down Expand Up @@ -165,8 +189,14 @@ pulsar:
memory: "4Gi"

zookeeper:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand All @@ -191,8 +221,14 @@ pulsar:
cpu: "0.3"
memory: "512Mi"
kafka:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"
tolerations:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"
Expand All @@ -203,16 +239,20 @@ kafka:
cpu: "0.5"
memory: "1Gi"
zookeeper:

replicaCount: 1
resources:
requests:
cpu: "0.3"
memory: "512Mi"
etcd:
nodeSelector:
node-role/nvme: "true"
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand All @@ -226,8 +266,14 @@ etcd:
cpu: "0.3"
memory: "100Mi"
minio:
nodeSelector:
node-role.kubernetes.io/e2e: ""
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "node-role.kubernetes.io/e2e"
operator: "Exists"

tolerations:
- key: "node-role.kubernetes.io/e2e"
Expand Down

0 comments on commit 4e82bc4

Please sign in to comment.