Beyond specifying models, other configuration options can be set in the
Providing Predictive Configuration
Predictive Configuration is provided through environment variables, which can be supplied through the Custom Pod Autoscaler YAML shorthand:
apiVersion: custompodautoscaler.com/v1alpha1 kind: CustomPodAutoscaler metadata: name: simple-linear-example spec: template: spec: containers: - name: simple-linear-example image: jthomperoo/predictive-horizontal-pod-autoscaler:latest imagePullPolicy: Always scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: php-apache config: - name: minReplicas value: "1" - name: maxReplicas value: "5" - name: predictiveConfig value: | models: - type: Linear name: LinearPrediction perInterval: 1 linear: lookAhead: 10000 storedValues: 6 decisionType: "maximum" metrics: - type: Resource resource: name: cpu target: averageUtilization: 50 type: Utilization - name: interval value: "10000"
The predictiveConfig is provided through this environment variable, and represented in YAML:
- name: predictiveConfig value: | models: - type: Linear name: LinearPrediction perInterval: 1 linear: lookAhead: 10000 storedValues: 6 decisionType: "maximum"
- maximum - pick the highest evaluation of the models.
- minimum - pick the lowest evaluation of the models.
- mean - calculate the mean number of replicas between the models.
- median - calculate the median number of replicas between the models.
Decider on which evaluation to pick if there are multiple models provided.
The path to store the SQLite3 database, e.g. for storing the DB in a volume to persist it.
The path of the SQL migrations for the SQLite3 database.
List of statistical models to apply.
See the models section for details.
List of metrics to target for evaluating replica counts.
See the metrics section for details.
300 (5 minutes).
Set in seconds.
--horizontal-pod-autoscaler-cpu-initialization-period; the period after pod start when CPU samples might be skipped.
30 (30 seconds).
Set in seconds.
--horizontal-pod-autoscaler-initial-readiness-delay; the period after pod start during which readiness changes will be treated as initial readiness.
--horizontal-pod-autoscaler-tolerance; the minimum change (from 1.0) in the desired-to-actual metrics ratio for the horizontal pod autoscaler to consider scaling.