9.3. 자동 가져오기 보안을 사용하여 가져오기
engine 클러스터에 계속 로그인하는 동안 다음 단계를 진행합니다.
-
가져올 클러스터의
kubeconfig
파일 또는 가져오는 클러스터의 kube API 서버 및 토큰을 검색합니다.kubeconfig
파일 또는 kube api 서버 및 토큰을 찾을 위치를 알아보려면 Kubernetes 클러스터 설명서를 참조하십시오. kubeconfig
또는 server/token 쌍을 사용하여 다음 템플릿과 유사한 콘텐츠가 포함된 YAML 파일을 생성합니다.apiVersion: v1 kind: Secret metadata: name: auto-import-secret stringData: # the following value to specify the retry times when your cluster failed to import autoImportRetry: "5" # If you are using the kubeconfig file, add the following value for the kubeconfig file # that has the current context set to the cluster to import: kubeconfig: |- <kubeconfig_file> # If you are using the server/token pair, add the following two values: server: <cluster_api_url> token: <Token to access the cluster> type: Opaque
- 파일을 auto-import-secret.yaml로 저장
가져올 클러스터의
kubeconfig
파일을 사용하여${CLUSTER_NAME}
네임스페이스에 가져오기 보안을 생성합니다.kubeconfig
및CLUSTER_NAME
경로와 함께 다음 명령을 실행합니다.oc apply -f auto-import-secret.yaml
참고: 자동 가져오기 보안은 한 번 사용되며 가져오기 프로세스가 완료되면 삭제됩니다.
가져온 클러스터에 대한 status
ED
및AVAILABLE
상태를 검증합니다. Kubernetes 클러스터의 다중 클러스터 엔진에서 다음 명령을 실행합니다.oc get managedcluster ${CLUSTER_NAME}
가져올 별도의 클러스터에서 다음 단계를 진행합니다.
가져올 클러스터에 로그인합니다. 다음 명령을 실행합니다.
oc login
가져올 클러스터에서 Pod 상태를 확인합니다. 다음 명령을 실행합니다.
oc get pod -n open-cluster-management-agent
가져올 클러스터가
AVAILABLE
인 후 애드온이 설치됩니다. 클러스터에서 애드온의 포드 상태를 확인합니다. 다음 명령을 실행합니다.oc get pod -n open-cluster-management-agent-addon
이제 클러스터를 가져옵니다.