华为云UCS-k8scontainerratios:不符合策略实例的资源定义

时间:2025-01-26 10:49:46

不符合策略实例的资源定义

示例一:CPU比例为40,不符合约束。

apiVersion: v1kind: Podmetadata:  name: opa-disallowed  labels:    owner: me.agilebank.demospec:  containers:    - name: opa      image: openpolicyagent/opa:0.9.2      args:        - "run"        - "--server"        - "--addr=localhost:8080"      resources:        limits:          cpu: "4"          memory: "2Gi"        requests:          cpu: "100m"          memory: "2Gi"

示例二:内存比例为20,不符合约束。

apiVersion: v1kind: Podmetadata:  name: opa-disallowed  labels:    owner: me.agilebank.demospec:  containers:    - name: opa      image: openpolicyagent/opa:0.9.2      args:        - "run"        - "--server"        - "--addr=localhost:8080"      resources:        limits:          cpu: "800m"          memory: "2Gi"        requests:          cpu: "100m"          memory: "100Mi"
support.huaweicloud.com/usermanual-ucs/ucs_01_0241.html