1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 08:26:53 +00:00
kyverno/test/HorizontalPodAutoscaler/policy-hpa.yaml

33 lines
805 B
YAML
Raw Normal View History

2019-05-21 18:38:52 -07:00
apiVersion: kyverno.io/v1alpha1
kind: Policy
metadata:
name: policy-hpa
spec :
rules:
- name: hpa1
2019-07-25 14:57:44 -04:00
match:
resources:
kinds :
- HorizontalPodAutoscaler
selector:
matchLabels:
originalLabel: isHere
mutate:
patches:
- path: "/metadata/labels/isMutated"
op: add
value: "true"
- op: replace
path: "/spec/metrics/1/resource/targetAverageValue"
value: "959Mi"
validate:
message: "There is wrong resorce request or apiVersion"
pattern:
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
# metrics:
# - type: Resource
# resource:
# name: cpu|memory