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

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

策略实例示例

必须配置内存的Limit,CPU和内存的Request。

apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sRequiredResources
metadata:
  name: container-must-have-cpu-requests-memory-limits-and-requests
spec:
  match:
    kinds:
      - apiGroups: [""]
        kinds: ["Pod"]
  parameters:
    limits:
      - memory
    requests:
      - cpu
      - memory
support.huaweicloud.com/usermanual-ucs/ucs_01_0240.html