Azure Kubernetes Fleet Manager リソース配置の状態について

適用対象: ✔️ ハブ クラスターを含む Fleet Manager

Azure Kubernetes Fleet Manager を使用する場合、デプロイの進行状況を監視し、問題のトラブルシューティングを行うには、ClusterResourcePlacement リソースの状態を理解することが重要です。

Azure Kubernetes Fleet Manager を使用する場合、デプロイの進行状況を監視し、問題のトラブルシューティングを行うには、ResourcePlacement リソースの状態を理解することが重要です。

[前提条件]

配置ステータス構造の概要

ClusterResourcePlacement オブジェクトには、配置に関する説明的な仕様だけでなく、配置操作の状態も含まれます。

ResourcePlacement オブジェクトには、配置に関する説明的な仕様だけでなく、配置操作の状態も含まれます。

status セクションには、次に関する詳細情報が表示されます。

  • 条件によって表される全体的な配置の状態
  • 配置によって選択されたリソース
  • 条件で表されるクラスターごとの配置の状態
  • Failed、 drifted、および各クラスターでの diffed 配置

配置の状態を表示するには、次のコマンドを使用します。

kubectl describe clusterresourceplacement <placement-name>
kubectl describe resourceplacement <placement-name> -n <namespace-name>

生の YAML 出力を取得するには、次のコマンドを使用します。

kubectl get clusterresourceplacement <placement-name> -o yaml
kubectl get resourceplacement <placement-name> -n <namespace-name> -o yaml

最上位レベルの状態フィールド

status セクションには、次の最上位レベルのフィールドが含まれています。

  • selectedResources: 配置によって選択されたリソースの一覧
  • 条件: 全体的な配置条件の配列
  • observedResourceIndex: 現在のリソース スナップショットのインデックス
  • placementStatuses: クラスターごとの配置の状態情報

次のセクションでは、各フィールドについて詳しく説明します。

選択したリソース

[ selectedResources ] フィールドには、配置で選択されるすべてのリソースが一覧表示されます。 このフィールドを使用して、予想されるリソースが配置に含まれているかどうかを確認します。 次に例を示します。

selectedResources:
- kind: Namespace
  name: test
  version: v1
- kind: ConfigMap
  name: test-config
  namespace: test
  version: v1
  envelope:
    name: example-envelope
    namespace: test
    type: ResourceEnvelope
- kind: Deployment
  name: web-app
  namespace: test
  group: apps
  version: v1
- kind: Service
  name: web-service
  namespace: test
  version: v1
- kind: Secret
  name: app-secrets
  namespace: test
  version: v1
selectedResources:
- kind: ConfigMap
  name: test-config
  version: v1
  envelope:
    name: example-envelope
    namespace: test
    type: ResourceEnvelope
- kind: Deployment
  name: web-app
  group: apps
  version: v1
- kind: Service
  name: web-service
  version: v1
- kind: Secret
  name: app-secrets
  version: v1

各リソース エントリには、次のものが含まれます。

  • group: API グループ (コア リソースの場合は空)
  • version: API バージョン ( v1、 v1beta1 など)
  • kind: リソースの種類
  • name: リソース名
  • namespace: 名前空間 (名前空間リソースの場合)
  • エンベロープ: リソースがエンベロープにラップされている場合、エンベロープ メタデータも提供されます。これには次のものが含まれます。
    • name: 封筒の名前
  • namespace: エンベロープの名前空間
  • type: 封筒の種類 (例: ResourceEnvelope)

配置条件

conditions配列は、配置全体に関する高レベルの状態情報を提供します。 各条件は、次の標準フィールドを持つ Kubernetes 共通定義に従います。

  • type: 条件の種類 (以降のセクションで説明します)。
  • status: True、 False、または Unknown。
  • reason: 条件の短い理由コード。
  • message: 人間が判読できる説明。
  • lastTransitionTime: 条件が最後に変更されたとき。
  • observedGeneration: 条件が設定されたときの配置の生成。

ClusterResourcePlacement 条件の種類

ClusterResourcePlacement では、次の条件の種類を使用できます。

クラスターリソース配置スケジュール済み

ResourcePlacement 条件の種類

ResourcePlacement では、次の条件の種類を使用できます。

リソース配置予定済み

