You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pod 可能具有的其他节点约束,例如:如节点资源需求、节点选择器、Pod亲和性和 Pod 反亲和性。
1218
+
Pod 可能具有的其他节点约束,例如:如节点资源需求、节点选择器、Pod 亲和性和 Pod 反亲和性。
1220
1219
1221
1220
<!--
1222
1221
An external static provisioner can be run separately for improved management of
@@ -1254,17 +1253,44 @@ writers simultaneously.
1254
1253
时会被保存,卷只是被卸载。
1255
1254
这意味着 `nfs` 卷可以被预先填充数据,并且这些数据可以在 Pod 之间共享。
1256
1255
1256
+
```yaml
1257
+
apiVersion: v1
1258
+
kind: Pod
1259
+
metadata:
1260
+
name: test-pd
1261
+
spec:
1262
+
containers:
1263
+
- image: registry.k8s.io/test-webserver
1264
+
name: test-container
1265
+
volumeMounts:
1266
+
- mountPath: /my-nfs-data
1267
+
name: test-volume
1268
+
volumes:
1269
+
- name: test-volume
1270
+
nfs:
1271
+
server: my-nfs-server.example.com
1272
+
path: /my-nfs-volume
1273
+
readonly: true
1274
+
```
1275
+
1257
1276
<!--
1258
1277
You must have your own NFS server running with the share exported before you can use it.
1278
+
1279
+
Also note that you can't specify NFS mount options in a Pod spec. You can either set mount options server-side or use [/etc/nfsmount.conf](https://man7.org/linux/man-pages/man5/nfsmount.conf.5.html). You can also mount NFS volumes via PersistentVolumes which do allow you to set mount options.
See the [NFS example](https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs) for more details.
1291
+
See the [NFS example](https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs) for an example of mounting NFS volumes with PersistentVolumes.
0 commit comments