7.5.2. CLI を使用した Security Profiles Operator のインストール
前提条件
-
admin権限がある。
手順
Namespaceオブジェクトを定義します。namespace-object.yamlの例apiVersion: v1 kind: Namespace metadata: name: openshift-security-profiles labels: openshift.io/cluster-monitoring: "true"Namespaceオブジェクトを作成します。$ oc create -f namespace-object.yamlOperatorGroupオブジェクトを定義します。operator-group-object.yamlの例apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: security-profiles-operator namespace: openshift-security-profilesOperatorGroupオブジェクトを作成します。$ oc create -f operator-group-object.yamlSubscriptionオブジェクトを定義します。subscription-object.yamlの例apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: security-profiles-operator-sub namespace: openshift-security-profiles spec: channel: release-alpha-rhel-8 installPlanApproval: Automatic name: security-profiles-operator source: redhat-operators sourceNamespace: openshift-marketplaceSubscriptionオブジェクトを作成します。$ oc create -f subscription-object.yaml
グローバルスケジューラー機能を設定して defaultNodeSelector を有効にする場合、namespace を手動で作成し、openshift-security-profiles namespace のアノテーション、または Security Profiles Operator がインストールされた namespace を openshift.io/node-selector: “” で更新する必要があります。これにより、デフォルトのノードセレクターが削除され、デプロイメントの失敗を防ぐことができます。
検証
次の CSV ファイルを調べて、インストールが成功したことを確認します。
$ oc get csv -n openshift-security-profiles次のコマンドを実行して、Security Profiles Operator が動作していることを確認します。
$ oc get deploy -n openshift-security-profiles