配置がターゲット クラスターに正常にスケジュールされているかどうかを示します。

  • True: 配置ポリシーに従って、必要なすべてのクラスターが選択されます。
  • False: スケジュールが失敗しました (たとえば、使用可能なクラスターが不足しています)。
  • 不明: スケジュールの決定が保留中です。
conditions:
- type: ClusterResourcePlacementScheduled
  status: "True"
  reason: SchedulingPolicyFulfilled
  message: "found all the clusters needed as specified by the scheduling policy"
  lastTransitionTime: "2023-11-10T08:14:52Z"
  observedGeneration: 5
conditions:
- type: ResourcePlacementScheduled
  status: "True"
  reason: SchedulingPolicyFulfilled
  message: "found all the clusters needed as specified by the scheduling policy"
  lastTransitionTime: "2023-11-10T08:14:52Z"
  observedGeneration: 5

クラスタリソース配置ロールアウト開始

リソース配置ロールアウト開始

選択したクラスター全体でロールアウトが開始されるかどうかを示します。

  • True: リソースがスケジュールされたクラスターへのロールアウトを開始しました。
  • False: ロールアウトはまだ開始されていません。
  • 不明: ロールアウトの決定は保留中です。
conditions:
- type: ClusterResourcePlacementRolloutStarted
  status: "True"
  reason: RolloutStarted
  message: "All 3 cluster(s) start rolling out the latest resource"
  lastTransitionTime: "2023-11-10T08:15:30Z"
  observedGeneration: 5
conditions:
- type: ResourcePlacementRolloutStarted
  status: "True"
  reason: RolloutStarted
  message: "All 3 cluster(s) start rolling out the latest resource"
  lastTransitionTime: "2023-11-10T08:15:30Z"
  observedGeneration: 5

ClusterResourcePlacementOverridden

リソース配置がオーバーライドされました

リソースのオーバーライドが正常に適用されたかどうかを示します。

  • True: 適用可能なすべてのオーバーライドが処理されます。
  • False: 一部のオーバーライドを適用できませんでした。
  • 不明: オーバーライド処理は保留中です。
conditions:
- type: ClusterResourcePlacementOverridden
  status: "True"
  reason: NoOverrideSpecified
  message: "No override rules are configured for the selected resources"
  lastTransitionTime: "2023-11-10T08:15:45Z"
  observedGeneration: 5
conditions:
- type: ResourcePlacementOverridden
  status: "True"
  reason: NoOverrideSpecified
  message: "No override rules are configured for the selected resources"
  lastTransitionTime: "2023-11-10T08:15:45Z"
  observedGeneration: 5

クラスターリソース配置作業同期 (ClusterResourcePlacementWorkSynchronized)

リソース配置作業の同期化

プロセスがハブ クラスターのクラスターごとの名前空間に作業オブジェクトを作成するかどうかを示します。

  • True: すべての作業オブジェクトが同期されます。
  • False: 作業の同期が失敗するか、不完全です。
  • 不明: 作業の同期が保留中です。
conditions:
- type: ClusterResourcePlacementWorkSynchronized  
  status: "True"
  reason: SynchronizeSucceeded
  message: "All 2 cluster(s) are synchronized to the latest resources on the hub cluster"
  lastTransitionTime: "2023-11-10T08:23:43Z"
  observedGeneration: 5
conditions:
- type: ResourcePlacementWorkSynchronized  
  status: "True"
  reason: SynchronizeSucceeded
  message: "All 2 cluster(s) are synchronized to the latest resources on the hub cluster"
  lastTransitionTime: "2023-11-10T08:23:43Z"
  observedGeneration: 5

クラスタリソースプレースメント適用済み

リソース配置が適用されました

すべてのリソースがメンバー クラスターに正常に適用されるかどうかを示します。

  • True: すべてのターゲット クラスターに正常に適用されたすべてのリソース。
  • False: 一部のリソースの適用に失敗しました ( failedPlacements確認してください)。
  • 不明: 適用操作は保留中です。
conditions:
- type: ClusterResourcePlacementApplied
  status: "True"
  reason: ApplySucceeded
  message: "The selected resources are successfully applied to 3 clusters"
  lastTransitionTime: "2023-11-10T08:16:15Z"
  observedGeneration: 5
