2.4.4.3. Pod nginx ポリシーの例

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

   apiVersion: policy.open-cluster-management.io/v1
   kind: Policy
   metadata:
     name: policy-pod
     namespace: open-cluster-management
   spec:
     complianceType: musthave
     remediationAction: inform
     namespaces:
       exclude: ["kube-*"]
       include: ["default"]
     object-templates:
       - complianceType: musthave
         objectDefinition:
           apiVersion: v1
           kind: Pod # nginx pod must exist
           metadata:
             name: nginx-pod
           spec:
             containers:
             - image: nginx:1.7.9
               name: nginx
               ports:
               - containerPort: 80
        ...

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