9.2. 가져오기 준비
엔진 클러스터에 로그인합니다. 엔진 클러스터는 Kubernetes Operator용 다중 클러스터 엔진과 사용자 정의 리소스가 포함된 클러스터입니다. 다음 명령을 실행합니다.
oc login
engine 클러스터에서 다음 명령을 실행하여 프로젝트를 생성합니다.
참고:
CLUSTER_NAME
에 정의되어 있고.yaml
파일의 클러스터 네임스페이스와 명령으로도 사용되는 클러스터 이름입니다.oc new-project ${CLUSTER_NAME}
다음 명령을 실행하여 네임스페이스를 생성합니다.
oc label namespace ${CLUSTER_NAME} cluster.open-cluster-management.io/managedCluster=${CLUSTER_NAME}
다음 YAML 샘플을 사용하여
ManagedCluster
예제를 편집합니다.apiVersion: cluster.open-cluster-management.io/v1 kind: ManagedCluster metadata: name: ${CLUSTER_NAME} spec: hubAcceptsClient: true
선택 사항: 이번 릴리스에서는 hub 클러스터를
로컬
클러스터라고 하는 관리 클러스터가 되도록 자동으로 가져올 수 없습니다. 관리 클러스터가 로컬 클러스터가 되도록 수동으로 활성화하려면metadata.labels.
를 추가합니다. 다음 예제 YAML을 참조하여 이름이local-cluster
: "true"local-cluster
인지 확인합니다.local-cluster
가 이름이 아닌 경우 가져오기가 실패하거나 예기치 않은 결과를 생성합니다.apiVersion: cluster.open-cluster-management.io/v1 kind: ManagedCluster metadata: labels: local-cluster: "true" cloud: auto-detect vendor: auto-detect name: local-cluster spec: hubAcceptsClient: true
-
파일을
managed-cluster.yaml
로 저장합니다. 다음 명령을 사용하여 YAML 파일을 적용합니다.
oc apply -f managed-cluster.yaml