(선택사항) "readonly":true는 읽기 전용 마운트를 만드는 선택적 JSON 문자열입니다.
기본적으로 볼륨 서비스는 읽기-쓰기 파일 시스템을 마운트합니다.
kf bindings 명령어를 사용하여 공간에 모든 바인딩을 나열할 수 있습니다. 다음 예시와 비슷한 출력이 표시됩니다.
$ 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-07-21(UTC)"],[],[],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.6/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."]]