다음을 통해 공유


리소스 전파 실패: ClusterResourcePlacementRolloutStarted가 false입니다.

이 문서에서는 Azure Kubernetes Fleet Manager에서 API 개체를 사용하여 리소스를 ClusterResourcePlacement 전파할 때 문제를 해결하는 ClusterResourcePlacementRolloutStarted 방법을 설명합니다.

증상

Azure Kubernetes Fleet Manager에서 API 개체를 사용하여 ClusterResourcePlacement 리소스를 전파하는 경우 선택한 리소스는 모든 예약된 클러스터 ClusterResourcePlacementRolloutStarted 에서 롤아웃되지 않으며 조건 상태는 다음과 같이 False표시됩니다.

참고 항목

롤아웃이 시작되지 않는 이유에 대한 자세한 내용을 보려면 롤아웃 컨트롤러 로그를 확인할 수 있습니다.

원인

구성이 너무 엄격하기 때문에 RollingUpdate 클러스터 리소스 배치 롤아웃 전략이 차단됩니다.

문제 해결 단계

  1. ClusterResourcePlacement 상태 섹션에서 상태를 설정한 클러스터를 RolloutStarted 식별하려면 확인 placementStatuses 합니다False.
  2. 식별된 클러스터에 해당하는 ClusterResourceBinding 클러스터를 찾습니다. 자세한 내용은 최신 ClusterResourceBinding 리소스를 어떻게 찾을 수 있나요? 이 리소스는 Work 상태(생성 또는 업데이트 여부)를 나타내야 합니다.
  3. 값을 maxUnavailable maxSurge 확인하고 기대에 부합하는지 확인합니다.

사례 연구

다음 예제에서는 네임스페이 ClusterResourcePlacement 스를 세 개의 멤버 클러스터로 전파하려고 합니다. 그러나 초기 생성 ClusterResourcePlacement중에는 네임스페이스가 허브 클러스터에 존재하지 않았으며, 플릿은 현재 명명 kind-cluster-1 된 두 개의 멤버 클러스터로 구성됩니다 kind-cluster-2.

ClusterResourcePlacement 사양

spec:
  policy:
    numberOfClusters: 3
    placementType: PickN
  resourceSelectors:
  - group: ""
    kind: Namespace
    name: test-ns
    version: v1
  revisionHistoryLimit: 10
  strategy:
    type: RollingUpdate

ClusterResourcePlacement 상태

status:
  conditions:
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: could not find all the clusters needed as specified by the scheduling
      policy
    observedGeneration: 1
    reason: SchedulingPolicyUnfulfilled
    status: "False"
    type: ClusterResourcePlacementScheduled
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: All 2 cluster(s) start rolling out the latest resource
    observedGeneration: 1
    reason: RolloutStarted
    status: "True"
    type: ClusterResourcePlacementRolloutStarted
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: No override rules are configured for the selected resources
    observedGeneration: 1
    reason: NoOverrideSpecified
    status: "True"
    type: ClusterResourcePlacementOverridden
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: Works(s) are successfully created or updated in the 2 target clusters'
      namespaces
    observedGeneration: 1
    reason: WorkSynchronized
    status: "True"
    type: ClusterResourcePlacementWorkSynchronized
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: The selected resources are successfully applied to 2 clusters
    observedGeneration: 1
    reason: ApplySucceeded
    status: "True"
    type: ClusterResourcePlacementApplied
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: The selected resources in 2 cluster are available now
    observedGeneration: 1
    reason: ResourceAvailable
    status: "True"
    type: ClusterResourcePlacementAvailable
  observedResourceIndex: "0"
  placementStatuses:
  - clusterName: kind-cluster-2
    conditions:
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: 'Successfully scheduled resources for placement in kind-cluster-2 (affinity
        score: 0, topology spread score: 0): picked by scheduling policy'
      observedGeneration: 1
      reason: Scheduled
      status: "True"
      type: Scheduled
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: Detected the new changes on the resources and started the rollout process
      observedGeneration: 1
      reason: RolloutStarted
      status: "True"
      type: RolloutStarted
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: No override rules are configured for the selected resources
      observedGeneration: 1
      reason: NoOverrideSpecified
      status: "True"
      type: Overridden
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: All of the works are synchronized to the latest
      observedGeneration: 1
      reason: AllWorkSynced
      status: "True"
      type: WorkSynchronized
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: All corresponding work objects are applied
      observedGeneration: 1
      reason: AllWorkHaveBeenApplied
      status: "True"
      type: Applied
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: All corresponding work objects are available
      observedGeneration: 1
      reason: AllWorkAreAvailable
      status: "True"
      type: Available
  - clusterName: kind-cluster-1
    conditions:
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: 'Successfully scheduled resources for placement in kind-cluster-1 (affinity
        score: 0, topology spread score: 0): picked by scheduling policy'
      observedGeneration: 1
      reason: Scheduled
      status: "True"
      type: Scheduled
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: Detected the new changes on the resources and started the rollout process
      observedGeneration: 1
      reason: RolloutStarted
      status: "True"
      type: RolloutStarted
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: No override rules are configured for the selected resources
      observedGeneration: 1
      reason: NoOverrideSpecified
      status: "True"
      type: Overridden
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: All of the works are synchronized to the latest
      observedGeneration: 1
      reason: AllWorkSynced
      status: "True"
      type: WorkSynchronized
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: All corresponding work objects are applied
      observedGeneration: 1
      reason: AllWorkHaveBeenApplied
      status: "True"
      type: Applied
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: All corresponding work objects are available
      observedGeneration: 1
      reason: AllWorkAreAvailable
      status: "True"
      type: Available

