Scaling strategies differ for a stateful vs a stateless service. Currently, it is not possible to scale a Stateful Service automatically. A Scaling policy is applicable only for a stateless Service.
A Scaling Policy defines the CPU and Memory thresholds beyond which the Service must automatically scale up.
What are Replicas ?
Replicas are identical instances of a Service deployment. All the replicas carry the same set of configurations like Container definitions and Policies, except for the Persistent Volume mounts. In a stateful Service, each replica can mount the same static volume or a separate instance of a volume which is dynamically provisioned at the time of creating the replica.
The CPU and Memory consumption is the average consumption of all the replicas within a Service. For each replica, their utilisation is calculated as the average utilisation of all the sidecar containers within the Service.
Minimum Number of replicas to be maintained when a Service scales down.
Maximum Number of replicas that can be created when a Service scales up.
Steps to create a Scaling Policy
In the left panel, navigate to Service Policies and choose Scaling Policies
Click on Create new policy to open the creation wizard.
Choose the scaling attributes and click Create to create new policy.