mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
32 lines
812 B
YAML
32 lines
812 B
YAML
apiVersion: kyverno.io/v1alpha1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: policy-hpa
|
|
spec :
|
|
rules:
|
|
- name: hpa1
|
|
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
|