华为云UCS-k8spspautomountserviceaccounttokenpod:策略实例示例

时间:2024-09-12 15:06:02

策略实例示例

示例声明了match匹配的对象不能把automountServiceAccountToken字段设为true。

apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sPSPAutomountServiceAccountTokenPod
metadata:
  name: psp-automount-serviceaccount-token-pod
spec:
  match:
    kinds:
      - apiGroups: [""]
        kinds: ["Pod"]
    excludedNamespaces: ["kube-system"] 
support.huaweicloud.com/usermanual-ucs/ucs_01_0248.html