<p>I've added some scaling policies to my <strong>HorizontalPodAutoscaler</strong> but they are not being applied. The <em>scaleUp</em> and <em>scaleDown</em> behaviours are being ignored. I need a way to stop pods scaling up and down every few minutes in response to small CPU spikes. Ideally the HPA would scale up quickly in response to more traffic but scale down slowly after about 30 minutes of reduced traffic.</p>

<p>I'm running this on an AWS EKS cluster and I have setup the policies according to <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior</a>.</p>

<p>Could this be a limitation of EKS or my K8s version which is 1.14. I have run <code>kubectl api-versions</code> and my cluster does support <em>autoscaling/v2beta2</em>.</p>

<p>My Helm spec is:</p>

<pre><code>apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: {{ template "app.fullname" . }}
  labels:
    app: {{ template "app.name" . }}
    chart: {{ template "app.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  scaleTargetRef:
    apiVersion: apps/v1beta2
    kind: Deployment
    name: "{{ template "app.fullname" . }}-server"
  minReplicas: {{ .Values.hpa.minReplicas }}
  maxReplicas: {{ .Values.hpa.maxReplicas }}
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: AverageValue
        averageValue: 200m
  behavior:
    scaleUp:
      stabilizationWindowSeconds: 300
      policies:
      - type: Pods
        value: 1
        periodSeconds: 300
    scaleDown:
      stabilizationWindowSeconds: 1200
      policies:
      - type: Pods
        value: 1
        periodSeconds: 300
</code></pre>

<p>As already discussed in the comments, even with <code>autoscaling/v2beta2</code> enabled this function will not work on version 1.14.</p>

<blockquote>
  <p>Starting from <strong>v1.18</strong> the v2beta2 API allows scaling behavior to be
  configured through the HPA behavior field.</p>
</blockquote>

<p>The easiest way out of it would be to upgrade to 1.18.</p>
