Portainer icon

Portainer

Work with Portainer API data to manage Docker

Service → Scale

AI-generated

Overview

This node operation allows scaling a Docker Swarm service managed via Portainer by adjusting the number of replicas for the service. It is useful in scenarios where you need to increase or decrease the number of service instances to handle varying loads or optimize resource usage. For example, scaling a web service up during high traffic periods or scaling down during low usage times.

Use Case Examples

  1. Scaling a Docker Swarm service to 5 replicas to handle increased traffic.
  2. Reducing the number of replicas of a service to save resources during off-peak hours.

Properties

Name Meaning
Environment ID The ID of the environment/endpoint in Portainer where the Docker Swarm service is running.
Service ID The ID of the Docker Swarm service to scale.
Replicas The desired number of replicas for the service.
Version The object version for the update operation, used for concurrency control.
Request Options Additional request options such as batching, SSL certificate validation, proxy settings, and timeout configuration.

Output

JSON

  • body - The JSON response body from the Portainer API after scaling the service, typically containing the updated service details or status.

Dependencies

  • Portainer API with an API key credential for authentication

Troubleshooting

  • Ensure the Environment ID and Service ID are correct and correspond to existing resources in Portainer.
  • Verify that the Version number matches the current version of the service object to avoid update conflicts.
  • Check network connectivity and proxy settings if requests fail to reach the Portainer API.
  • If SSL certificate validation fails, consider enabling the option to ignore SSL issues, but be aware of security implications.

Links

Discussion