conditions:
- type: ResourcePlacementApplied
  status: "True"
  reason: ApplySucceeded
  message: "The selected resources are successfully applied to 3 clusters"
  lastTransitionTime: "2023-11-10T08:16:15Z"
  observedGeneration: 5

ClusterResourcePlacementAvailable

ResourcePlacementAvailable

配置されたリソースがすべてメンバー クラスターで使用可能で準備ができているかどうかを示します。

  • True: すべてのリソースは、すべてのターゲット クラスターで使用できます。
  • False: 一部のリソースはまだ使用できません。
  • 不明: 可用性チェックは保留中です。
conditions:
- type: ClusterResourcePlacementAvailable
  status: "True"
  reason: ResourceAvailable
  message: "The selected resources in 3 clusters are available now"
  lastTransitionTime: "2023-11-10T08:16:30Z"
  observedGeneration: 5
conditions:
- type: ResourcePlacementAvailable
  status: "True"
  reason: ResourceAvailable
  message: "The selected resources in 3 clusters are available now"
  lastTransitionTime: "2023-11-10T08:16:30Z"
  observedGeneration: 5

クラスターリソース配置差分報告

リソース配置差異報告

構成の違いを報告するかどうかを示します (ReportDiff 戦略を使用する場合)。

  • True: 完全な差分レポートを使用できます。
  • False: 差分レポートが失敗したか、不完全です。
  • 不明: 差分レポートは保留中です。
conditions:
- type: ClusterResourcePlacementDiffReported
  status: "True"
  reason: DiffReportComplete
  message: "Configuration differences are reported for all target clusters"
  lastTransitionTime: "2023-11-10T08:16:45Z"
  observedGeneration: 5
conditions:
- type: ResourcePlacementDiffReported
  status: "True"
  reason: DiffReportComplete
  message: "Configuration differences are reported for all target clusters"
  lastTransitionTime: "2023-11-10T08:16:45Z"
  observedGeneration: 5

リソース スナップショット

observedResourceIndex フィールドは、現在デプロイされているリソースのスナップショットを示します。

observedResourceIndex: "1"

Fleet Manager では、ロールアウト戦略に応じてリソース スナップショットが異なる方法で作成されます。

RollingUpdate戦略の場合 (既定値):Fleet Manager は、次の場合にリソース スナップショットを自動的に作成します。

  • リソース セレクターが変更される
  • 選択したリソースを変更する

External戦略の場合: Fleet Manager はリソース スナップショットを自動的に作成しません。 代わりに、段階的な更新プログラムの実行を実行するときに作成され、 resourceSnapshotIndex フィールドを省略します。 この条件は、最初に External ロールアウト戦略を使用して配置を作成するときに、最初の段階的な更新プログラムの実行を実行するまでリソース スナップショットが存在しないことを意味します。

注

配置で以前に RollingUpdate 戦略を使用していて、それを Externalに変更した場合、既存のリソース スナップショットは引き続き使用できます。 ステージング更新実行を作成するときに、これらの既存のスナップショットを参照できます。

各スナップショットには一意のインデックスがあります。 スナップショットは、次の方法で表示できます。

kubectl get clusterresourcesnapshot --selector=kubernetes-fleet.io/resource-index=1
kubectl get resourcesnapshot -n <namespace-name> --selector=kubernetes-fleet.io/resource-index=1

クラスターごとの配置の状態

placementStatuses配列には、リソースが配置または配置される各クラスターの詳細な状態が含まれています。

placementStatuses:
- clusterName: aks-member-1
  observedResourceIndex: "1"
  conditions:
    - type: ResourceScheduled
      status: "True"
      reason: ScheduleSucceeded
      message: "Successfully scheduled resources for placement in aks-member-1"
      lastTransitionTime: "2023-11-10T08:14:52Z"
      observedGeneration: 5
    - type: RolloutStarted
      status: "True"
      reason: RolloutStarted
      message: "Detected the new changes on the resources and started the rollout process"
      lastTransitionTime: "2023-11-10T08:15:30Z"
      observedGeneration: 5
    - type: Overridden
      status: "True"
      reason: NoOverrideSpecified
      message: "No override rules are configured for the selected resources"
      lastTransitionTime: "2023-11-10T08:15:45Z"
      observedGeneration: 5
    - type: WorkSynchronized
      status: "True"
      reason: AllWorkSynced
      message: "All of the works are synchronized to the latest"
      lastTransitionTime: "2023-11-10T08:16:00Z"
      observedGeneration: 5
    - type: Applied
      status: "True"
      reason: AllWorkHaveBeenApplied
      message: "All corresponding work objects are applied"
      lastTransitionTime: "2023-11-10T08:16:15Z"
      observedGeneration: 5
    - type: Available
      status: "True"
      reason: ResourceAvailable
      message: "All resources are available on the target cluster"
      lastTransitionTime: "2023-11-10T08:16:30Z"
      observedGeneration: 5
  failedPlacements: []
  driftedPlacements: []
  diffedPlacements: []
