4.16.8. ポリシーセットを使用した Red Hat OpenShift Platform Plus のインストール


Red Hat Openshift Platform Plus ポリシーセットを適用するためのガイダンスは、引き続きお読みください。Red Hat OpenShift ポリシーセットを適用すると、Red Hat Advanced Cluster Security で保護されたクラスターサービスと Compliance Operator がすべての OpenShift Container Platform マネージドクラスターにデプロイされます。

4.16.8.1. 前提条件

ポリシーセットを適用する前に、次の手順を完了してください。

  1. サブスクリプションをクラスターに適用できるようにするには、policy-configure-subscription-admin-hub.yaml ポリシーを適用し、修復アクションを enforce に設定する必要があります。次の YAML をコピーして、コンソールの YAML エディターに貼り付けます。

    apiVersion: policy.open-cluster-management.io/v1
    kind: Policy
    metadata:
      name: policy-configure-subscription-admin-hub
      annotations:
        policy.open-cluster-management.io/standards: NIST SP 800-53
        policy.open-cluster-management.io/categories: CM Configuration Management
        policy.open-cluster-management.io/controls: CM-2 Baseline Configuration
    spec:
      remediationAction: inform
      disabled: false
      policy-templates:
        - objectDefinition:
            apiVersion: policy.open-cluster-management.io/v1
            kind: ConfigurationPolicy
            metadata:
              name: policy-configure-subscription-admin-hub
            spec:
              remediationAction: inform
              severity: low
              object-templates:
                - complianceType: musthave
                  objectDefinition:
                    apiVersion: rbac.authorization.k8s.io/v1
                    kind: ClusterRole
                    metadata:
                      name: open-cluster-management:subscription-admin
                    rules:
                    - apiGroups:
                      - app.k8s.io
                      resources:
                      - applications
                      verbs:
                      - '*'
                    - apiGroups:
                      - apps.open-cluster-management.io
                      resources:
                      - '*'
                      verbs:
                      - '*'
                    - apiGroups:
                      - ""
                      resources:
                      - configmaps
                      - secrets
                      - namespaces
                      verbs:
                      - '*'
                - complianceType: musthave
                  objectDefinition:
                    apiVersion: rbac.authorization.k8s.io/v1
                    kind: ClusterRoleBinding
                    metadata:
                      name: open-cluster-management:subscription-admin
                    roleRef:
                      apiGroup: rbac.authorization.k8s.io
                      kind: ClusterRole
                      name: open-cluster-management:subscription-admin
                    subjects:
                    - apiGroup: rbac.authorization.k8s.io
                      kind: User
                      name: kube:admin
                    - apiGroup: rbac.authorization.k8s.io
                      kind: User
                      name: system:admin
    ---
    apiVersion: policy.open-cluster-management.io/v1
    kind: PlacementBinding
    metadata:
      name: binding-policy-configure-subscription-admin-hub
    placementRef:
      name: placement-policy-configure-subscription-admin-hub
      kind: Placement
      apiGroup: cluster.open-cluster-management.io
    subjects:
    - name: policy-configure-subscription-admin-hub
      kind: Policy
      apiGroup: policy.open-cluster-management.io
    ---
    apiVersion: cluster.open-cluster-management.io/v1beta1
    kind: Placement
    metadata:
      name: placement-policy-configure-subscription-admin-hub
    spec:
      predicates:
      - requiredClusterSelector:
          labelSelector:
            matchExpressions:
            - {key: name, operator: In, values: ["local-cluster"]}
        tolerations:
            - key: cluster.open-cluster-management.io/unavailable
              operator: Exists
            - key: cluster.open-cluster-management.io/unreachable
              operator: Exists
  2. コマンドラインインターフェイスから以前の YAML を適用するには、以下のコマンドを実行します。

    oc apply -f policy-configure-subscription-admin-hub.yaml
  3. Policy Generator kustomize プラグインをインストールします。Kustomize v4.5 以降を使用してください。Operator をインストールするためのポリシーの生成 を参照してください。
  4. ポリシーは policies namespace にインストールされます。その namespace を ClusterSet にバインドする必要があります。たとえば、以下のサンプル YAML をコピーして適用し、namespace をデフォルトの ClusterSet にバインドします。

    apiVersion: cluster.open-cluster-management.io/v1beta2
    kind: ManagedClusterSetBinding
    metadata:
        name: default
        namespace: policies
    spec:
        clusterSet: default
  5. 次のコマンドを実行して、コマンドラインインターフェイスから ManagedClusterSetBinding リソースを適用します。

    oc apply -f managed-cluster.yaml

前提条件を満たしたら、ポリシーセットを適用できます。

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る