github.com/oam-dev/kubevela@v1.9.11/references/docgen/def-doc/trait/hpa.eg.md (about) 1 ```yaml 2 apiVersion: core.oam.dev/v1beta1 3 kind: Application 4 metadata: 5 name: helloworld 6 spec: 7 components: 8 - name: helloworld 9 type: webservice 10 properties: 11 cpu: "0.5" 12 exposeType: ClusterIP 13 image: oamdev/hello-world 14 memory: 1024Mi 15 ports: 16 - expose: true 17 port: 80 18 protocol: TCP 19 traits: 20 - type: scaler 21 properties: 22 replicas: 1 23 - type: hpa 24 properties: 25 targetAPIVersion: apps/v1 26 targetKind: Deployment 27 max: 10 28 min: 1 29 cpu: 30 type: Utilization 31 value: 80 32 mem: 33 type: AverageValue 34 value: 90 35 podCustomMetrics: 36 # here are custom metric names and values. Please replace them to be your metrics 37 - name: pod_net_received_rate 38 value: "77" 39 - name: pod_net_transmitted_rate 40 value: "88" 41 - name: pod_net_received_packets_rate 42 value: "95" 43 - name: pod_net_transmitted_packets_rate 44 value: "99" 45 policies: 46 - name: apply-once 47 type: apply-once 48 properties: 49 enable: true 50 rules: 51 - strategy: 52 path: ["spec.replicas"] 53 selector: 54 resourceTypes: ["Deployment","StatefulSet"] 55 ```