Skip to content

Commit 55ac22a

Browse files
authored
add nodeAffinity rule to inline example
Ensure inline volume pod gets scheduled to a node with registered hostpath driver
1 parent 8a66919 commit 55ac22a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/csi-app-inline.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ apiVersion: v1
33
metadata:
44
name: my-csi-app-inline
55
spec:
6+
affinity:
7+
nodeAffinity:
8+
requiredDuringSchedulingIgnoredDuringExecution:
9+
nodeSelectorTerms:
10+
- matchExpressions:
11+
- key: topology.hostpath.csi/node
12+
operator: Exists
613
containers:
714
- name: my-frontend
815
image: busybox
@@ -13,4 +20,4 @@ spec:
1320
volumes:
1421
- name: my-csi-volume
1522
csi:
16-
driver: hostpath.csi.k8s.io
23+
driver: hostpath.csi.k8s.io

0 commit comments

Comments
 (0)