gcloud 構成フィールドの動作

--config フラグは update コマンドで、メンバーシップ クラスタでの Config Sync の動作を構成するフィールドを受け入れます。update コマンドと enable コマンドの--fleet-default-member-configフラグは、 フリートのデフォルトの Config Sync の動作を構成するために同じフィールド セットを受け入れます。

apply コマンドの --config フラグは、基盤となる構成 API フィールドの Google Cloud CLI 表現 を定義しますが、update コマンドの --config フラグと --fleet-default-member-config フラグは、それぞれ Spec API フィールドMembershipSpec API フィールドのスキーマを直接採用します。enable コマンドの --fleet-default-member-config フラグも、Google Cloud CLI 表現から alpha リリース トラックの MembershipSpec API フィールド スキーマに移行しましたが、下位互換性のために以前の表現がサポートされています。

このページでは、--config フラグと --fleet-default-member-config フラグが API に送信する前に、API フィールド スキーマの構成フィールドに対して行われる gcloud CLI 固有の追加処理について説明します。

フィールドのデフォルト値

フィールド 説明
configSync.enabled ユーザーが configSync フィールドを指定した場合、 configSync.enabled はデフォルトで true になります。
version --config フラグの場合、Config Sync のバージョンは、メンバーシップ構成の既存の値にデフォルト設定されます。構成されていない場合は、メンバーシップ クラスタにインストールされている Config Sync のバージョンにデフォルト設定されます。これらの値を確認するには、 describe コマンドを使用します。Config Sync がメンバーシップ クラスタにインストールされていない場合、gcloud CLI は API リクエストでバージョンを設定しません。--config--fleet-default-member-config の場合、API のデフォルトの Config Sync ババージョン動作を判断するには、version サブフィールドの説明をSpec API フィールドMembershipSpec API フィールドでそれぞれご覧ください。

サポートされていないフィールド

--config フラグと --fleet-default-member-config フラグは、 update コマンドと enable コマンドで、次のいずれかのレガシー フィールドが設定されている場合、エラーを返します。

  • configSync.metricsGcpServiceAccountEmail
  • policyController
  • hierarchyController
  • binauthz
  • management

構成ファイルの例

このセクションでは、 --config--fleet-default-member-config フラグを updateenable コマンドに渡すことができる構成の例を示します。

コマンドのページの例と比較して、次の構成には applySpecVersion フィールドと spec フィールドが含まれていません。 applyconfigSync.deploymentOverrides[].deploymentName フィールドは、apply コマンドの場合は spec.configSync.deploymentOverrides[].name です。次の例に含まれていないフィールドを含め、他のフィールドの名前も異なります。

次の例は、基本的な構成を示しています。

configSync:
  enabled: true
  sourceFormat: unstructured
  git:
    syncRepo: https://github.com/GoogleCloudPlatform/anthos-config-management-samples
    syncBranch: main
    secretType: none
    policyDir: config-sync-quickstart/multirepo/root

次の例は、より複雑な構成を示しています。

configSync:
  enabled: true
  stopSyncing: true
  sourceFormat: unstructured
  git:
    syncRepo: https://github.com/GoogleCloudPlatform/anthos-config-management-samples
    syncBranch: main
    secretType: none
    policyDir: config-sync-quickstart/multirepo/root
  deploymentOverrides:
  - deploymentName: reconciler-manager
    deploymentNamespace: config-management-system
    containers:
    - containerName: reconciler-manager
      cpuRequest: 50m
      cpuLimit: 100m
      memoryRequest: 256Mi
      memoryLimit: 512Mi