@@ -154,9 +154,9 @@ the class or PV. If a mount option is invalid, the PV mount fails.
154
154
# ## Volume Binding Mode
155
155
156
156
The `volumeBindingMode` field controls when [volume binding and dynamic
157
- provisioning](/docs/concepts/storage/persistent-volumes/#provisioning) should occur.
157
+ provisioning](/docs/concepts/storage/persistent-volumes/#provisioning) should occur. When unset, "Immediate" mode is used by default.
158
158
159
- By default, the `Immediate` mode indicates that volume binding and dynamic
159
+ The `Immediate` mode indicates that volume binding and dynamic
160
160
provisioning occurs once the PersistentVolumeClaim is created. For storage
161
161
backends that are topology-constrained and not globally accessible from all Nodes
162
162
in the cluster, PersistentVolumes will be bound or provisioned without knowledge of the Pod's scheduling
@@ -188,6 +188,36 @@ The following plugins support `WaitForFirstConsumer` with pre-created Persistent
188
188
and pre-created PVs, but you'll need to look at the documentation for a specific CSI driver
189
189
to see its supported topology keys and examples.
190
190
191
+ {{< note >}}
192
+ If you choose to use `waitForFirstConsumer`, do not use `nodeName` in the Pod spec
193
+ to specify node affinity. If `nodeName` is used in this case, the scheduler will be bypassed and PVC will remain in `pending` state.
194
+
195
+ Instead, you can use node selector for hostname in this case as shown below.
196
+ {{< /note >}}
197
+
198
+ ` ` ` yaml
199
+ apiVersion: v1
200
+ kind: Pod
201
+ metadata:
202
+ name: task-pv-pod
203
+ spec:
204
+ nodeSelector:
205
+ kubernetes.io/hostname: kube-01
206
+ volumes:
207
+ - name: task-pv-storage
208
+ persistentVolumeClaim:
209
+ claimName: task-pv-claim
210
+ containers:
211
+ - name: task-pv-container
212
+ image: nginx
213
+ ports:
214
+ - containerPort: 80
215
+ name: "http-server"
216
+ volumeMounts:
217
+ - mountPath: "/usr/share/nginx/html"
218
+ name: task-pv-storage
219
+ ` ` `
220
+
191
221
# ## Allowed Topologies
192
222
193
223
When a cluster operator specifies the `WaitForFirstConsumer` volume binding mode, it is no longer necessary
0 commit comments