위의 출력은 리소스 test-ns 네임스페이스가 허브 클러스터에 존재하지 않음을 나타내며 다음 ClusterResourcePlacement 조건 상태를 보여 줍니다.

  • ClusterResourcePlacementScheduled 지정된 정책이 세 개의 클러스터를 선택하는 것을 목표로 하지만 스케줄러는 현재 사용 가능한 두 클러스터와 조인된 클러스터의 배치만 수용할 수 있으므로 조건 상태가 로 False표시됩니다.
  • ClusterResourcePlacementRolloutStarted 롤아웃 프로세스가 선택된 두 개의 클러스터로 시작되었으므로 조건 상태가 로 True표시됩니다.
  • ClusterResourcePlacementOverridden 조건 상태는 선택한 리소스에 대해 재정의 규칙이 구성되지 않은 상태로 True표시됩니다.
  • ClusterResourcePlacementWorkSynchronized 조건 상태는 다음과 같이 True표시됩니다.
  • ClusterResourcePlacementApplied 조건 상태는 다음과 같이 True표시됩니다.
  • ClusterResourcePlacementAvailable 조건 상태는 다음과 같이 True표시됩니다.

관련 클러스터에서 네임스페이스를 원활하게 전파하려면 허브 클러스터에 네임스페이스를 계속 만듭니 test-ns 다.

허브 클러스터에 "test-ns" 네임스페이스를 만든 후 ClusterResourcePlacement 상태

status:
  conditions:
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: could not find all the clusters needed as specified by the scheduling
      policy
    observedGeneration: 1
    reason: SchedulingPolicyUnfulfilled
    status: "False"
    type: ClusterResourcePlacementScheduled
  - lastTransitionTime: "2024-05-07T23:13:51Z"
    message: The rollout is being blocked by the rollout strategy in 2 cluster(s)
    observedGeneration: 1
    reason: RolloutNotStartedYet
    status: "False"
    type: ClusterResourcePlacementRolloutStarted
  observedResourceIndex: "1"
  placementStatuses:
  - clusterName: kind-cluster-2
    conditions:
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: 'Successfully scheduled resources for placement in kind-cluster-2 (affinity
        score: 0, topology spread score: 0): picked by scheduling policy'
      observedGeneration: 1
      reason: Scheduled
      status: "True"
      type: Scheduled
    - lastTransitionTime: "2024-05-07T23:13:51Z"
      message: The rollout is being blocked by the rollout strategy
      observedGeneration: 1
      reason: RolloutNotStartedYet
      status: "False"
      type: RolloutStarted
  - clusterName: kind-cluster-1
    conditions:
    - lastTransitionTime: "2024-05-07T23:08:53Z"
      message: 'Successfully scheduled resources for placement in kind-cluster-1 (affinity
        score: 0, topology spread score: 0): picked by scheduling policy'
      observedGeneration: 1
      reason: Scheduled
      status: "True"
      type: Scheduled
    - lastTransitionTime: "2024-05-07T23:13:51Z"
      message: The rollout is being blocked by the rollout strategy
      observedGeneration: 1
      reason: RolloutNotStartedYet
      status: "False"
      type: RolloutStarted
  selectedResources:
  - kind: Namespace
    name: test-ns
    version: v1

이전 출력 ClusterResourcePlacementScheduled 에서 조건 상태는 .로 False표시됩니다. 상태는 ClusterResourcePlacementRolloutStarted 다음과 The rollout is being blocked by the rollout strategy in 2 cluster(s)같이 False 표시됩니다.

최신 ClusterResourceSnapshot ClusterResourceBinding 리소스를 찾으려면 어떻게 해야 하나요?

최신 ClusterResourceSnapshot

apiVersion: placement.kubernetes-fleet.io/v1
kind: ClusterResourceSnapshot
metadata:
  annotations:
    kubernetes-fleet.io/number-of-enveloped-object: "0"
    kubernetes-fleet.io/number-of-resource-snapshots: "1"
    kubernetes-fleet.io/resource-hash: 72344be6e268bc7af29d75b7f0aad588d341c228801aab50d6f9f5fc33dd9c7c
  creationTimestamp: "2024-05-07T23:13:51Z"
  generation: 1
  labels:
    kubernetes-fleet.io/is-latest-snapshot: "true"
    kubernetes-fleet.io/parent-CRP: crp-3
    kubernetes-fleet.io/resource-index: "1"
  name: crp-3-1-snapshot
  ownerReferences:
  - apiVersion: placement.kubernetes-fleet.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: ClusterResourcePlacement
    name: crp-3
    uid: b4f31b9a-971a-480d-93ac-93f093ee661f
  resourceVersion: "14434"
  uid: 85ee0e81-92c9-4362-932b-b0bf57d78e3f
