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