Actions86
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
- Environment Actions
- Image Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Setting Actions
- Stack Actions
- System Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
Service → Scale
AI-generatedOverview
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
- Scaling a Docker Swarm service to 5 replicas to handle increased traffic.
- 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
- Docker Swarm Service Scaling - Official Docker documentation on how to scale services in Docker Swarm.
- Portainer API Service Update - Portainer API documentation for updating (scaling) a Docker Swarm service.