GCP準備
この記事では主に、BYOCタイプのウェアハウスを作成する際に関わるGCP操作について紹介します。これにはVPCとサブネットの準備、**リソースオーケストレーションについて(オプション)**が含まれます。
VPCとサブネットの準備
BYOCタイプのウェアハウスを作成する前に、要件を満たす既存のVPCとサブネットがない場合は、事前にVPCとサブネットを作成する必要があります。以下が具体的な操作です:
注意:
- リージョン、アベイラビリティゾーン、サブネット要件を満たすVPCとサブネットが存在し、このVPCにBYOCウェアハウスをデプロイしたい場合は、以下の新しいVPCとサブネットを作成する手順をスキップしてください。
- 現在サポートされているリージョンとアベイラビリティゾーンは:
| Cloud Platform | Region Name | Region ID | Availability Zone ID |
|---|---|---|---|
| GCP | US West 1 | us-west1 | all |
| GCP | US East 4 | us-east4 | all |
VPCとサブネットの作成
GCP VPC Network コンソールを開き、BYOCウェアハウスをデプロイしたいリージョンに切り替えます。

VPC networks > CREATE VPC NETWORK をクリックしてVPC作成ページに入ります。
VPC Name を入力し、Custom モードを選択します。

サブネット Name を入力し、Region を選択し、IPv4 range を入力します。
注意: 現在サポートされているリージョンとアベイラビリティゾーンは:
| Cloud Platform | Region Name | Region ID | Availability Zone ID |
|---|---|---|---|
| GCP | US West 1 | us-west1 | all |
| GCP | US East 4 | us-east4 | all |
Private Google Access、Flow logs、Hybrid subnetは off を選択します。

Firewallルールリストのチェックを外します。

Dynamic Routingモードは Regional を、Best path selectionモードは Legacy を選択します。