- clusterName: aks-member-2
  observedResourceIndex: "1"
  conditions:
    - type: ResourceScheduled
      status: "True"
      reason: ScheduleSucceeded
      message: "Successfully scheduled resources for placement in aks-member-2"
      lastTransitionTime: "2023-11-10T08:14:52Z"
      observedGeneration: 5
    - type: Applied
      status: "False"
      reason: AppliedManifestFailedReason
      message: "Failed to apply some manifests"
      lastTransitionTime: "2023-11-10T08:16:15Z"
      observedGeneration: 5
  failedPlacements:
    - kind: Deployment
      name: web-app
      namespace: test
      version: apps/v1
      condition:
        type: Applied
        status: "False"
        reason: AppliedManifestFailedReason
        message: "Failed to apply manifest: insufficient resources"
        lastTransitionTime: "2023-11-10T08:16:15Z"

クラスターごとの条件の種類

各クラスターの状態には、デプロイライフサイクルを追跡する条件が含まれます。

リソーススケジュール済み

クラスターが配置用に正常に選択されたかどうかを示します。

- type: ResourceScheduled
  status: "True"
  reason: ScheduleSucceeded
  message: "Successfully scheduled resources for placement in aks-member-1 (affinity score: 0, topology spread score: 0): picked by scheduling policy"
  lastTransitionTime: "2023-11-10T08:14:52Z"
  observedGeneration: 5

展開開始

この特定のクラスターでロールアウトが開始されたかどうかを示します。

- type: RolloutStarted
  status: "True"
  reason: RolloutStarted
  message: "Detected new changes on the resources and started the rollout process"
  lastTransitionTime: "2023-11-10T08:15:30Z"
  observedGeneration: 5

オーバーライド済み

このクラスターに対してリソースのオーバーライドが適用されるかどうかを示します。

- type: Overridden
  status: "True"
  reason: NoOverrideSpecified
  message: "No override rules are configured for the selected resources"
  lastTransitionTime: "2023-11-10T08:15:45Z"
  observedGeneration: 5

WorkSynchronized

このクラスターに対して作業オブジェクトが作成されるかどうかを示します。

- type: WorkSynchronized
  status: "True"
  reason: AllWorkSynced
  message: "All of the works are synchronized to the latest"
  lastTransitionTime: "2023-11-10T08:16:00Z"
  observedGeneration: 5

適用済み

すべてのリソースがこのクラスターに正常に適用されているかどうかを示します。

- type: Applied
  status: "True"
  reason: AllWorkHaveBeenApplied
  message: "All corresponding work objects are applied"
  lastTransitionTime: "2023-11-10T08:16:15Z"
  observedGeneration: 5

在庫有り

すべてのリソースがこのクラスターで使用可能で準備ができているかどうかを示します。

- type: Available
  status: "True"
  reason: ResourceAvailable
  message: "All resources are available on the target cluster"
  lastTransitionTime: "2023-11-10T08:16:30Z"
  observedGeneration: 5

DiffReported

このクラスターの構成の違いが報告されるかどうかを示します。

- type: DiffReported
  status: "True"
  reason: DiffReportComplete
  message: "Configuration differences are reported for this cluster"
  lastTransitionTime: "2023-11-10T08:16:45Z"
  observedGeneration: 5

失敗した配置

リソースがクラスターに適用されない場合、システムは failedPlacements 配列に詳細を記録します。

failedPlacements:
- kind: Deployment
  name: my-app
  namespace: default
  version: apps/v1
  condition:
    type: Applied
    status: "False"
    reason: AppliedManifestFailedReason
    message: "Failed to apply manifest: namespaces 'app' not found"
    lastTransitionTime: "2023-12-06T00:09:53Z"
  envelope:
    name: example
    namespace: app
    type: ResourceEnvelope
