볼륨 풀을 만들거나 볼륨을 프로비저닝하기 전에 Private Service Connect (PSC)를 사용하여 가상 프라이빗 클라우드(VPC) 네트워킹을 구성하고, 필요한 API를 사용 설정하고, 적절한 IAM 역할을 부여해야 합니다.
프로젝트 생성 및 API 사용 설정
- Google Cloud 계정에 로그인합니다. Google Cloud를 처음 사용하는 경우 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $300의 무료 크레딧이 제공됩니다.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Filestore APIs.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Filestore APIs.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.
필요한 역할
Filestore 에이전트 볼륨을 설정하는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 다음 IAM 역할을 부여해 달라고 요청하세요.
-
서비스 연결 정책 및 VPC 네트워킹 구성: Compute 네트워크 관리자 (
roles/compute.networkAdmin) -
볼륨 풀 및 에이전트 볼륨을 비롯한 Filestore 인스턴스 및 관련 리소스를 보고 관리합니다.
Cloud Filestore 편집자 (
roles/file.editor)
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.
커스텀 역할이나 다른 사전 정의된 역할을 통해 필요한 권한을 얻을 수도 있습니다.
서비스 에이전트 초기화
프로젝트에 Filestore 인스턴스를 만들지 않은 경우 다음 명령어를 실행하여 Filestore 서비스 에이전트를 초기화합니다.
gcloud beta services identity create \
--service=file.googleapis.com \
--project=PROJECT_ID
PROJECT_ID를 Google Cloud프로젝트 ID로 바꿉니다.
서비스 에이전트에 권한 부여
Filestore 에이전트 볼륨을 설정하려면 Filestore 서비스 에이전트에 Cloud Filestore 편집자 (roles/file.editor) 역할을 부여하세요.
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:service-PROJECT_NUMBER@cloud-filer.iam.iam.gserviceaccount.com" \
--role="roles/file.editor"
다음을 바꿉니다.
PROJECT_ID: Google Cloud 프로젝트의 ID입니다.PROJECT_NUMBER:Google Cloud 프로젝트의 프로젝트 번호입니다.
Private Service Connect 네트워킹 구성
Filestore 에이전트 볼륨은 Private Service Connect를 사용하여 관리형 스토리지 인프라를 VPC 네트워크에 직접 연결합니다. Private Service Connect는 공개 IP 주소나 VPC 네트워크 피어링 구성 없이 비공개 고대역폭 저지연 통신을 보장합니다.
서비스 연결 정책을 만들려면 다음 명령어를 실행합니다.
gcloud network-connectivity service-connection-policies create POLICY_NAME \
--project=PROJECT_ID \
--region=REGION \
--network=projects/PROJECT_ID/global/networks/VPC_NETWORK \
--subnets=SUBNET_NAME \
--service-class=google-cloud-filestore
다음을 바꿉니다.
POLICY_NAME: 서비스 연결 정책의 이름(예:filestore-agent-psc-policy)PROJECT_ID: Google Cloud 프로젝트의 ID입니다.REGION: 볼륨 풀과 워크로드가 상주할 리전입니다(예:us-central1).VPC_NETWORK: 기존 VPC 네트워크의 이름입니다.SUBNET_NAME: Private Service Connect 엔드포인트 IP 주소가 할당될 지정된 리전의 일반 VPC 서브넷 이름입니다. 예를 들어--purpose플래그가PRIVATE로 설정된 기본 서브넷이 있습니다.
볼륨 풀 및 StorageClass 만들기
볼륨 풀은 에이전트 볼륨에 공유 스토리지 용량과 IOPS를 제공합니다.
GKE에서 볼륨 풀의 볼륨을 동적으로 프로비저닝하려면 볼륨 풀을 만든 다음 이를 참조하는 Kubernetes StorageClass를 정의합니다.
볼륨 풀 만들기
샘플 볼륨 풀을 만들려면 volumePools.create 엔드포인트에 HTTP POST 요청을 보냅니다.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{
"description": "Sample volume pool for agent volumes",
"network": "projects/PROJECT_ID/global/networks/VPC_NETWORK",
"defaultVolumeQuotaMib": 2048,
}' \
"https://file.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/volumePools?volumePoolId=VOLUME_POOL_ID"
다음을 바꿉니다.
PROJECT_ID: Google Cloud 프로젝트의 ID입니다.VPC_NETWORK: PSC 지원 VPC 네트워크의 이름입니다.LOCATION: 볼륨 풀이 배포된 리전입니다(예:us-central1).VOLUME_POOL_ID: 볼륨 풀의 식별자입니다(예:my-volume-pool).
자세한 내용은 볼륨 풀 만들기 및 관리를 참고하세요.
StorageClass 만들기
볼륨 풀을 참조하는 volume-pool-sc.yaml이라는 StorageClass 매니페스트를 만듭니다.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: volume-pool-sc
provisioner: filestore.csi.storage.gke.io
volumeBindingMode: Immediate
reclaimPolicy: Delete
allowVolumeExpansion: true
parameters:
volume-pool: "projects/<var>PROJECT_ID</var>/locations/<var>LOCATION</var>/volumePools/<var>VOLUME_POOL_ID</var>"
다음을 바꿉니다.
PROJECT_ID: Google Cloud 프로젝트의 ID입니다.LOCATION: 볼륨 풀이 배포된 리전입니다.VOLUME_POOL_ID: 볼륨 풀의 식별자입니다.
Filestore CSI 드라이버가 설치된 기존 GKE 클러스터가 있는 경우 StorageClass를 적용합니다.
kubectl apply -f volume-pool-sc.yaml
그렇지 않으면 Filestore 에이전트 볼륨용 GKE 환경 설정에서 클러스터를 설정한 후 이 매니페스트를 적용하세요.
다음 단계
- 볼륨 풀을 만들고 관리합니다.
- Filestore 에이전트 볼륨용 GKE 환경을 구성합니다.