4.8. 설치 CR을 검증하여 GitOps ZTP 문제 해결
ArgoCD 파이프라인은 SiteConfig 및 PolicyGenerator 또는 PolicyGentemplate 사용자 정의 리소스(CR)를 사용하여 클러스터 구성 CR과 Red Hat Advanced Cluster Management(RHACM) 정책을 생성합니다. 이 과정에서 발생할 수 있는 문제를 해결하려면 다음 단계를 따르세요.
사전 요구 사항
-
OpenShift CLI(
oc)가 설치되어 있습니다. -
cluster-admin권한이 있는 사용자로 허브 클러스터에 로그인했습니다.
프로세스
다음 명령을 사용하여 설치 CR이 생성되었는지 확인하세요.
$ oc get AgentClusterInstall -n <cluster_name>객체가 반환되지 않으면 다음 단계에 따라
SiteConfig파일에서 설치 CR로 가는 ArgoCD 파이프라인 흐름 문제를 해결하세요.허브 클러스터에서
SiteConfigCR을 사용하여ManagedClusterCR이 생성되었는지 확인하세요.$ oc get managedclusterManagedCluster가 누락된 경우클러스터애플리케이션이 Git 저장소에서 허브 클러스터로 파일을 동기화하는 데 실패했는지 확인하세요.$ oc get applications.argoproj.io -n openshift-gitops clusters -o yaml관리되는 클러스터의 오류 로그를 식별하려면
status.operationState.syncResult.resources필드를 검사하세요. 예를 들어,SiteConfigCR의extraManifestPath에 잘못된 값이 할당되면 다음과 유사한 오류가 생성됩니다.syncResult: resources: - group: ran.openshift.io kind: SiteConfig message: The Kubernetes API could not find ran.openshift.io/SiteConfig for requested resource spoke-sno/spoke-sno. Make sure the "SiteConfig" CRD is installed on the destination cluster더 자세한
SiteConfig오류를 보려면 다음 단계를 완료하세요.- Argo CD 대시보드에서 Argo CD가 동기화하려는 SiteConfig 리소스를 클릭합니다.
DESIRED MANIFEST 탭에서
siteConfigError필드를 찾으세요.siteConfigError: >- Error: could not build the entire SiteConfig defined by /tmp/kust-plugin-config-1081291903: stat sno-extra-manifest: no such file or directory
Status.Sync필드를 확인하세요. 로그 오류가 있는 경우Status.Sync필드는알 수 없는오류를 나타낼 수 있습니다.Status: Sync: Compared To: Destination: Namespace: clusters-sub Server: https://kubernetes.default.svc Source: Path: sites-config Repo URL: https://git.com/ran-sites/siteconfigs/.git Target Revision: master Status: Unknown