Skip to content

Commit fb7a95b

Browse files
authored
feat: add CSI controller affinity/anti-affinity rules (#325)
* Add CSI controller affinity/anti-affinity rules This ensures the replicas are scheduled to run on distinct control plane nodes on the guest cluster. These rules are the same as those of the cloud provider. Bump CSI driver chart version Signed-off-by: Ivan Sim <[email protected]>
1 parent 26fc006 commit fb7a95b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

charts/harvester-csi-driver/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ keywords:
1818
# This is the chart version. This version number should be incremented each time you make changes
1919
# to the chart and its templates, including the app version.
2020
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 0.1.22
21+
version: 0.1.23
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application. Versions are not expected to

charts/harvester-csi-driver/templates/deployment.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,31 @@ spec:
8888
tolerations:
8989
{{- toYaml . | nindent 8 }}
9090
{{- end }}
91+
affinity:
92+
nodeAffinity:
93+
requiredDuringSchedulingIgnoredDuringExecution:
94+
nodeSelectorTerms:
95+
# For RKE1
96+
- matchExpressions:
97+
- key: node-role.kubernetes.io/controlplane
98+
operator: Exists
99+
# For RKE2
100+
- matchExpressions:
101+
- key: node-role.kubernetes.io/control-plane
102+
operator: Exists
103+
podAntiAffinity:
104+
preferredDuringSchedulingIgnoredDuringExecution:
105+
- weight: 100
106+
podAffinityTerm:
107+
labelSelector:
108+
matchExpressions:
109+
- key: app.kubernetes.io/name
110+
operator: In
111+
values: [harvester-csi-driver]
112+
- key: component
113+
operator: In
114+
values: [csi-controllers]
115+
topologyKey: kubernetes.io/hostname
91116
volumes:
92117
- hostPath:
93118
path: {{ .Values.kubeletRootDir }}/harvester-plugins/driver.harvesterhci.io

0 commit comments

Comments
 (0)