# Rollout-aware Automation

{% hint style="info" %}
Autoscaler version v1.0.32 or later is required.
{% endhint %}

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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.perfectscale.io/enable-automation/rollout-aware-automation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
