# Scaling a service from the API

**URL:** <https://forums.suse.com/t/scaling-a-service-from-the-api/14809>\
**Category:** Rancher 1.x\
**Created:** [July 16, 2019, 9:43am UTC](https://forums.suse.com/t/scaling-a-service-from-the-api/14809 "2019-07-16T09:43:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amaraliou](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@amaraliou](https://forums.suse.com/u/amaraliou)\
**Post date:** [July 16, 2019, 9:43am UTC](https://forums.suse.com/t/scaling-a-service-from-the-api/14809/1 "2019-07-16T09:43:27Z")

</div>

In my team we use Rancher to take care of our docker containers. I am trying to write a script to fix a recurring problem that requires me to scale down and back up a given service. I am looking to do this with the API but I am having a hard time making it work. Anyone has any pointers to documentation/answers that might help?

---

<div class="post-metadata">

**Author:** ![catherineluse](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@catherineluse](https://forums.suse.com/u/catherineluse)\
**Post date:** [July 16, 2019, 10:25pm UTC](https://forums.suse.com/t/scaling-a-service-from-the-api/14809/2 "2019-07-16T22:25:08Z")

</div>

Hi,  
It sounds like you might want a horizontal pod autoscaler. Rancher has docs about it here [https://rancher.com/docs/rancher/v2.x/en/k8s-in-rancher/horitzontal-pod-autoscaler/](https://rancher.com/docs/rancher/v2.x/en/k8s-in-rancher/horitzontal-pod-autoscaler/) and the Kubernetes documentation about it is here [https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/)
