4.4. 카탈로그 콘텐츠 해결


사용자 정의 리소스(CR)에 설치하려는 클러스터 확장을 지정하면 Operator Lifecycle Manager(OLM) v1은 카탈로그 선택을 사용하여 어떤 콘텐츠를 설치할지 확인합니다.

카탈로그 콘텐츠 선택을 제어하려면 다음 작업을 수행할 수 있습니다.

  • 카탈로그를 선택하려면 라벨을 지정하세요.
  • 복잡한 카탈로그 필터링을 수행하려면 일치 표현식을 사용합니다.
  • 카탈로그 우선순위를 설정합니다.

카탈로그 선택 기준을 지정하지 않으면 Operator Lifecycle Manager(OLM) v1은 요청된 패키지를 제공하는 클러스터의 사용 가능한 카탈로그에서 확장을 선택합니다.

해결 과정에서는 기본적으로 더 이상 사용되지 않는 번들이 더 이상 사용되지 않는 번들보다 우선합니다.

4.4.1. 이름으로 카탈로그 선택

카탈로그가 클러스터에 추가되면 카탈로그 사용자 정의 리소스(CR)의 metadata.name 필드 값을 사용하여 레이블이 생성됩니다. 확장 프로그램의 CR에서 spec.source.catalog.selector.matchLabels 필드를 사용하여 카탈로그 이름을 지정할 수 있습니다. matchLabels 필드의 값은 다음 형식을 사용합니다.

metadata.name 필드에서 파생된 예제 레이블

apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
  name: <example_extension>
  labels:
    olm.operatorframework.io/metadata.name: <example_extension> 
1

...

1
카탈로그가 적용될 때 자동으로 추가되는 metadata.name 필드에서 파생된 레이블입니다.

다음 예제에서는 openshift-redhat-operators 레이블이 있는 카탈로그에서 <example_extension>-operator 패키지를 확인합니다.

예제 확장 CR

apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
  name: <example_extension>
spec:
  namespace: <example_namespace>
  serviceAccount:
    name: <example_extension>-installer
  source:
    sourceType: Catalog
    catalog:
      packageName: <example_extension>-operator
      selector:
        matchLabels:
          olm.operatorframework.io/metadata.name: openshift-redhat-operators

4.4.2. 라벨 또는 표현에 따른 카탈로그 선택

클러스터 카탈로그의 사용자 정의 리소스(CR)에 있는 레이블을 사용하여 카탈로그에 메타데이터를 추가할 수 있습니다. 그런 다음 클러스터 확장의 CR에서 할당된 레이블을 지정하거나 표현식을 사용하여 카탈로그 선택을 필터링할 수 있습니다.

다음 클러스터 카탈로그 CR은 카탈로그-a 클러스터 카탈로그에 true 값을 갖는 example.com/support 레이블을 추가합니다.

레이블이 있는 클러스터 카탈로그 CR 예시

apiVersion: olm.operatorframework.io/v1
kind: ClusterCatalog
metadata:
  name: catalog-a
  labels:
    example.com/support: "true"
spec:
  source:
    type: Image
    image:
      ref: quay.io/example/content-management-a:latest

다음 클러스터 확장 CR은 matchLabels 선택기를 사용하여 example.com/support 레이블과 true 값이 있는 카탈로그를 선택합니다.

matchLabels 선택기를 사용한 클러스터 확장 CR 예시

apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
  name: <example_extension>
spec:
  namespace: <example_namespace>
  serviceAccount:
    name: <example_extension>-installer
  source:
    sourceType: Catalog
    catalog:
      packageName: <example_extension>-operator
      selector:
        matchLabels:
          example.com/support: "true"

matchExpressions 필드를 사용하면 레이블에 대한 더 복잡한 필터링을 수행할 수 있습니다. 다음 클러스터 확장 CR은 example.com/support 레이블과 production 또는 supported 값을 갖는 카탈로그를 선택합니다.

matchExpression 선택기를 사용한 클러스터 확장 CR 예시

apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
  name: <example_extension>
spec:
  namespace: <example_namespace>
  serviceAccount:
    name: <example_extension>-installer
  source:
    sourceType: Catalog
    catalog:
      packageName: <example_extension>-operator
      selector:
        matchExpressions:
          - key: example.com/support
            operator: In
            values:
              - "production"
              - "supported"

참고

