다음을 통해 공유


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

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

증상

Azure Kubernetes Fleet Manager에서 API 개체를 사용하여 ClusterResourcePlacement 리소스를 전파하는 경우 업데이트되는 경우 ClusterResourcePlacement 연결된 작업 개체는 변경 내용과 ClusterResourcePlacementWorkSynchronized 동기화되지 않으며 조건 상태는 다음과 같이 False표시됩니다.

참고 항목

작업 개체 동기화가 실패하는 이유에 대한 자세한 내용을 보려면 작업 생성기 컨트롤러 로그를 확인할 수 있습니다.

원인

이 문제는 다음 이유 중 하나로 인해 발생할 수 있습니다.

  • 컨트롤러에서 해당 작업 개체를 생성하는 동안 오류가 발생합니다.
  • 봉투형 개체의 형식이 잘 지정되지 않았습니다.

사례 연구

다음 예제 ClusterResourcePlacement 에서는 선택한 클러스터에 리소스를 전파하려고 하지만 선택한 클러스터가 종료되었으므로 작업 개체가 최신 변경 내용을 반영하도록 업데이트되지 않습니다.

ClusterResourcePlacement 사양

spec:
  resourceSelectors:
    - group: rbac.authorization.k8s.io
      kind: ClusterRole
      name: secret-reader
      version: v1
  policy:
    placementType: PickN
    numberOfClusters: 1
  strategy:
    type: RollingUpdate

ClusterResourcePlacement 상태

spec:
  policy:
    numberOfClusters: 1
    placementType: PickN
  resourceSelectors:
  - group: ""
    kind: Namespace
    name: test-ns
    version: v1
  revisionHistoryLimit: 10
  strategy:
    type: RollingUpdate
status:
  conditions:
  - lastTransitionTime: "2024-05-14T18:05:04Z"
    message: found all cluster needed as specified by the scheduling policy, found
      1 cluster(s)
    observedGeneration: 1
    reason: SchedulingPolicyFulfilled
    status: "True"
    type: ClusterResourcePlacementScheduled
  - lastTransitionTime: "2024-05-14T18:05:05Z"
    message: All 1 cluster(s) start rolling out the latest resource
    observedGeneration: 1
    reason: RolloutStarted
    status: "True"
    type: ClusterResourcePlacementRolloutStarted
  - lastTransitionTime: "2024-05-14T18:05:05Z"
    message: No override rules are configured for the selected resources
    observedGeneration: 1
    reason: NoOverrideSpecified
    status: "True"
    type: ClusterResourcePlacementOverridden
  - lastTransitionTime: "2024-05-14T18:05:05Z"
    message: There are 1 cluster(s) which have not finished creating or updating work(s)
      yet
    observedGeneration: 1
    reason: WorkNotSynchronizedYet
    status: "False"
    type: ClusterResourcePlacementWorkSynchronized
  observedResourceIndex: "0"
  placementStatuses:
  - clusterName: kind-cluster-1
    conditions:
    - lastTransitionTime: "2024-05-14T18:05:04Z"
      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-14T18:05:05Z"
      message: Detected the new changes on the resources and started the rollout process
      observedGeneration: 1
      reason: RolloutStarted
      status: "True"
      type: RolloutStarted
    - lastTransitionTime: "2024-05-14T18:05:05Z"
      message: No override rules are configured for the selected resources
      observedGeneration: 1
      reason: NoOverrideSpecified
      status: "True"
      type: Overridden
    - lastTransitionTime: "2024-05-14T18:05:05Z"
      message: 'Failed to synchronize the work to the latest: works.placement.kubernetes-fleet.io
        "crp1-work" is forbidden: unable to create new content in namespace fleet-member-kind-cluster-1
        because it is being terminated'
      observedGeneration: 1
      reason: SyncWorkFailed
      status: "False"
      type: WorkSynchronized
  selectedResources:
  - kind: Namespace
    name: test-ns
    version: v1

ClusterResourcePlacement 상태에서 ClusterResourcePlacementWorkSynchronized 조건 상태는 .로 False표시됩니다. 이 메시지는 작업 개체 crp1-work 가 현재 종료 중이므로 네임스페이스 fleet-member-kind-cluster-1 내에서 새 콘텐츠를 생성할 수 없음을 나타냅니다.

해결

이 경우 다음과 같은 몇 가지 잠재적인 솔루션이 있습니다.

  • ClusterResourcePlacement 새로 선택한 클러스터를 사용하여 수정합니다.
  • 가비지 수집을 ClusterResourcePlacement 통해 작업을 제거하려면 삭제합니다.
  • 멤버 클러스터에 다시 참가합니다. 네임스페이스는 클러스터에 다시 가입한 후에만 다시 생성할 수 있습니다.

다른 상황에서는 작업이 전파가 완료될 때까지 기다리도록 선택할 수 있습니다.

도움을 요청하십시오.

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