CREATE をクリックしてVPCとサブネットの作成を完了します。
リソースオーケストレーションについて(オプション)
注意:この章では何も行う必要はありません。動作原理について詳しく知りたい場合は、続きをお読みください。
お客様のクラウドアカウント下でGCP CloudShellを通じてterraformテンプレートを実行する際、VPC、Compute Engine、Bucketsなどのクラウドリソースに関連する操作を実行するため、一連のIAM権限が必要です。
このスクリプトは管理者権限を使用して実行するか、管理者にこのスクリプトの実行を依頼してください。そうでなければ、権限不足によりテンプレート実行が失敗する可能性があります。
Terraformテンプレートの説明
VeloDBが提供するTerraformリソースオーケストレーションテンプレートはお客様のGCPアカウント下で実行され、テンプレートコードは可視化され監査可能であり、VPC内のお客様のデータや他の環境に対して操作を行うことはありません。以下のリンクからVeloDBが提供するTerraformテンプレートを取得できます:
https://storage.googleapis.com/velodb-cloud-online-us-west-1/public/gcp-byoc.tf
上記のTerraformテンプレートをGCP CloudShellで実行すると、自動的にAgentを作成してデプロイします。その後、AgentはVeloDB Cloudとプライベート接続を確立し、ウェアハウスの初期化プロセスを完了します。
リソースオーケストレーションスクリプトが実行された後、VeloDB Cloudプラットフォームから対応するウェアハウスに入り、通常のウェアハウスを使用するのと同じようにデータ分析用のコンピューティングクラスターの作成を開始できます。
リソース情報
-
Compute Engine Instance
- 名前: VeloDBAgent
- 目的: Agent、Prometheus、FluentBitおよびその他のプログラムをデプロイするために使用
-
Private Service Connect Endpoint
- 名前: VeloDBEndpoint
- 目的: VeloDB Manageサービスとプライベートネットワーク接続を確立し、制御命令をプルしてモニタリングとログの一方向プッシュを有効にする
-
VPC Firewall Rules
- 名前: VeloDBSecurityGroupIngress、VeloDBSecurityGroupEgress
- 目的: VeloDBによって起動されるすべてのVMインスタンスにバインドされ、セキュリティグループルールを通じてトラフィックを制限する(同じセキュリティグループからのすべてのトラフィックがすべてのポートにアクセスすることを許可、同じサブネットからのトラフィックがポート5000にアクセスすることを許可、すべてのアウトバウンドトラフィックを許可)
-
Cloud Storage Bucket
- 名前: VeloDBBucket
- 目的: データウェアハウスデータを格納するために使用
-
VPC Firewall Rules
- 名前: VeloDBSecurityGroupIngress、VeloDBSecurityGroupEgress
- 目的: エンドポイントとVeloDBによって作成されるすべてのVMインスタンスにバインドされ、ファイアウォールルールを通じて特定のポートとソースに対するインバウンドおよびアウトバウンドトラフィックを制限する
-
IAM & Service Account & Custom Role
- 名前:
- VeloDBControlPlaneRole(コントロールプレーンサービスアカウント)
- VeloDBControlPlaneRolePolicy(カスタムロールポリシー)
- VeloDBBucketKey(バケットキー)
- VeloDBDataAccessRole(カーネルサービスアカウント)
- 目的: 作成されたサービスアカウントはAgentが必要とする最小権限ポリシーを持ち、その後のすべての制御操作はこのサービスアカウントのアイデンティティを使用して実行される
- 名前:
作成されたサービスアカウントの権限
terraformテンプレートが初回実行された後、VPC内のデータウェアハウス関連コンポーネントの後続管理のためのサービスアカウントが作成されます。以下はサービスアカウントの権限の説明です。
-
権限概要:
compute.addresses.create
compute.addresses.createInternal
compute.addresses.delete
compute.addresses.deleteInternal
compute.addresses.setLabels
compute.addresses.get
compute.addresses.list
compute.addresses.use
compute.addresses.useInternal
compute.disks.create
compute.disks.createTagBinding
compute.disks.delete
compute.disks.deleteTagBinding
compute.disks.get
compute.disks.list
compute.disks.resize
compute.disks.setLabels
compute.disks.use
compute.firewalls.create
compute.firewalls.createTagBinding
compute.firewalls.delete
compute.firewalls.deleteTagBinding
compute.firewalls.get
compute.firewalls.list
compute.firewalls.update
compute.forwardingRules.create
compute.forwardingRules.delete
compute.forwardingRules.get
compute.forwardingRules.setLabels
compute.instanceGroups.create
compute.instanceGroups.delete
compute.instanceGroups.update
compute.instanceGroups.use
compute.instances.attachDisk
compute.instances.create
compute.instances.createTagBinding
compute.instances.delete
compute.instances.deleteTagBinding
compute.instances.detachDisk
compute.instances.get
compute.instances.getEffectiveFirewalls
compute.instances.list
compute.instances.listTagBindings
compute.instances.osAdminLogin
compute.instances.osLogin
compute.instances.reset
compute.instances.resume
compute.instances.setDiskAutoDelete
compute.instances.setLabels
compute.instances.setMachineType
compute.instances.setMetadata
compute.instances.setName
compute.instances.setServiceAccount
compute.instances.setTags
compute.instances.start
compute.instances.stop
compute.instances.suspend
compute.instances.update
compute.instances.use
compute.networks.get
compute.networks.list
compute.networks.updatePolicy
compute.networks.use
compute.regionBackendServices.create
compute.regionBackendServices.createTagBinding
compute.regionBackendServices.delete
compute.regionBackendServices.deleteTagBinding
compute.regionBackendServices.get
compute.regionBackendServices.getIamPolicy
compute.regionBackendServices.list
compute.regionBackendServices.update
compute.regionBackendServices.use
compute.regionHealthChecks.create
compute.regionHealthChecks.delete
compute.regionHealthChecks.useReadOnly
compute.subnetworks.get
compute.subnetworks.list
compute.subnetworks.use
compute.zoneOperations.get
特定の権限は以下のように分割されます:
-
Compute Engine 権限:
-
VM インスタンスの管理
compute.disks.create
compute.disks.createTagBinding
compute.disks.delete
compute.disks.deleteTagBinding
compute.disks.get
compute.disks.list
compute.disks.resize
compute.disks.setLabels
compute.disks.use
compute.instanceGroups.create
compute.instanceGroups.delete
compute.instanceGroups.update
compute.instanceGroups.use
compute.instances.attachDisk
compute.instances.create
compute.instances.createTagBinding
compute.instances.delete
compute.instances.deleteTagBinding
compute.instances.detachDisk
compute.instances.get
compute.instances.getEffectiveFirewalls
compute.instances.list
compute.instances.listTagBindings
compute.instances.osAdminLogin
compute.instances.osLogin
compute.instances.reset
compute.instances.resume
compute.instances.setDiskAutoDelete
compute.instances.setLabels
compute.instances.setMachineType
compute.instances.setMetadata
compute.instances.setName
compute.instances.setServiceAccount
compute.instances.setTags
compute.instances.start
compute.instances.stop
compute.instances.suspend
compute.instances.update
compute.instances.use
-
-
ファイアウォールルールを管理する
compute.firewalls.create
compute.firewalls.createTagBinding
compute.firewalls.delete
compute.firewalls.deleteTagBinding
compute.firewalls.get
compute.firewalls.list
compute.firewalls.update -
VPCネットワーク権限:
-
VPC関連リソース情報の取得
compute.networks.get
compute.networks.list
compute.networks.updatePolicy
compute.networks.use
compute.subnetworks.get
compute.subnetworks.list
compute.subnetworks.use
compute.zoneOperations.get
-
-
LB リソースの管理
compute.addresses.create
compute.addresses.createInternal
compute.addresses.delete
compute.addresses.deleteInternal
compute.addresses.setLabels
compute.addresses.get
compute.addresses.list
compute.addresses.use
compute.addresses.useInternal
compute.forwardingRules.create
compute.forwardingRules.delete
compute.forwardingRules.get
compute.forwardingRules.setLabels
compute.regionBackendServices.create
compute.regionBackendServices.createTagBinding
compute.regionBackendServices.delete
compute.regionBackendServices.deleteTagBinding
compute.regionBackendServices.get
compute.regionBackendServices.getIamPolicy
compute.regionBackendServices.list
compute.regionBackendServices.update
compute.regionBackendServices.use
compute.regionHealthChecks.create
compute.regionHealthChecks.delete
compute.regionHealthChecks.useReadOnly -
Cloud Storage権限:
-
バケットの管理、およびバケットとその内容の読み取りと書き込み(特定のバケット用)
roles/storage.admin
-
-
アカウント権限:
-
新しく作成されたサービスアカウントがVMインスタンスに関連付けられるようにし、VMインスタンスがサービスアカウントとして関連する操作を実行できるようにする
roles/iam.serviceAccountUser
-