<pre class="lang-yaml prettyprint-override"><code>apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: busy-autoscaler
spec:
   behavior:
     scaleDown:
       stabilizationWindowSeconds: 10
       policies:
       - type: Percent
         value: 50
         periodSeconds: 15
   scaleTargetRef:
     apiVersion: apps/v1
     kind: Deployment
     name: busy-worker
   minReplicas: 1
   maxReplicas: 2
   metrics:
   - type: Resource
     resource:
       name: cpu
       target:
         type: Utilization
         averageUtilization: 50

</code></pre>

<blockquote>
  <p>error: error validating "hpa.yml": error validating data: ValidationError(HorizontalPodAutoscaler.spec): unknown field "behavior" in io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec; if you choose to ignore these errors, turn validation off with --validate=false</p>
</blockquote>

<pre class="lang-sh prettyprint-override"><code>$ kubectl version --short

Client Version: v1.18.0
Server Version: v1.14.9-eks-502bfb
</code></pre>

<p>you can check available fields by running:</p>

<pre><code>kubectl explain --api-version=autoscaling/v2beta2 HorizontalPodAutoscaler.spec
</code></pre>

<p>which are:
<a href="https://i.stack.imgur.com/N8oEf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/N8oEf.png" alt="enter image description here"></a></p>
