1

私はgoogleクラウド(計算)にネットワークベースのロードバランシングサービスを設定しようとしています。それを作成する最後のステップは、転送ルールを追加することです。複数のポートを持つフォワーディングルールを作成する方法google cloud(計算)

私のサービスでは、複数のポートを転送する必要があります。documentationを見ると、間違いない限り可能です。

--ports=[PORT | START_PORT-END_PORT],[[PORT | START_PORT-END_PORT],…]

私が試してみました次:

gcloud compute forwarding-rules create example-forwarding-rule \ 
    --region europe-west1 \ 
    --ports 80 443 3000-4000 6001 \ 
    --address example-address \ 
    --target-pool example-target-pool 

そして、私は次のエラーを取得:

gcloud compute forwarding-rules create example-forwarding-rule \ 
    --region europe-west1 \ 
    --ports 80 443 3000-4000 6001 \ 
    --address example-address \ 
    --target-pool example-target-pool 
:私もスペースを追加しようとしました

ERROR: (gcloud.compute.forwarding-rules.create) Invalid value for [--ports]: Must specify consecutive ports at this time.

またはすべて一緒にカンマを取り除く:

gcloud compute forwarding-rules create example-forwarding-rule \ 
    --region europe-west1 \ 
    --ports 80 443 3000-4000 6001 \ 
    --address example-address \ 
    --target-pool example-target-pool 

そして、私は両方のために、次のエラーを取得:

ERROR: (gcloud.compute.forwarding-rules.create) unrecognized arguments

はmutlipleポートとそうであれば、どのように指定することが可能ですか?

答えて

1

残念ながら、--portsフラグは重複または隣接範囲の指定のみをサポートしているため、gCloud SDKは範囲を単一の連続範囲にマージできます。

さらに詳しい説明があるhttps://cloud.google.com/compute/docs/load-balancing/network/forwarding-rulesportsセクションを参照してください。

[Optional] A single port or single contiguous port range, ranging from low to high, for which this forwarding rule matches.

関連する問題