11.9.4. 클러스터
관리 클러스터가 있는지 확인
- 문제
-
ClusterGroupUpgradeCR의 클러스터가 관리 클러스터인지 확인하려고 합니다. - 해결
다음 명령을 실행합니다.
$ oc get managedclusters출력 예
NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE local-cluster true https://api.hub.example.com:6443 True Unknown 13d spoke1 true https://api.spoke1.example.com:6443 True True 13d spoke3 true https://api.spoke3.example.com:6443 True True 27h또는 TALM 관리자 로그를 확인합니다.
다음 명령을 실행하여 TALM 관리자의 이름을 가져옵니다.
$ oc get pod -n openshift-operators출력 예
NAME READY STATUS RESTARTS AGE cluster-group-upgrades-controller-manager-75bcc7484d-8k8xp 2/2 Running 0 45m다음 명령을 실행하여 TALM 관리자 로그를 확인합니다.
$ oc logs -n openshift-operators \ cluster-group-upgrades-controller-manager-75bcc7484d-8k8xp -c manager출력 예
ERROR controller-runtime.manager.controller.clustergroupupgrade Reconciler error {"reconciler group": "ran.openshift.io", "reconciler kind": "ClusterGroupUpgrade", "name": "lab-upgrade", "namespace": "default", "error": "Cluster spoke5555 is not a ManagedCluster"}1 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem- 1
- 오류 메시지는 클러스터가 관리 클러스터가 아님을 나타냅니다.
관리 클러스터를 사용할 수 있는지 확인
- 문제
-
ClusterGroupUpgradeCR에 지정된 관리 클러스터를 사용할 수 있는지 확인하려고 합니다. - 해결
다음 명령을 실행합니다.
$ oc get managedclusters출력 예
NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE local-cluster true https://api.hub.testlab.com:6443 True Unknown 13d spoke1 true https://api.spoke1.testlab.com:6443 True True 13d1 spoke3 true https://api.spoke3.testlab.com:6443 True True 27h2
clusterLabelSelector 확인
- 문제
-
ClusterGroupUpgradeCR에 지정된clusterLabelSelector필드가 관리 클러스터 중 하나와 일치하는지 확인해야 합니다. - 해결
다음 명령을 실행합니다.
$ oc get managedcluster --selector=upgrade=true1 - 1
- 업데이트하려는 클러스터의 레이블은
upgrade:true입니다.출력 예
NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE spoke1 true https://api.spoke1.testlab.com:6443 True True 13d spoke3 true https://api.spoke3.testlab.com:6443 True True 27h
카나리아 클러스터가 있는지 확인
- 문제
카나리아 클러스터가 클러스터 목록에 있는지 확인하려고 합니다.
ClusterGroupUpgradeCR의 예spec: remediationStrategy: canaries: - spoke3 maxConcurrency: 2 timeout: 240 clusterLabelSelectors: - matchLabels: upgrade: true- 해결
다음 명령을 실행합니다.
$ oc get cgu lab-upgrade -ojsonpath='{.spec.clusters}'출력 예
["spoke1", "spoke3"]다음 명령을 실행하여 카나리아 클러스터가
clusterLabelSelector라벨과 일치하는 클러스터 목록에 있는지 확인합니다.$ oc get managedcluster --selector=upgrade=true출력 예
NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE spoke1 true https://api.spoke1.testlab.com:6443 True True 13d spoke3 true https://api.spoke3.testlab.com:6443 True True 27h
클러스터는 spec.clusters 에 존재할 수 있으며 spec.clusterLabelSelector 라벨과 일치할 수도 있습니다.
spoke 클러스터에서 사전 캐싱 상태 확인
spoke 클러스터에서 다음 명령을 실행하여 사전 캐싱 상태를 확인합니다.
$ oc get jobs,pods -n openshift-talo-pre-cache