<p>I'm looking to update manually with the command <strong>kubectl autoscale</strong> my maximum number of replicas for auto scaling. </p>

<p>however each time I run the command it creates a new hpa that fails to launch the pod why I don't know at all:(</p>

<p>Do you have an idea how i can update manually with kubectl my HPA ? </p>

<p><a href="https://gist.github.com/zyriuse75/e75a75dc447eeef9e8530f974b19c28a" rel="nofollow noreferrer">https://gist.github.com/zyriuse75/e75a75dc447eeef9e8530f974b19c28a</a></p>

<p>I think you are mixing two topics here, one is manually scale a pod (you can do it through a deployment applying <code>kubectl scale deploy {mydeploy} --replicas={#repl}</code>). In the other hand you have HPA (Horizontal Pod AutoScaler), in order to do this (HPA) you should have configured any app metrics provider system 
e.g: </p>

<ul>
<li><p>metrics server
<a href="https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/metrics-server" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/metrics-server</a></p></li>
<li><p>heapster (deprecated) <a href="https://github.com/kubernetes-retired/heapster" rel="nofollow noreferrer">https://github.com/kubernetes-retired/heapster</a> </p></li>
</ul>

<p>then you can create a HPA to handle your autoscaling, you can get more info on this link <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/</a></p>

<p>Once created you can patch your HPA or deleted it and create it again</p>

<p>kubectl delete hpa hpa-pod  -n ns-svc-cas</p>

<p>kubectl autoscale  hpa-pod  --min={#number} --max={#number} -n ns-svc-cas</p>

<p>easiest way</p>
