This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.12.3. 策略对象示例
下面的例子演示了几个不同的策略配置。
在以下示例中,策略会防止 OpenShift Container Platform 使用指定的外部 IP 地址创建任何服务:
拒绝为 Service
spec.externalIPs[]
指定的任何值的策略示例Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在以下示例中,设置了
allowedCIDRs
和rejectedCIDRs
字段。包括允许和拒绝 CIDR 块的策略示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在以下示例中,
policy
被设置为null
。如果设为null
,则通过输入oc get network.config.openshift.io -o yaml
来检查配置对象时,policy
项不会出现在输出中。示例策略,允许为 Service
spec.externalIPs[]
指定的任何值Copy to Clipboard Copied! Toggle word wrap Toggle overflow