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?
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/ and the Kubernetes documentation about it is here https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/