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

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

策略实例示例

以下策略实例展示了策略定义生效的资源类型,parameters中hostNetwork为true时,使用的端口必须在指定的端口范围内。

apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sPSPHostNetworkingPorts
metadata:
  name: psp-host-network-ports
spec:
  match:
    kinds:
      - apiGroups: [""]
        kinds: ["Pod"]
  parameters:
    hostNetwork: bool
    min: 80
    max: 9000
support.huaweicloud.com/usermanual-ucs/ucs_01_0222.html