您可以使用 kf bindings 指令列出 Space 中的所有繫結。畫面會顯示類似以下範例的輸出內容:
$ kf bindings
...
Listing bindings in Space: demo-space
Name App Service Age Ready
binding-spring-music-filestore-nfs spring-music filestore-nfs 71s True
...
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Configure NFS volumes\n\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nKf supports mounting NFS volumes using the `kf marketplace`.\n\nPrerequisites\n-------------\n\n[Complete NFS platform setup](/migrate/kf/docs/2.9/how-to/nfs-platform-setup).\n\nCreate an NFS service instance\n------------------------------\n\nRun `kf marketplace` to see available services. The built-in NFS service appears on the list if NFS is enabled on the platform. \n\n Broker Name Namespace Description\n nfsvolumebroker nfs mount nfs shares\n\nMount an external filesystem\n----------------------------\n\n### Create a service instance\n\nTo mount to an existing NFS service: \n\n kf create-service nfs existing \u003cvar label=\"Desired service instance name\" translate=\"no\"\u003eSERVICE-INSTANCE-NAME\u003c/var\u003e -c '{\"share\":\"\u003cvar label=\"NFS server address and share\" translate=\"no\"\u003eSERVER/SHARE\u003c/var\u003e\", \"capacity\":\"\u003cvar label=\"Kubernetes quantity formatted capacity\" translate=\"no\"\u003eCAPACITY\u003c/var\u003e\"}'\n\nReplace variables with your values.\n\n- \u003cvar translate=\"no\"\u003eSERVICE-INSTANCE-NAME\u003c/var\u003e is the name you want for this NFS volume service instance.\n- \u003cvar translate=\"no\"\u003eSERVER/SHARE\u003c/var\u003e is the NFS address of your server and share.\n- \u003cvar translate=\"no\"\u003eCAPACITY\u003c/var\u003e uses the [Kubernetes quantity](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) format.\n\nConfirm that the NFS volume service appears in your list of services. You can expect output similar to this example: \n\n $ kf services\n ...\n Listing services in Space: demo-space\n Name Type ClassName PlanName Age Ready Reason\n filestore-nfs volume nfs existing 6s True \u003cnil\u003e\n ...\n\n### Bind your service instance to an App\n\nTo bind an NFS service instance to an App, run: \n\n kf bind-service \u003cvar label=\"Your App name\" translate=\"no\"\u003eYOUR-APP-NAME\u003c/var\u003e \u003cvar label=\"Your service name\" translate=\"no\"\u003eSERVICE-NAME\u003c/var\u003e -c '{\"uid\":\"\u003cvar label=\"Your UID\" translate=\"no\"\u003e2000\u003c/var\u003e\",\"gid\":\"\u003cvar label=\"Your GID\" translate=\"no\"\u003e2000\u003c/var\u003e\",\"mount\":\"\u003cvar label=\"Your mount path\" translate=\"no\"\u003eMOUNT-PATH\u003c/var\u003e\",\"readonly\":true}'\n\nReplace variables with your values.\n\n- \u003cvar translate=\"no\"\u003eYOUR-APP-NAME\u003c/var\u003e is the name of the App for which you want to use the volume service.\n\n- \u003cvar translate=\"no\"\u003eSERVICE-NAME\u003c/var\u003e is the name of the volume service instance you created in the previous step.\n\n- `uid`:\u003cvar translate=\"no\"\u003eUID\u003c/var\u003e and `gid`:\u003cvar translate=\"no\"\u003eGID\u003c/var\u003e specify the directory permissions of the mounting share.\n\n | **Note:** For buildpack Apps, the value for `uid` and `gid` is always 2000. Otherwise, the user specified by `uid` and `gid` should be the `uid` and `gid` of the running App process.\n- \u003cvar translate=\"no\"\u003eMOUNT-PATH\u003c/var\u003e is the path the volume should be mounted to within your App.\n\n- (Optional) `\"readonly\":true` is an optional JSON string that creates a read-only mount.\n By default, Volume Services mounts a read-write file system.\n\n | **Note:** Your App automatically restarts when the NFS binding changes.\n\nYou can list all bindings in a Space using the `kf bindings` command. You will see output similar to this example: \n\n $ kf bindings\n ...\n Listing bindings in Space: demo-space\n Name App Service Age Ready\n binding-spring-music-filestore-nfs spring-music filestore-nfs 71s True\n ...\n\n### Access the volume service from your App\n\nTo access the volume service from your App, you must know which file path to use in your code.\nYou can view the file path in the details of the service binding, which are visible in the environment variables for your App.\n\nView environment variables for your App: \n\n kf vcap-services \u003cvar label=\"Your App name\" translate=\"no\"\u003eYOUR-APP-NAME\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eYOUR-APP-NAME\u003c/var\u003e with the name of your App.\n\nThe following is example output of the `kf vcap-services` command: \n\n kf vcap-services *YOUR-APP-NAME*\n {\n \"nfs\": [\n {\n \"instance_name\": \"nfs-instance\",\n \"name\": \"nfs-instance\",\n \"label\": \"nfs\",\n \"tags\": [],\n \"plan\": \"existing\",\n \"credentials\": {\n \"capacity\": \"1Gi\",\n \"gid\": 2000,\n \"mount\": \"/test/mount\",\n \"share\": \"10.91.208.210/test\",\n \"uid\": 2000\n },\n \"volume_mounts\": [\n {\n \"container_dir\": \"/test/mount\",\n \"device_type\": \"shared\",\n \"mode\": \"rw\"\n }\n ]\n }\n ]\n }\n\nUse the properties under `volume_mounts` for any information required by your App."]]