3.2.2. CLI を使用した OpenShift Update Service Operator のインストール
OpenShift CLI (oc) を使用して、OpenShift Update Service Operator をインストールできます。
手順
OpenShift Update Service Operator の namespace を作成します。
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
openshift.io/cluster-monitoringラベルを設定して、k この namespace で Operator が推奨するクラスターのモニターリングを有効にします。
namespace を作成します。
$ oc create -f <filename>.yaml以下に例を示します。
$ oc create -f update-service-namespace.yaml
以下のオブジェクトを作成して OpenShift Update Service Operator をインストールします。
OperatorGroupオブジェクト YAML ファイルを作成します (例:update-service-operator-group.yaml)。apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: update-service-operator-group spec: targetNamespaces: - openshift-update-serviceOperatorGroupオブジェクトを作成します。$ oc -n openshift-update-service create -f <filename>.yaml以下に例を示します。
$ oc -n openshift-update-service create -f update-service-operator-group.yamlSubscriptionオブジェクト YAML ファイルを作成します (例:update-service-subscription.yaml)。Subscription の例
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 を提供するカタログソースの名前を指定します。カスタム Operator Lifecycle Manager (OLM) を使用しないクラスターの場合には、
redhat-operatorsを指定します。OpenShift Container Platform クラスターが、非接続クラスターとも呼ばれるネットワークが制限された環境でインストールされている場合、Operator Lifecycle Manager (OLM) の設定時に作成されるCatalogSourceオブジェクトの名前を指定します。
Subscriptionオブジェクトを作成します。$ oc create -f <filename>.yaml以下に例を示します。
$ oc -n openshift-update-service create -f update-service-subscription.yamlOpenShift Update Service Operator は
openshift-update-servicenamespace にインストールされ、openshift-update-servicenamespace をターゲットにします。
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 が記載されている場合には、インストールが成功しています。バージョン番号が表示されるものと異なる場合があります。