7.4. Security Profiles Operator の有効化

Security Profiles Operator を使用する前に、Operator がクラスターにデプロイされていることを確認する必要があります。

重要

Security Profiles Operator は、Red Hat Enterprise Linux CoreOS (RHCOS) ワーカーノードのみをサポートします。Red Hat Enterprise Linux (RHEL) ノードはサポートされていません。

重要

Security Profiles Operator は、x86_64 アーキテクチャーのみをサポートします。

7.4.1. Security Profiles Operator のインストール

前提条件

  • admin 権限がある。

手順

  1. OpenShift Container Platform Web コンソールで、OperatorsOperatorHub ページに移動します。
  2. Security Profiles Operator を検索し、Install をクリックします。
  3. Operator が openshift-security-profiles namespace にインストールされるように、Installation modenamespace のデフォルトの選択を維持します。
  4. Install をクリックします。

検証

インストールが正常に行われたことを確認するには、以下を実行します。

  1. OperatorsInstalled Operators ページに移動します。
  2. Security Profiles Operator が openshift-security-profiles namespace にインストールされ、そのステータスが Succeeded であることを確認します。

Operator が正常にインストールされていない場合、以下を実行します。

  1. OperatorsInstalled Operators ページに移動し、Status 列でエラーまたは失敗の有無を確認します。
  2. WorkloadsPods ページに移動し、openshift-security-profiles プロジェクトの Pod で問題を報告しているログの有無を確認します。

7.4.2. CLI を使用した Security Profiles Operator のインストール

前提条件

  • admin 権限がある。

手順

  1. Namespace オブジェクトを定義します。

    namespace-object.yaml の例

    apiVersion: v1
    kind: Namespace
    metadata:
        name: openshift-security-profiles
    labels:
      openshift.io/cluster-monitoring: "true"

  2. Namespace オブジェクトを作成します。

    $ oc create -f namespace-object.yaml
  3. OperatorGroup オブジェクトを定義します。

    operator-group-object.yaml の例

    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
      name: security-profiles-operator
      namespace: openshift-security-profiles

  4. OperatorGroup オブジェクトを作成します。

    $ oc create -f operator-group-object.yaml
  5. Subscription オブジェクトを定義します。

    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-marketplace

  6. Subscription オブジェクトを作成します。

    $ oc create -f subscription-object.yaml
注記

グローバルスケジューラー機能を設定して defaultNodeSelector を有効にする場合、namespace を手動で作成し、openshift-security-profiles namespace のアノテーション、または Security Profiles Operator がインストールされた namespace を openshift.io/node-selector: “” で更新する必要があります。これにより、デフォルトのノードセレクターが削除され、デプロイメントの失敗を防ぐことができます。

検証

  1. 次の CSV ファイルを調べて、インストールが成功したことを確認します。

    $ oc get csv -n openshift-security-profiles
  2. 次のコマンドを実行して、Security Profiles Operator が動作していることを確認します。

    $ oc get deploy -n openshift-security-profiles

7.4.3. ログの詳細度の設定

Security Profiles Operator は、デフォルトのロギング詳細度 0 と拡張詳細度 1 をサポートします。

手順

  • 強化されたロギングの詳細度を有効にするには、spod 設定にパッチを適用し、次のコマンドを実行して値を調整します。

    $ oc -n openshift-security-profiles patch spod \
        spod --type=merge -p '{"spec":{"verbosity":1}}'

    出力例

    securityprofilesoperatordaemon.security-profiles-operator.x-k8s.io/spod patched