spec:
  selectedResources:
  - apiVersion: v1
    kind: Namespace
    metadata:
      labels:
        kubernetes.io/metadata.name: test-ns
      name: test-ns
    spec:
      finalizers:
      - kubernetes

사양에서 ClusterResourceSnapshot 이제 섹션에 selectedResources 네임스페이스가 test-ns표시됩니다.

네임스페이 ClusterResourceBinding kind-cluster-1 스를 만든 후 업데이트되었는지 확인하려면 해당 항목을 test-ns 확인합니다. 자세한 내용은 최신 ClusterResourceBinding 리소스를 어떻게 찾을 수 있나요?를 참조하세요.

kind-cluster-1에 대한 ClusterResourceBinding

apiVersion: placement.kubernetes-fleet.io/v1
kind: ClusterResourceBinding
metadata:
  creationTimestamp: "2024-05-07T23:08:53Z"
  finalizers:
  - kubernetes-fleet.io/work-cleanup
  generation: 2
  labels:
    kubernetes-fleet.io/parent-CRP: crp-3
  name: crp-3-kind-cluster-1-7114c253
  resourceVersion: "14438"
  uid: 0db4e480-8599-4b40-a1cc-f33bcb24b1a7
spec:
  applyStrategy:
    type: ClientSideApply
  clusterDecision:
    clusterName: kind-cluster-1
    clusterScore:
      affinityScore: 0
      priorityScore: 0
    reason: picked by scheduling policy
    selected: true
  resourceSnapshotName: crp-3-0-snapshot
  schedulingPolicySnapshotName: crp-3-0
  state: Bound
  targetCluster: kind-cluster-1
status:
  conditions:
  - lastTransitionTime: "2024-05-07T23:13:51Z"
    message: The resources cannot be updated to the latest because of the rollout
      strategy
    observedGeneration: 2
    reason: RolloutNotStartedYet
    status: "False"
    type: RolloutStarted
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: No override rules are configured for the selected resources
    observedGeneration: 2
    reason: NoOverrideSpecified
    status: "True"
    type: Overridden
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: All of the works are synchronized to the latest
    observedGeneration: 2
    reason: AllWorkSynced
    status: "True"
    type: WorkSynchronized
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: All corresponding work objects are applied
    observedGeneration: 2
    reason: AllWorkHaveBeenApplied
    status: "True"
    type: Applied
  - lastTransitionTime: "2024-05-07T23:08:53Z"
    message: All corresponding work objects are available
    observedGeneration: 2
    reason: AllWorkAreAvailable
    status: "True"
    type: Available

변경되지 ClusterResourceBinding 않은 상태로 유지됩니다. 사양에서 ClusterResourceBinding 여전히 resourceSnapshotName 이전 ClusterResourceSnapshot 이름을 참조합니다. 이 문제는 기본값이 적용되므로 사용자의 명시적 RollingUpdate 입력이 없는 경우에 발생합니다.

  • 값은 maxUnavailable 25% × 3(원하는 숫자)로 반올림됩니다 1.
  • 값은 maxSurge 25% × 3(원하는 숫자)로 반올림됩니다 1.

ClusterResourceBinding이 업데이트되지 않는 이유

처음에 생성되었을 ClusterResourcePlacement 때 두 ClusterResourceBindings 가지가 생성되었습니다. 그러나 롤아웃이 초기 단계에 ClusterResourcePlacementRolloutStarted 적용되지 않았기 때문에 조건은 .로 True설정되었습니다.

허브 클러스터에서 네임스페이 test-ns 스를 만들 때 롤아웃 컨트롤러가 두 개의 기존 ClusterResourceBindings네임스페이스를 업데이트하려고 했습니다. 그러나 maxUnavailable 멤버 클러스터의 부족으로 인해 구성이 RollingUpdate 너무 엄격해지도록 설정 1 되었습니다.

참고 항목

업데이트 중에 바인딩 중 하나가 적용되지 않으면 구성 maxUnavailable 을 위반 RollingUpdate 하여 설정1됩니다.

해결

이 경우 이 문제를 해결하려면 구성을 완화하는 RollingUpdate 것보다 1 큰 값으로 수동으로 설정하는 maxUnavailable 것이 좋습니다. 또는 세 번째 멤버 클러스터를 조인할 수 있습니다.

도움을 요청하십시오.

질문이 있거나 도움이 필요한 경우 지원 요청을 생성하거나Azure 커뮤니티 지원에 문의하세요. Azure 피드백 커뮤니티에 제품 피드백을 제출할 수도 있습니다.