- kind: Service
  name: my-service
  namespace: default
  version: v1
  condition:
    type: Applied
    status: "False"
    reason: AppliedManifestFailedReason
    message: "Failed to apply manifest: Service 'my-service' is forbidden: User 'system:serviceaccount:fleet-system:fleet-agent' cannot create resource 'services' in API group '' in the namespace 'default'"
    lastTransitionTime: "2023-12-06T00:10:15Z"
- kind: ConfigMap
  name: app-config
  namespace: production
  version: v1
  condition:
    type: Applied
    status: "False"
    reason: AppliedManifestFailedReason
    message: "Failed to apply manifest: configmaps 'app-config' already exists"
    lastTransitionTime: "2023-12-06T00:10:30Z"

失敗した配置には、次のものが含まれます。

  • リソースの識別: グループ、バージョン、種類、名前、名前空間
  • 条件: 特定のエラー条件
  • 封筒: 封筒情報 (該当する場合)

ずれている配置

Fleet Manager は常に、目的の状態から逸脱したリソースを報告します。

driftedPlacements:
- kind: Namespace
  name: web
  version: v1
  observationTime: "2025-03-19T06:50:25Z"
  firstDriftedObservedTime: "2025-03-19T06:49:54Z"
  targetClusterObservedGeneration: 12
  observedDrifts:
  - path: "/metadata/labels/owner"
    valueInHub: "simon"
    valueInMember: "chen"
  - path: "/metadata/annotations/purpose"
    valueInHub: "production"
    valueInMember: "testing"
- kind: Deployment
  name: web-app
  namespace: web
  group: apps
  version: v1
  observationTime: "2025-03-19T06:50:25Z"
  firstDriftedObservedTime: "2025-03-19T06:49:54Z"
  targetClusterObservedGeneration: 8
  observedDrifts:
  - path: "/spec/replicas"
    valueInHub: "3"
    valueInMember: "5"
  - path: "/spec/template/spec/containers/0/image"
    valueInHub: "nginx:1.20"
    valueInMember: "nginx:1.21"
- kind: ConfigMap
  name: app-config
  namespace: web
  version: v1
  observationTime: "2025-03-19T06:50:25Z"
  firstDriftedObservedTime: "2025-03-19T06:49:54Z"
  targetClusterObservedGeneration: 5
  observedDrifts:
  - path: "/data/environment"
    valueInHub: "production"
    valueInMember: "staging"

各ドリフト配置には以下が含まれています。

  • リソースの識別: グループ、バージョン、種類、名前、名前空間
  • observationTime: ドリフトが最後に観測されたとき
  • firstDriftedObservedTime: ドリフトが最初に検出されたとき
  • targetClusterObservedGeneration: メンバー クラスターでのリソースの生成
  • observedDrifts: 構成の違いの詳細な一覧

差分配置

ReportDiff 適用戦略を使用すると、Fleet Manager によって構成の違いが報告されます。

diffedPlacements:
- kind: Service
  name: my-service
  namespace: default
  version: v1
  observationTime: "2025-03-19T06:50:25Z"
  firstDiffedObservedTime: "2025-03-19T06:49:54Z"
  targetClusterObservedGeneration: 8
  observedDiffs:
  - path: "/spec/ports/0/nodePort"
    valueInHub: ""
    valueInMember: "30080"
  - path: "/spec/clusterIP"
    valueInHub: ""
    valueInMember: "10.96.100.200"
- kind: Deployment
  name: web-app
  namespace: default
  group: apps
  version: v1
  observationTime: "2025-03-19T06:50:25Z"
  firstDiffedObservedTime: "2025-03-19T06:49:54Z"
  targetClusterObservedGeneration: 12
  observedDiffs:
  - path: "/status/replicas"
    valueInHub: ""
    valueInMember: "3"
  - path: "/status/readyReplicas"
    valueInHub: ""
    valueInMember: "3"
  - path: "/metadata/generation"
    valueInHub: "1"
    valueInMember: "2"

差分配置は、ドリフト配置と同様の構造を持ちますが、さまざまなシナリオで使用されます。

  • ドリフト配置: リソースを適用した後で変更する場合に使用します。
  • 差分配置: ReportDiff 戦略と併用する場合、または引き継ぎ条件が満たされていない場合に使用します。

