检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
参数: probes:数组 probeTypes:数组 作用 要求Pod具有Readiness或Liveness Probe。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters展示了probes的类型和probeTypes。 apiVersion: constraints
requiredDropCapabilities:数组 作用 限制PodSecurityPolicy中的“allowedCapabilities”和“requiredDropCapabilities”字段。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中定义了al
生效资源类型:Service 参数: allowedIPs:字符串数组 作用 限制服务externalIP仅为允许的IP地址列表。 策略实例示例 服务的externalIP仅允许allowedIPs中定义的IP。 apiVersion: constraints.gatekeeper
exemptImages:字符串数组 procMount:字符串 作用 约束PodSecurityPolicy中的“allowedProcMountTypes”字段。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中指定了procMount的值为Default。 apiVersion:
推荐级别:L1 生效资源类型:Pod 参数: tags:字符串数组 exemptImages:字符串数组 作用 约束容器镜像tag。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,pararmeters中表示不允许容器镜像tag为latest。 apiVersion: constraints
forbiddenSysctls:数组 作用 约束PodSecurityPolicy中的“sysctls”字段不能使用的name。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中的forbiddenSysctls定义了sysctls中不能允许的名称。 apiVersion:
min: 整型 max: 整型 作用 约束PodSecurityPolicy中的runAsUser、runAsGroup、supplementalGroups和fsGroup字段。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中定义了对r
[A-Za-z]{2,6}|[a-z]{1,39})$ 作用 要求资源包含指定的标签,其值与提供的正则表达式匹配。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中指定了提示信息message以及label的约束定义。 apiVersion: constraints
min_replicas: 整型 max_replicas: 整型 作用 要求具有“spec.replicas”字段的对象(Deployments、ReplicaSets等)在定义的范围内。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters定义范围为3到50。 apiVersion:
pathPrefix: 字符串 作用 约束PodSecurityPolicy中的“hostPath”字段的参数。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中的allowedHostPaths指定了字段的值。 apiVersion: constraints
基本信息 策略类型:合规 推荐级别:L1 生效资源类型:ClusterRole 参数:无 作用 默认情况下,许多Kubernetes都预定义了一个名为system:aggregate-to-edit的ClusterRole,k8sblockendpointeditdefaultrole
allowedRoles:字符串数组 作用 不允许将白名单以外的ClusterRole和Role关联到system:anonymous User和system:unauthenticated Group。 策略实例示例 示例展示了ClusterRole和Role资源仅能关联到allowedRoles中定义的Role。
allowedFlexVolumes:数组 作用 约束PodSecurityPolicy中的allowedFlexVolumes字段类型。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中的allowedFlexVolumes字段定义了允许的driver类型列表。 apiVersion:
allowedProfiles:数组 exemptImages:字符串数组 作用 约束AppArmor字段列表。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters的allowedProfiles字段定义了允许的值列表。 apiVersion: constraints.gatekeeper
runtime/default - docker/default 符合策略实例的资源定义 示例中的container.seccomp.security.alpha.kubernetes.io/nginx注解的value在设定的值列表中,符合策略定义。 apiVersion: v1 kind:
allowedGroups:数组 allowedUsers:数组 作用 拒绝白名单外的资源更新ServiceAccount。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,pararmeters中定义了允许的组列表allowedGroups和允许的用户列表allowedUsers。 # IMPORTANT:
串对象 exemptImages:字符串数组 作用 约束Pod定义SELinux配置的允许列表。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中的allowedSELinuxOptions定义了参数的允许列表。 apiVersion: constraints
ratio:字符串 cpuRatio:字符串 exemptImages:字符串数组 作用 限制容器的limit对request比例的最大值。 策略实例示例 限制容器的limit对request比例的最大值为1,cpu的limit对request比例最大值为10。 apiVersion: constraints
ss 基本信息 策略类型:合规 推荐级别:L1 生效资源类型:Ingress 参数:无 作用 禁止ingress配置空白或通配符类型的hostname。 策略实例示例 示例展示了该策略定义的生效类型。 apiVersion: constraints.gatekeeper.sh/v1beta1
生效资源类型:Pod 参数: volumes:数组 作用 约束PodSecurityPolicy中的“volumes”字段类型。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters的volumes字段定义了允许的类型列表。 apiVersion: constraints