3.2.2. CLI를 사용하여 OpenShift Update Service Operator 설치

OpenShift CLI(oc)를 사용하여 OpenShift Update Service Operator를 설치할 수 있습니다.

프로세스

  1. OpenShift OpenShift Update Service Operator의 네임스페이스를 생성합니다.

    1. OpenShift Update Service Operator에 대해 Namespace 오브젝트 YAML 파일 (예: update-service-namespace.yaml)을 만듭니다.

      apiVersion: v1
      kind: Namespace
      metadata:
        name: openshift-update-service
        annotations:
          openshift.io/node-selector: ""
        labels:
          openshift.io/cluster-monitoring: "true" 1
      1
      이 네임스페이스에서 Operator가 권장하는 클러스터 모니터링을 사용하도록 하려면 openshift.io/cluster-monitoring 레이블을 설정합니다.
    2. 네임스페이스를 생성합니다.

      $ oc create -f <filename>.yaml

      예를 들면 다음과 같습니다.

      $ oc create -f update-service-namespace.yaml
  2. 다음 오브젝트를 생성하여 OpenShift Update Service Operator를 설치합니다.

    1. OperatorGroup 오브젝트 YAML 파일을 만듭니다 (예: update-service-operator-group.yaml).

      apiVersion: operators.coreos.com/v1
      kind: OperatorGroup
      metadata:
        name: update-service-operator-group
      spec:
        targetNamespaces:
        - openshift-update-service
    2. OperatorGroup 오브젝트를 생성합니다.

      $ oc -n openshift-update-service create -f <filename>.yaml

      예를 들면 다음과 같습니다.

      $ oc -n openshift-update-service create -f update-service-operator-group.yaml
    3. Subscription 오브젝트 YAML 파일(예: update-service-subscription.yaml)을 생성합니다.

      서브스크립션의 예

      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: update-service-subscription
      spec:
        channel: v1
        installPlanApproval: "Automatic"
        source: "redhat-operators" 1
        sourceNamespace: "openshift-marketplace"
        name: "cincinnati-operator"

      1
      Operator를 제공하는 카탈로그 소스의 이름을 지정합니다. 사용자 정의 OLM(Operator Lifecycle Manager)을 사용하지 않는 클러스터의 경우 redhat-operators를 지정합니다. OpenShift Container Platform 클러스터가 제한된 네트워크(연결이 끊긴 클러스터)에 설치된 경우 OLM(Operator Lifecycle Manager)을 구성할 때 생성된 CatalogSource 오브젝트의 이름을 지정합니다.
    4. Subscription 오브젝트를 생성합니다.

      $ oc create -f <filename>.yaml

      예를 들면 다음과 같습니다.

      $ oc -n openshift-update-service create -f update-service-subscription.yaml

      OpenShift Update Service Operator는 openshift-update-service 네임스페이스에 설치되고 openshift-update-service 네임스페이스를 대상으로 합니다.

  3. Operator 설치를 확인합니다.

    $ oc -n openshift-update-service get clusterserviceversions

    출력 예

    NAME                             DISPLAY                    VERSION   REPLACES   PHASE
    update-service-operator.v4.6.0   OpenShift Update Service   4.6.0                Succeeded
    ...

    OpenShift Update Service Operator가 나열된 경우 설치에 성공한 것입니다. 버전 번호가 표시된 것과 다를 수 있습니다.