6.2. Operator 수정
지원 설치 관리자에서는 이전 설치 단계의 일부로 이미 등록된 클러스터 리소스의 Operator를 추가하거나 제거할 수 있습니다. 이는 OpenShift Container Platform 설치를 시작하기 전에만 가능합니다.
정의된 Operator를 수정하려면 다음을 수행합니다.
- 지원 설치 관리자 UI를 사용하는 경우 마법사의 Operator 페이지로 이동하여 선택을 수정합니다. 자세한 내용은 이 섹션에서 Operator 설치를 참조하십시오.
- 지원 설치 프로그램 API를 사용하는 경우 /v2/clusters/{cluster_id} 엔드포인트에 PATCH 방법을 사용하여 필요한 Operator 정의를 설정합니다.
사전 요구 사항
- 새 클러스터 리소스가 생성되어 있습니다.
절차
API 토큰을 새로 고칩니다.
$ source refresh-token
다음과 같이 기존 클러스터를 나열하여
CLUSTER_ID
변수를 식별합니다.$ curl -s https://api.openshift.com/api/assisted-install/v2/clusters -H "Authorization: Bearer ${API_TOKEN}" | jq '[ .[] | { "name": .name, "id": .id } ]'
샘플 출력
[ { "name": "lvmtest", "id": "475358f9-ed3a-442f-ab9e-48fd68bc8188" 1 }, { "name": "mcetest", "id": "b5259f97-be09-430e-b5eb-d78420ee509a" } ]
참고- 1
id
값은 <cluster_id>입니다
.
반환된 <
;cluster_id&
gt;를CLUSTER_ID
변수에 할당하고 내보냅니다.$ export CLUSTER_ID=<cluster_id>
새 Operator로 클러스터를 업데이트합니다.
$ curl https://api.openshift.com/api/assisted-install/v2/clusters/${CLUSTER_ID} \ -X PATCH \ -H "Authorization: Bearer ${API_TOKEN}" \ -H "Content-Type: application/json" \ -d ' { "olm_operators": [{"name": "mce"}, {"name": "cnv"}], 1 } ' | jq '.id'
참고- 1
- Operator가 설치됨을 나타냅니다. 유효한 값에는
mce
,cnv
,lvm
,odf
가 포함됩니다. 이전에 설치한 Operator를 제거하려면 값 목록에서 제외합니다. 이전에 설치한 모든 Operator를 제거하려면"olm_operators": []
를 입력합니다.
샘플 출력
{ <various cluster properties>, "monitored_operators": [ { "cluster_id": "b5259f97-be09-430e-b5eb-d78420ee509a", "name": "console", "operator_type": "builtin", "status_updated_at": "0001-01-01T00:00:00.000Z", "timeout_seconds": 3600 }, { "cluster_id": "b5259f97-be09-430e-b5eb-d78420ee509a", "name": "cvo", "operator_type": "builtin", "status_updated_at": "0001-01-01T00:00:00.000Z", "timeout_seconds": 3600 }, { "cluster_id": "b5259f97-be09-430e-b5eb-d78420ee509a", "name": "mce", "namespace": "multicluster-engine", "operator_type": "olm", "status_updated_at": "0001-01-01T00:00:00.000Z", "subscription_name": "multicluster-engine", "timeout_seconds": 3600 }, { "cluster_id": "b5259f97-be09-430e-b5eb-d78420ee509a", "name": "cnv", "namespace": "openshift-cnv", "operator_type": "olm", "status_updated_at": "0001-01-01T00:00:00.000Z", "subscription_name": "hco-operatorhub", "timeout_seconds": 3600 }, { "cluster_id": "b5259f97-be09-430e-b5eb-d78420ee509a", "name": "lvm", "namespace": "openshift-local-storage", "operator_type": "olm", "status_updated_at": "0001-01-01T00:00:00.000Z", "subscription_name": "local-storage-operator", "timeout_seconds": 4200 } ], <more cluster properties>
참고출력은 새 클러스터 상태에 대한 설명입니다. 출력의
monitored_operators
속성에는 다음 두 가지 유형의 Operator가 포함되어 있습니다.-
"operator_type": "builtin
": 이 유형의 Operator는 OpenShift Container Platform의 통합 부분입니다. -
"operator_type": "olm
": 이 유형의 Operator는 사용자가 수동으로 추가하거나 종속성으로 인해 자동으로 추가됩니다. 이 예제에서는cnv
Operator에 필요하므로lso
Operator가 자동으로 추가되었습니다.