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

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

策略实例示例

以下策略实例展示了策略定义生效的资源类型,parameters中定义了allowedCapabilities和requiredDropCapabilities的列表。

apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sPSPCapabilities
metadata:
  name: capabilities-demo
spec:
  match:
    kinds:
      - apiGroups: [""]
        kinds: ["Pod"]
    namespaces:
      - "default"
  parameters:
    allowedCapabilities: ["something"]
    requiredDropCapabilities: ["must_drop"]
support.huaweicloud.com/usermanual-ucs/ucs_01_0228.html