1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 18:06:55 +00:00
kyverno/test/cli/test-mutate/foreach/cumulativePatch/policies.yaml

27 lines
740 B
YAML
Raw Normal View History

apiVersion : kyverno.io/v1
kind: ClusterPolicy
metadata:
name: add-default-resources
annotations:
pod-policies.kyverno.io/autogen-controllers: "none"
spec:
background: false
rules:
- name: add-default-requests
match:
resources:
kinds:
- Pod
mutate:
foreach:
- list: "request.object.spec.containers"
patchesJson6902: |-
- path: /spec/containers/{{elementIndex}}/resources/requests/memory
op: add
value: "100Mi"
- list: "request.object.spec.containers"
patchesJson6902: |-
- path: /spec/containers/{{elementIndex}}/resources/requests/cpu
op: add
value: "100m"