apiVersion: autoscaling.crane.io/v1alpha1 kind: EffectiveHorizontalPodAutoscaler metadata: name: php-apache spec: # ScaleTargetRef is the reference to the workload that should be scaled. scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: php-apache minReplicas: 1 # MinReplicas is the lower limit replicas to the scale target which the autoscaler can scale down to. maxReplicas: 10 # MaxReplicas is the upper limit replicas to the scale target which the autoscaler can scale up to. scaleStrategy: Auto # ScaleStrategy indicate the strategy to scaling target, value can be "Auto" and "Preview". # Metrics contains the specifications for which to use to calculate the desired replica count. metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 50 # Prediction defines configurations for predict resources. # If unspecified, defaults don't enable prediction. prediction: predictionWindowSeconds: 3600 # PredictionWindowSeconds is the time window to predict metrics in the future. predictionAlgorithm: algorithmType: dsp dsp: sampleInterval: "60s" historyLength: "7d"