# Rollout-aware Automation

PerfectScale automatically detects your Argo Rollouts strategy, whether Blue-Green, Canary, or A/B, and aligns optimization with your deployment approach to ensure continuous feature delivery without compromising K8s efficiency or stability.

Rollout-aware automation enables instant, safe optimization across even the most advanced and diverse Kubernetes environments, ensuring your clusters stay stable and reliable.

## Automation behaviour policy for rollout ReplicaSets

The Automation behavior policy provides you control over the optimization process, enabling you to define how Automation should act if new recommendations arrive during an active rollout. This ensures that Automation consistently drives desired outcomes without contradicting the strategies you use to innovate and seamlessly deliver value.&#x20;

{% hint style="success" %}
Automation behavior settings can be configured at the cluster, namespace, or workload level.
{% endhint %}

To set the automation behavior policy when rollout is in the active phase, specify the desired policy in the Automation Configuration CR:

```yaml
apiVersion: perfectscale.io/v1
kind: ClusterAutomationConfig
metadata:
  name: cluster-automation-config
spec:
  automation:
    operational:
      duringRolloutInProgress: pause # A default behavior that prevents Automation from applying new recommendations when concurrent ReplicaSets are identified
    workloadTypes:
      Rollout:
        operational:
          automationMode: "Enabled" # Enables rollout support  
```

### Aggregate **ReplicaSets**

When the **merge** rollout Automation behaviour is set, PerfectScale calculates recommendations based on the merged utilization of all ReplicaSets with the same R1, and applies new recommendations for all the ReplicaSets of the same R1.

```yaml
duringRolloutInProgress: aggregate
```

### **Pause Automation**&#x20;

**Pause** (default) behavior prevents Automation from applying new recommendations when concurrent ReplicaSets are identified.&#x20;

```yaml
rolloutAutomationBehavior: pause
```

When `rolloutAutomationBehavior: pause` and multiple concurrent ReplicaSets are detected, Automation will not take any action, and a corresponding tooltip will be displayed:

{% hint style="warning" %}
**Automation Limited by User-Defined Rule**. Automation restricted: Resource changes are not allowed when multiple concurrent ReplicaSets are detected.
{% endhint %}
