2.4.7. RoleBinding ポリシー

Kubernetes 設定ポリシーコントローラーは、rolebinding ポリシーのステータスを監視します。Rolebinding ポリシーを適用し、ポリシーをマネージドクラスターの namespace にバインドします。以下のセクションでは namespace ポリシーの構成について説明します。

2.4.7.1. RoleBinding ポリシー YAML の構成

   apiVersion: policy.open-cluster-management.io/v1
   kind: Policy
   metadata:
     name:
     namespace:
   spec:
     complianceType:
     remediationAction:
     namespaces:
       exclude:
       include:
     object-templates:
       - complianceType:
         objectDefinition:
           kind: RoleBinding # role binding must exist
           apiVersion: rbac.authorization.k8s.io/v1
           metadata:
             name: operate-pods-rolebinding
           subjects:
           - kind: User
             name: admin # Name is case sensitive
             apiGroup:
           roleRef:
             kind: Role #this must be Role or ClusterRole
             name: operator # this must match the name of the Role or ClusterRole you wish to bind to
             apiGroup: rbac.authorization.k8s.io
       ...