matchLabelsmatchExpressions 필드를 모두 사용하는 경우, 선택한 카탈로그는 지정된 모든 기준을 충족해야 합니다.

4.4.3. 라벨 또는 표현에 따른 카탈로그 제외

NotIn 또는 DoesNotExist 연산자와 함께 메타데이터에 일치 표현식을 사용하여 카탈로그를 제외할 수 있습니다.

다음 CR은 unwanted-catalog-1unwanted-catalog-2 클러스터 카탈로그에 example.com/testing 레이블을 추가합니다.

예제 클러스터 카탈로그 CR

apiVersion: olm.operatorframework.io/v1
kind: ClusterCatalog
metadata:
  name: unwanted-catalog-1
  labels:
    example.com/testing: "true"
spec:
  source:
    type: Image
    image:
      ref: quay.io/example/content-management-a:latest

예제 클러스터 카탈로그 CR

apiVersion: olm.operatorframework.io/v1
kind: ClusterCatalog
metadata:
  name: unwanted-catalog-2
  labels:
    example.com/testing: "true"
spec:
  source:
    type: Image
    image:
      ref: quay.io/example/content-management-b:latest

다음 클러스터 확장 CR은 unwanted-catalog-1 카탈로그에서 선택을 제외합니다.

특정 카탈로그를 제외하는 클러스터 확장 CR 예

apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
  name: <example_extension>
spec:
  namespace: <example_namespace>
  serviceAccount:
    name: <example_extension>-installer
  source:
    sourceType: Catalog
    catalog:
      packageName: <example_extension>-operator
      selector:
        matchExpressions:
          - key: olm.operatorframework.io/metadata.name
            operator: NotIn
            values:
              - unwanted-catalog-1

다음 클러스터 확장 CR은 example.com/testing 레이블이 없는 카탈로그에서 선택합니다. 결과적으로, unwanted-catalog-1unwanted-catalog-2 는 모두 카탈로그 선택에서 제외됩니다.

특정 레이블이 있는 카탈로그를 제외하는 클러스터 확장 CR 예

apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
  name: <example_extension>
spec:
  namespace: <example_namespace>
  serviceAccount:
    name: <example_extension>-installer
  source:
    sourceType: Catalog
    catalog:
      packageName: <example_extension>-operator
      selector:
        matchExpressions:
          - key: example.com/testing
            operator: DoesNotExist

4.4.4. 우선순위에 따른 카탈로그 선택

여러 카탈로그에서 동일한 패키지를 제공하는 경우 각 카탈로그의 사용자 정의 리소스(CR)에서 우선순위를 지정하여 모호성을 해결할 수 있습니다. 지정하지 않으면 카탈로그의 기본 우선 순위 값은 0 입니다. 우선순위는 양수 또는 음수의 32비트 정수가 될 수 있습니다.

참고
  • 번들 확인 중에 우선순위 값이 높은 카탈로그가 우선순위 값이 낮은 카탈로그보다 선택됩니다.
  • 더 이상 사용되지 않는 번들은 더 이상 사용되지 않는 번들보다 우선합니다.
  • 동일한 우선순위를 가진 여러 번들이 카탈로그에 존재하고 카탈로그 선택이 모호한 경우 오류가 출력됩니다.

더 높은 우선순위를 갖는 예제 클러스터 카탈로그 CR

apiVersion: olm.operatorframework.io/v1
kind: ClusterCatalog
metadata:
  name: high-priority-catalog
spec:
  priority: 1000
  source:
    type: Image
    image:
      ref: quay.io/example/higher-priority-catalog:latest

우선순위가 낮은 클러스터 카탈로그 CR의 예

apiVersion: olm.operatorframework.io/v1
kind: ClusterCatalog
metadata:
  name: lower-priority-catalog
spec:
  priority: 10
  source:
    type: Image
    image:
      ref: quay.io/example/lower-priority-catalog:latest

4.4.5. 카탈로그 선택 오류 문제 해결

모호함이나 선택된 카탈로그가 없어 번들 확인에 실패하면 클러스터 확장의 status.conditions 필드에 오류 메시지가 인쇄됩니다.

다음 작업을 수행하여 카탈로그 선택 오류 문제를 해결합니다.

  • 라벨이나 표현을 사용하여 선택 기준을 구체화하세요.
  • 카탈로그 우선순위를 조정하세요.
  • 패키지 이름과 버전 요구 사항과 일치하는 번들이 하나만 있는지 확인하세요.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동