配置の進行状況の監視

配置の進行状況を効果的に監視するには、次の主要なインジケーターを確認します。

  1. リソースの配置: ClusterResourcePlacementWorkSynchronized が True であることを確認する
  2. 全体的な正常性: ClusterResourcePlacementApplied の状態を見る
  3. クラスターごとの状態: 各ターゲット クラスターの条件を確認する
  4. 失敗した配置: failedPlacements 配列内のエントリを確認する
  1. リソースの配置: ResourcePlacementWorkSynchronized が True であることを確認する
  2. 全体的な正常性: ResourcePlacementApplied の状態を見る
  3. クラスターごとの状態: 各ターゲット クラスターの条件を確認する
  4. 失敗した配置: failedPlacements 配列内のエントリを確認する

完全な状態の例

ClusterResourcePlacement の完全な状態を示す包括的な例を次に示します。

apiVersion: placement.kubernetes-fleet.io/v1
kind: ClusterResourcePlacement
metadata:
  name: web-app-placement
  generation: 5
spec:
  resourceSelectors:
  - group: ""
    kind: Namespace
    name: web-app
    version: v1
  - group: apps
    kind: Deployment
    name: web-server
    namespace: web-app
    version: v1
  - group: ""
    kind: Service
    name: web-service
    namespace: web-app
    version: v1
  policy:
    placementType: PickN
    numberOfClusters: 2
    affinity:
      clusterAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          clusterSelectorTerms:
          - matchLabels:
              region: us-west
status:
  conditions:
  - type: ClusterResourcePlacementScheduled
    status: "True"
    reason: SchedulingPolicyFulfilled
    message: "found all the clusters needed as specified by the scheduling policy"
    lastTransitionTime: "2023-11-10T08:14:52Z"
    observedGeneration: 5
  - type: ClusterResourcePlacementRolloutStarted
    status: "True"
    reason: RolloutStarted
    message: "All 2 cluster(s) start rolling out the latest resource"
    lastTransitionTime: "2023-11-10T08:15:30Z"
    observedGeneration: 5
  - type: ClusterResourcePlacementOverridden
    status: "True"
    reason: NoOverrideSpecified
    message: "No override rules are configured for the selected resources"
    lastTransitionTime: "2023-11-10T08:15:45Z"
    observedGeneration: 5
  - type: ClusterResourcePlacementWorkSynchronized
    status: "True"
    reason: SynchronizeSucceeded
    message: "All 2 cluster(s) are synchronized to the latest resources on the hub cluster"
    lastTransitionTime: "2023-11-10T08:16:00Z"
    observedGeneration: 5
  - type: ClusterResourcePlacementApplied
    status: "True"
    reason: ApplySucceeded
    message: "The selected resources are successfully applied to 2 clusters"
    lastTransitionTime: "2023-11-10T08:16:15Z"
    observedGeneration: 5
  - type: ClusterResourcePlacementAvailable
    status: "True"
    reason: ResourceAvailable
    message: "The selected resources in 2 cluster are available now"
    lastTransitionTime: "2023-11-10T08:16:30Z"
    observedGeneration: 5
  observedResourceIndex: "1"
  selectedResources:
  - group: ""
    kind: Namespace
    name: web-app
    version: v1
  - group: apps
    kind: Deployment
    name: web-server
    namespace: web-app
    version: v1
  - group: ""
    kind: Service
    name: web-service
    namespace: web-app
    version: v1
  placementStatuses:
  - clusterName: aks-west-1
    observedResourceIndex: "1"
    conditions:
    - type: ResourceScheduled
      status: "True"
      reason: ScheduleSucceeded
      message: "Successfully scheduled resources for placement in aks-west-1 (affinity score: 0, topology spread score: 0): picked by scheduling policy"
      lastTransitionTime: "2023-11-10T08:14:52Z"
      observedGeneration: 5
    - type: RolloutStarted
      status: "True"
      reason: RolloutStarted
      message: "Detected the new changes on the resources and started the rollout process"
      lastTransitionTime: "2023-11-10T08:15:30Z"
      observedGeneration: 5
    - type: Overridden
      status: "True"
      reason: NoOverrideSpecified
      message: "No override rules are configured for the selected resources"
      lastTransitionTime: "2023-11-10T08:15:45Z"
      observedGeneration: 5
    - type: WorkSynchronized
      status: "True"
      reason: AllWorkSynced
      message: "All of the works are synchronized to the latest"
      lastTransitionTime: "2023-11-10T08:16:00Z"
      observedGeneration: 5
    - type: Applied
      status: "True"
      reason: AllWorkHaveBeenApplied
      message: "All corresponding work objects are applied"
      lastTransitionTime: "2023-11-10T08:16:15Z"
      observedGeneration: 5
    - type: Available
      status: "True"
      reason: ResourceAvailable
      message: "All resources are available on the target cluster"
      lastTransitionTime: "2023-11-10T08:16:30Z"
      observedGeneration: 5
    failedPlacements: []
    driftedPlacements: []
    diffedPlacements: []
  - clusterName: aks-west-2
    observedResourceIndex: "1"
    conditions:
    - type: ResourceScheduled
      status: "True"
      reason: ScheduleSucceeded
      message: "Successfully scheduled resources for placement in aks-west-2 (affinity score: 0, topology spread score: 0): picked by scheduling policy"
      lastTransitionTime: "2023-11-10T08:14:52Z"
      observedGeneration: 5
    - type: RolloutStarted
      status: "True"
      reason: RolloutStarted
      message: "Detected new changes on the resources and started the rollout process"
      lastTransitionTime: "2023-11-10T08:15:30Z"
      observedGeneration: 5
    - type: Overridden
      status: "True"
      reason: NoOverrideSpecified
      message: "No override rules are configured for the selected resources"
      lastTransitionTime: "2023-11-10T08:15:45Z"
      observedGeneration: 5
    - type: WorkSynchronized
      status: "True"
      reason: AllWorkSynced
      message: "All of the works are synchronized to the latest"
      lastTransitionTime: "2023-11-10T08:16:00Z"
      observedGeneration: 5
    - type: Applied
      status: "True"
      reason: AllWorkHaveBeenApplied
      message: "All corresponding work objects are applied"
      lastTransitionTime: "2023-11-10T08:16:15Z"
      observedGeneration: 5
    - type: Available
      status: "True"
      reason: ResourceAvailable
      message: "All resources are available on the target cluster"
      lastTransitionTime: "2023-11-10T08:16:30Z"
      observedGeneration: 5
    failedPlacements: []
    driftedPlacements: []
    diffedPlacements: []

