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

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

策略实例示例

以下策略实例展示了策略定义生效的资源类型,parameters中的allowedFlexVolumes字段定义了允许的driver类型列表。

apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sPSPFlexVolumes
metadata:
  name: psp-flexvolume-drivers
spec:
  match:
    kinds:
      - apiGroups: [""]
        kinds: ["Pod"]
  parameters:
    allowedFlexVolumes: #[]
    - driver: "example/lvm"
    - driver: "example/cifs"
support.huaweicloud.com/usermanual-ucs/ucs_01_0227.html