1.5. Red Hat Advanced Cluster Management 업그레이드 후 ocm-controller 오류 문제 해결
2.7.x에서 2.8.x로 업그레이드한 후 multicluster-engine
네임스페이스의 ocm-controller
가 충돌합니다.
1.5.1. 증상: Red Hat Advanced Cluster Management 업그레이드 후 ocm-controller 오류 문제 해결 링크 복사링크가 클립보드에 복사되었습니다!
ManagedClusterSet
및 ManagedClusterSetBinding
사용자 정의 리소스 정의를 나열하려는 후 다음 오류 메시지가 표시됩니다.
Error from server: request to convert CR from an invalid group/version: cluster.open-cluster-management.io/v1beta1
Error from server: request to convert CR from an invalid group/version: cluster.open-cluster-management.io/v1beta1
이전 메시지는 ManagedClusterSets
및 ManagedClusterSetBindings
사용자 정의 리소스 정의 v1beta1
에서 v1beta2
로의 사용자 정의 리소스 정의가 실패했음을 나타냅니다.
1.5.2. 문제 해결: Red Hat Advanced Cluster Management 업그레이드 후 ocm-controller 오류 문제 해결 링크 복사링크가 클립보드에 복사되었습니다!
이 오류를 해결하려면 API 마이그레이션을 수동으로 시작해야 합니다. 다음 단계를 완료합니다.
cluster-manager
를 이전 릴리스로 되돌립니다.다음 명령을 사용하여
다중 클러스터 엔진
을 일시 중지합니다.oc annotate mce multiclusterengine pause=true
oc annotate mce multiclusterengine pause=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 다음 명령을 실행하여
cluster-manager
배포의 이미지를 이전 버전으로 교체합니다.oc patch deployment cluster-manager -n multicluster-engine -p \ '{"spec":{"template":{"spec":{"containers":[{"name":"registration-operator","image":"registry.redhat.io/multicluster-engine/registration-operator-rhel8@sha256:35999c3a1022d908b6fe30aa9b85878e666392dbbd685e9f3edcb83e3336d19f"}]}}}}' export ORIGIN_REGISTRATION_IMAGE=$(oc get clustermanager cluster-manager -o jsonpath='{.spec.registrationImagePullSpec}')
oc patch deployment cluster-manager -n multicluster-engine -p \ '{"spec":{"template":{"spec":{"containers":[{"name":"registration-operator","image":"registry.redhat.io/multicluster-engine/registration-operator-rhel8@sha256:35999c3a1022d908b6fe30aa9b85878e666392dbbd685e9f3edcb83e3336d19f"}]}}}}' export ORIGIN_REGISTRATION_IMAGE=$(oc get clustermanager cluster-manager -o jsonpath='{.spec.registrationImagePullSpec}')
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ClusterManager
리소스의 등록 이미지 참조를 이전 버전으로 교체합니다. 다음 명령을 실행합니다.oc patch clustermanager cluster-manager --type='json' -p='[{"op": "replace", "path": "/spec/registrationImagePullSpec", "value": "registry.redhat.io/multicluster-engine/registration-rhel8@sha256:a3c22aa4326859d75986bf24322068f0aff2103cccc06e1001faaf79b9390515"}]'
oc patch clustermanager cluster-manager --type='json' -p='[{"op": "replace", "path": "/spec/registrationImagePullSpec", "value": "registry.redhat.io/multicluster-engine/registration-rhel8@sha256:a3c22aa4326859d75986bf24322068f0aff2103cccc06e1001faaf79b9390515"}]'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
다음 명령을 실행하여
ManagedClusterSets
및ManagedClusterSetBindings
사용자 정의 리소스 정의를 이전 릴리스로 되돌립니다.oc annotate crds managedclustersets.cluster.open-cluster-management.io operator.open-cluster-management.io/version- oc annotate crds managedclustersetbindings.cluster.open-cluster-management.io operator.open-cluster-management.io/version-
oc annotate crds managedclustersets.cluster.open-cluster-management.io operator.open-cluster-management.io/version- oc annotate crds managedclustersetbindings.cluster.open-cluster-management.io operator.open-cluster-management.io/version-
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cluster-manager
를 다시 시작하고 사용자 정의 리소스 정의가 다시 생성될 때까지 기다립니다. 다음 명령을 실행합니다.oc -n multicluster-engine delete pods -l app=cluster-manager oc wait crds managedclustersets.cluster.open-cluster-management.io --for=jsonpath="{.metadata.annotations['operator\.open-cluster-management\.io/version']}"="2.3.3" --timeout=120s oc wait crds managedclustersetbindings.cluster.open-cluster-management.io --for=jsonpath="{.metadata.annotations['operator\.open-cluster-management\.io/version']}"="2.3.3" --timeout=120s
oc -n multicluster-engine delete pods -l app=cluster-manager oc wait crds managedclustersets.cluster.open-cluster-management.io --for=jsonpath="{.metadata.annotations['operator\.open-cluster-management\.io/version']}"="2.3.3" --timeout=120s oc wait crds managedclustersetbindings.cluster.open-cluster-management.io --for=jsonpath="{.metadata.annotations['operator\.open-cluster-management\.io/version']}"="2.3.3" --timeout=120s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 다음 명령을 사용하여 스토리지 버전 마이그레이션을 시작합니다.
oc patch StorageVersionMigration managedclustersets.cluster.open-cluster-management.io --type='json' -p='[{"op":"replace", "path":"/spec/resource/version", "value":"v1beta1"}]' oc patch StorageVersionMigration managedclustersets.cluster.open-cluster-management.io --type='json' --subresource status -p='[{"op":"remove", "path":"/status/conditions"}]' oc patch StorageVersionMigration managedclustersetbindings.cluster.open-cluster-management.io --type='json' -p='[{"op":"replace", "path":"/spec/resource/version", "value":"v1beta1"}]' oc patch StorageVersionMigration managedclustersetbindings.cluster.open-cluster-management.io --type='json' --subresource status -p='[{"op":"remove", "path":"/status/conditions"}]'
oc patch StorageVersionMigration managedclustersets.cluster.open-cluster-management.io --type='json' -p='[{"op":"replace", "path":"/spec/resource/version", "value":"v1beta1"}]' oc patch StorageVersionMigration managedclustersets.cluster.open-cluster-management.io --type='json' --subresource status -p='[{"op":"remove", "path":"/status/conditions"}]' oc patch StorageVersionMigration managedclustersetbindings.cluster.open-cluster-management.io --type='json' -p='[{"op":"replace", "path":"/spec/resource/version", "value":"v1beta1"}]' oc patch StorageVersionMigration managedclustersetbindings.cluster.open-cluster-management.io --type='json' --subresource status -p='[{"op":"remove", "path":"/status/conditions"}]'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 다음 명령을 실행하여 마이그레이션이 완료될 때까지 기다립니다.
oc wait storageversionmigration managedclustersets.cluster.open-cluster-management.io --for=condition=Succeeded --timeout=120s oc wait storageversionmigration managedclustersetbindings.cluster.open-cluster-management.io --for=condition=Succeeded --timeout=120s
oc wait storageversionmigration managedclustersets.cluster.open-cluster-management.io --for=condition=Succeeded --timeout=120s oc wait storageversionmigration managedclustersetbindings.cluster.open-cluster-management.io --for=condition=Succeeded --timeout=120s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cluster-manager
를 Red Hat Advanced Cluster Management 2.13으로 복원합니다. 몇 분 정도 걸릴 수 있습니다. 다음 명령을 실행합니다.oc annotate mce multiclusterengine pause- oc patch clustermanager cluster-manager --type='json' -p='[{"op": "replace", "path": "/spec/registrationImagePullSpec", "value": "'$ORIGIN_REGISTRATION_IMAGE'"}]'
oc annotate mce multiclusterengine pause- oc patch clustermanager cluster-manager --type='json' -p='[{"op": "replace", "path": "/spec/registrationImagePullSpec", "value": "'$ORIGIN_REGISTRATION_IMAGE'"}]'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5.2.1. 검증 링크 복사링크가 클립보드에 복사되었습니다!
Red Hat Advanced Cluster Management가 복구되었는지 확인하려면 다음 명령을 실행합니다.
oc get managedclusterset oc get managedclustersetbinding -A
oc get managedclusterset
oc get managedclustersetbinding -A
명령을 실행하면 ManagedClusterSets
및 ManagedClusterSetBindings
리소스가 오류 메시지 없이 나열됩니다.