ResourcePlacement の完全な状態を示す包括的な例を次に示します。

apiVersion: placement.kubernetes-fleet.io/v1
kind: ResourcePlacement
metadata:
  name: web-app-placement
  namespace: web-app
  generation: 5
spec:
  resourceSelectors:
  - group: apps
    kind: Deployment
    name: web-server
    version: v1
  - group: ""
    kind: Service
    name: web-service
    version: v1
  policy:
    placementType: PickN
    numberOfClusters: 2
    affinity:
      clusterAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          clusterSelectorTerms:
          - matchLabels:
              region: us-west
status:
  conditions:
  - type: ResourcePlacementScheduled
    status: "True"
    reason: SchedulingPolicyFulfilled
    message: "found all the clusters needed as specified by the scheduling policy"
    lastTransitionTime: "2023-11-10T08:14:52Z"
    observedGeneration: 5
  - type: ResourcePlacementRolloutStarted
    status: "True"
    reason: RolloutStarted
    message: "All 2 cluster(s) start rolling out the latest resource"
    lastTransitionTime: "2023-11-10T08:15:30Z"
    observedGeneration: 5
  - type: ResourcePlacementOverridden
    status: "True"
    reason: NoOverrideSpecified
    message: "No override rules are configured for the selected resources"
    lastTransitionTime: "2023-11-10T08:15:45Z"
    observedGeneration: 5
  - type: ResourcePlacementWorkSynchronized
    status: "True"
    reason: SynchronizeSucceeded
    message: "All 2 cluster(s) are synchronized to the latest resources on the hub cluster"
    lastTransitionTime: "2023-11-10T08:16:00Z"
    observedGeneration: 5
  - type: ResourcePlacementApplied
    status: "True"
    reason: ApplySucceeded
    message: "The selected resources are successfully applied to 2 clusters"
    lastTransitionTime: "2023-11-10T08:16:15Z"
    observedGeneration: 5
  - type: ResourcePlacementAvailable
    status: "True"
    reason: ResourceAvailable
    message: "The selected resources in 2 cluster are available now"
    lastTransitionTime: "2023-11-10T08:16:30Z"
    observedGeneration: 5
  observedResourceIndex: "1"
  selectedResources:
  - group: apps
    kind: Deployment
    name: web-server
    version: v1
  - group: ""
    kind: Service
    name: web-service
    version: v1
  placementStatuses:
  - clusterName: aks-west-1
    observedResourceIndex: "1"
    conditions:
    - type: ResourceScheduled
      status: "True"
      reason: ScheduleSucceeded
      message: "Successfully scheduled resources for placement in aks-west-1 (affinity score: 0, topology spread score: 0): picked by scheduling policy"
      lastTransitionTime: "2023-11-10T08:14:52Z"
      observedGeneration: 5
    - type: RolloutStarted
      status: "True"
      reason: RolloutStarted
      message: "Detected the new changes on the resources and started the rollout process"
      lastTransitionTime: "2023-11-10T08:15:30Z"
      observedGeneration: 5
    - type: Overridden
      status: "True"
      reason: NoOverrideSpecified
      message: "No override rules are configured for the selected resources"
      lastTransitionTime: "2023-11-10T08:15:45Z"
      observedGeneration: 5
    - type: WorkSynchronized
      status: "True"
      reason: AllWorkSynced
      message: "All of the works are synchronized to the latest"
      lastTransitionTime: "2023-11-10T08:16:00Z"
      observedGeneration: 5
    - type: Applied
      status: "True"
      reason: AllWorkHaveBeenApplied
      message: "All corresponding work objects are applied"
      lastTransitionTime: "2023-11-10T08:16:15Z"
      observedGeneration: 5
    - type: Available
      status: "True"
      reason: ResourceAvailable
      message: "All resources are available on the target cluster"
      lastTransitionTime: "2023-11-10T08:16:30Z"
      observedGeneration: 5
    failedPlacements: []
    driftedPlacements: []
    diffedPlacements: []
  - clusterName: aks-west-2
    observedResourceIndex: "1"
    conditions:
    - type: ResourceScheduled
      status: "True"
      reason: ScheduleSucceeded
      message: "Successfully scheduled resources for placement in aks-west-2 (affinity score: 0, topology spread score: 0): picked by scheduling policy"
      lastTransitionTime: "2023-11-10T08:14:52Z"
      observedGeneration: 5
    - type: RolloutStarted
      status: "True"
      reason: RolloutStarted
      message: "Detected new changes on the resources and started the rollout process"
      lastTransitionTime: "2023-11-10T08:15:30Z"
      observedGeneration: 5
    - type: Overridden
      status: "True"
      reason: NoOverrideSpecified
      message: "No override rules are configured for the selected resources"
      lastTransitionTime: "2023-11-10T08:15:45Z"
      observedGeneration: 5
    - type: WorkSynchronized
      status: "True"
      reason: AllWorkSynced
      message: "All of the works are synchronized to the latest"
      lastTransitionTime: "2023-11-10T08:16:00Z"
      observedGeneration: 5
    - type: Applied
      status: "True"
      reason: AllWorkHaveBeenApplied
      message: "All corresponding work objects are applied"
      lastTransitionTime: "2023-11-10T08:16:15Z"
      observedGeneration: 5
    - type: Available
      status: "True"
      reason: ResourceAvailable
      message: "All resources are available on the target cluster"
      lastTransitionTime: "2023-11-10T08:16:30Z"
      observedGeneration: 5
    failedPlacements: []
    driftedPlacements: []
    diffedPlacements: []

この例は、次を示しています。

  • スケジュール設定の成功: 配置ポリシーに一致する 2 つのクラスターが配置で見つかりました。
  • ロールアウトに成功: すべてのリソースが両方のターゲット クラスターにデプロイされます。
  • オーバーライドなし: リソースオーバーライドは構成されていないか、必要ありません。
  • 同期された作業: 作業オブジェクトが作成され、同期されます。
  • 適用されたリソース: すべてのリソースが正常に適用されます。
  • 使用可能なリソース: すべてのリソースが実行され、使用可能です。
  • 正常な状態: 失敗した、ドリフトが発生した、または差分のある配置は存在しません。

リソースの配置の詳細については、次の記事を参照してください。