다음을 통해 공유


리소스 전파 실패: ClusterResourcePlacementAvailable is False

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

증상

Azure Kubernetes Fleet Manager에서 ClusterResourcePlacement API 개체를 사용하여 리소스를 전파하면 배포가 실패합니다. 상태는 ClusterResourcePlacementAvailable 다음과 같이 False표시됩니다.

원인

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

  • 멤버 클러스터에 충분한 리소스 가용성이 없습니다.
  • 배포에 잘못된 이미지 이름이 포함되어 있습니다.

사례 연구

다음 예제에서는 잘못된 이미지 이름으로 인해 배포를 멤버 클러스터에 전파하지 않는 것을 보여 ClusterResourcePlacement 있습니다.

ClusterResourcePlacement 사양

apiVersion: placement.kubernetes-fleet.io/v1beta1
kind: ClusterResourcePlacement
metadata:
  name: crp
spec:
  resourceSelectors:
    - group: ""
      kind: Namespace
      name: test-ns
      version: v1
  policy:
    placementType: PickN
    numberOfClusters: 1
  strategy:
    type: RollingUpdate

ClusterResourcePlacement 상태

status:
  conditions:
  - lastTransitionTime: "2024-05-14T18:52:30Z"
    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:52:31Z"
    message: All 1 cluster(s) start rolling out the latest resource
    observedGeneration: 1
    reason: RolloutStarted
    status: "True"
    type: ClusterResourcePlacementRolloutStarted
  - lastTransitionTime: "2024-05-14T18:52:31Z"
    message: No override rules are configured for the selected resources
    observedGeneration: 1
    reason: NoOverrideSpecified
    status: "True"
    type: ClusterResourcePlacementOverridden
  - lastTransitionTime: "2024-05-14T18:52:31Z"
    message: Works(s) are succcesfully created or updated in 1 target cluster(s)'
      namespaces
    observedGeneration: 1
    reason: WorkSynchronized
    status: "True"
    type: ClusterResourcePlacementWorkSynchronized
  - lastTransitionTime: "2024-05-14T18:52:31Z"
    message: The selected resources are successfully applied to 1 cluster(s)
    observedGeneration: 1
    reason: ApplySucceeded
    status: "True"
    type: ClusterResourcePlacementApplied
  - lastTransitionTime: "2024-05-14T18:52:31Z"
    message: The selected resources in 1 cluster(s) are still not available yet
    observedGeneration: 1
    reason: ResourceNotAvailableYet
    status: "False"
    type: ClusterResourcePlacementAvailable
  observedResourceIndex: "0"
  placementStatuses:
  - clusterName: kind-cluster-1
    conditions:
    - lastTransitionTime: "2024-05-14T18:52:30Z"
      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:52:31Z"
      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:52:31Z"
      message: No override rules are configured for the selected resources
      observedGeneration: 1
      reason: NoOverrideSpecified
      status: "True"
      type: Overridden
    - lastTransitionTime: "2024-05-14T18:52:31Z"
      message: All of the works are synchronized to the latest
      observedGeneration: 1
      reason: AllWorkSynced
      status: "True"
      type: WorkSynchronized
    - lastTransitionTime: "2024-05-14T18:52:31Z"
      message: All corresponding work objects are applied
      observedGeneration: 1
      reason: AllWorkHaveBeenApplied
      status: "True"
      type: Applied
    - lastTransitionTime: "2024-05-14T18:52:31Z"
      message: Work object crp1-work isn't available
      observedGeneration: 1
      reason: NotAllWorkAreAvailable
      status: "False"
      type: Available
    failedPlacements:
    - condition:
        lastTransitionTime: "2024-05-14T18:52:31Z"
        message: Manifest is trackable but not available yet
        observedGeneration: 1
        reason: ManifestNotAvailableYet
        status: "False"
        type: Available
      group: apps
      kind: Deployment
      name: my-deployment
      namespace: test-ns
      version: v1
  selectedResources:
  - kind: Namespace
    name: test-ns
    version: v1
  - group: apps
    kind: Deployment
    name: my-deployment
    namespace: test-ns
    version: v1

failedPlacements 에 대한 kind-cluster-1섹션에서는 message 리소스가 멤버 클러스터에 적용되지 않은 이유를 설명합니다. 이전 conditions 섹션에서 조건에 플래그 kind-cluster-1 가 지정 false 되고 그 이유가 표시됩니다 NotAllWorkHaveBeenApplied Applied. 이는 멤버 클러스터 kind-cluster-1 에 대한 개체가 적용되지 않았음을 나타냅니다Work. 자세한 내용은 연결된 ClusterResourcePlacement올바른 작업 리소스를 찾는 방법을 참조하세요.

kind-cluster-1의 작업 상태

status:
conditions:
- lastTransitionTime: "2024-05-14T18:52:31Z"
  message: Work is applied successfully
  observedGeneration: 1
  reason: WorkAppliedCompleted
  status: "True"
  type: Applied
- lastTransitionTime: "2024-05-14T18:52:31Z"
  message: Manifest {Ordinal:1 Group:apps Version:v1 Kind:Deployment Resource:deployments
  Namespace:test-ns Name:my-deployment} is not available yet
  observedGeneration: 1
  reason: WorkNotAvailableYet
  status: "False"
  type: Available
  manifestConditions:
- conditions:
  - lastTransitionTime: "2024-05-14T18:52:31Z"
    message: Manifest is already up to date
    reason: ManifestAlreadyUpToDate
    status: "True"
    type: Applied
  - lastTransitionTime: "2024-05-14T18:52:31Z"
    message: Manifest is trackable and available now
    reason: ManifestAvailable
    status: "True"
    type: Available
    identifier:
    kind: Namespace
    name: test-ns
    ordinal: 0
    resource: namespaces
    version: v1
- conditions:
  - lastTransitionTime: "2024-05-14T18:52:31Z"
    message: Manifest is already up to date
    observedGeneration: 1
    reason: ManifestAlreadyUpToDate
    status: "True"
    type: Applied
  - lastTransitionTime: "2024-05-14T18:52:31Z"
    message: Manifest is trackable but not available yet
    observedGeneration: 1
    reason: ManifestNotAvailableYet
    status: "False"
    type: Available
    identifier:
    group: apps
    kind: Deployment
    name: my-deployment
    namespace: test-ns
    ordinal: 1
    resource: deployments
    version: v1

Available 대한 kind-cluster-1상태를 확인합니다. 멤버 클러스터에서 배포를 my-deployment 아직 사용할 수 없음을 확인할 수 있습니다. 이는 문제가 배포 매니페스트에 영향을 미칠 수 있음을 시사합니다.

해결

이 경우 잠재적인 해결 방법은 문제의 근본 원인이 잘못된 이미지 이름임을 나타내므로 멤버 클러스터의 배포를 확인하는 것입니다. 이 이미지 이름이 식별되면 배포 매니페스트를 수정하고 업데이트할 수 있습니다. 리소스 매니페스트 ClusterResourcePlacement 를 수정하고 업데이트한 후 개체 API는 수정된 리소스를 멤버 클러스터에 자동으로 전파합니다.

다른 모든 상황에서는 전파된 리소스가 올바르게 구성되었는지 확인합니다. 또한 선택한 클러스터에 새 리소스를 수용할 수 있는 충분한 용량이 있는지 확인합니다.

도움을 요청하십시오.

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