5.2. 클러스터 확장 관리
카탈로그를 사용하여 확장 및 Operator를 위한 버전, 패치 및 무선 업데이트에 액세스합니다. CR(사용자 정의 리소스)을 사용하여 CLI에서 선언적으로 확장을 관리합니다.
OpenShift Container Platform 4.22의 경우 OLM v1에 대한 문서화된 절차는 CLI 기반 전용입니다. 또는 관리자는 YAML 가져오기 및 검색 페이지와 같은 일반 방법을 사용하여 웹 콘솔에서 관련 오브젝트를 생성하고 볼 수 있습니다. 그러나 기존 소프트웨어 카탈로그 및 설치된 Operator 페이지에는 OLM v1 구성 요소가 아직 표시되지 않습니다.
5.2.1. 카탈로그에서 설치할 Operator 찾기 링크 복사링크가 클립보드에 복사되었습니다!
클러스터에 카탈로그를 추가한 후 카탈로그를 쿼리하여 설치할 Operator 및 확장을 찾을 수 있습니다.
현재 OLM(Operator Lifecycle Manager) v1에서는 카탈로그에서 관리하는 클러스터 카탈로그에서 쿼리할 수 없습니다. OLM v1에서는 opm 및 jq CLI 툴을 사용하여 카탈로그 레지스트리를 쿼리해야 합니다.
사전 요구 사항
- 클러스터에 카탈로그를 추가했습니다.
-
jqCLI 툴을 설치했습니다. -
opmCLI 툴을 설치했습니다.
프로세스
AllNamespaces설치 모드를 지원하고 Webhook를 사용하지 않는 확장 목록을 반환하려면 다음 명령을 입력합니다.$ opm render <catalog_registry_url>:<tag> \ | jq -cs '[.[] | select(.schema == "olm.bundle" \ and (.properties[] | select(.type == "olm.csv.metadata").value.installModes[] \ | select(.type == "AllNamespaces" and .supported == true)) \ and .spec.webhookdefinitions == null) | .package] | unique[]'다음과 같습니다.
catalog_registry_url-
registry.redhat.io/redhat/redhat-operator-index와 같은 카탈로그 레지스트리의 URL을 지정합니다. tagv4.22또는latest와 같은 카탈로그의 태그 또는 버전을 지정합니다.예 5.1. 명령 예
$ opm render \ registry.redhat.io/redhat/redhat-operator-index:v4.22 \ | jq -cs '[.[] | select(.schema == "olm.bundle" \ and (.properties[] | select(.type == "olm.csv.metadata").value.installModes[] \ | select(.type == "AllNamespaces" and .supported == true)) \ and .spec.webhookdefinitions == null) | .package] | unique[]'예 5.2. 출력 예
"3scale-operator" "amq-broker-rhel8" "amq-online" "amq-streams" "amq-streams-console" "ansible-automation-platform-operator" "ansible-cloud-addons-operator" "apicast-operator" "authorino-operator" "aws-load-balancer-operator" "bamoe-kogito-operator" "cephcsi-operator" "cincinnati-operator" "cluster-logging" "cluster-observability-operator" "compliance-operator" "container-security-operator" "cryostat-operator" "datagrid" "devspaces" ...
다음 명령을 실행하여 확장 메타데이터의 콘텐츠를 검사합니다.
$ opm render <catalog_registry_url>:<tag> \ | jq -s '.[] | select( .schema == "olm.package") \ | select( .name == "<package_name>")'예 5.3. 명령 예
$ opm render \ registry.redhat.io/redhat/redhat-operator-index:v4.22 \ | jq -s '.[] | select( .schema == "olm.package") \ | select( .name == "openshift-pipelines-operator-rh")'예 5.4. 출력 예
{ "schema": "olm.package", "name": "openshift-pipelines-operator-rh", "defaultChannel": "latest", "icon": { "base64data": "iVBORw0KGgoAAAANSUhE...", "mediatype": "image/png" } }
5.2.1.1. 공통 카탈로그 쿼리 링크 복사링크가 클립보드에 복사되었습니다!
opm 및 jq CLI 툴을 사용하여 카탈로그를 쿼리할 수 있습니다. 다음 표에는 확장 라이프사이클을 설치, 업데이트 및 관리할 때 사용할 수 있는 일반적인 카탈로그 쿼리가 표시되어 있습니다.
명령 구문
$ opm render <catalog_registry_url>:<tag> | <jq_request>
다음과 같습니다.
catalog_registry_url-
registry.redhat.io/redhat/redhat-operator-index와 같은 카탈로그 레지스트리의 URL을 지정합니다. tag-
v4.22또는latest와 같은 카탈로그의 태그 또는 버전을 지정합니다. jq_request- 카탈로그에서 실행할 쿼리를 지정합니다.
예 5.5. 명령 예
$ opm render \
registry.redhat.io/redhat/redhat-operator-index:v4.22 \
| jq -cs '[.[] | select(.schema == "olm.bundle" and (.properties[] \
| select(.type == "olm.csv.metadata").value.installModes[] \
| select(.type == "AllNamespaces" and .supported == true)) \
and .spec.webhookdefinitions == null) \
| .package] | unique[]'
| 쿼리 | 요청 |
|---|---|
| 카탈로그에서 사용 가능한 패키지 |
|
|
|
|
| 패키지 메타데이터 |
|
| 패키지의 카탈로그 Blob |
|
| 쿼리 | 요청 |
|---|---|
| 패키지의 채널 |
|
| 채널의 버전 |
|
|
|
| 쿼리 | 요청 |
|---|---|
| 패키지의 번들 |
|
|
|