2.4.7.3. RoleBinding ポリシーの例

rolebinding ポリシーは以下の YAML ファイルのようになります。

   apiVersion: policy.open-cluster-management.io/v1
   kind: Policy
   metadata:
     name: policy-rolebinding
     namespace: open-cluster-management
   spec:
     complianceType: musthave
     remediationAction: inform
     namespaces:
       exclude: ["kube-*"]
       include: ["default"]
     object-templates:
       - complianceType: musthave
         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: rbac.authorization.k8s.io
           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
       ...

rolebinding ポリシー の管理方法の詳細は、「rolebinding ポリシーの管理」を 参照してください。他の設定ポリシーの詳細は、「Kubernetes 設定ポリシーコントローラー」を参照してください。他のポリシーの管理については、「セキュリティーポリシーの管理」を参照してください。