> For the complete documentation index, see [llms.txt](https://docs.duplocloud.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duplocloud.com/docs/automation-platform/overview-2/azure-services/agent-pool/spot-instances-for-aks-agent-pools.md).

# Spot Instances for AKS Agent Pools

Spot Instances in AKS are discounted VMs that use Azure's spare capacity. This makes them a cost-effective strategy for running Kubernetes workloads. However, they can be evicted when Azure needs the resources back, so they're best for fault-tolerant tasks that are resilient to interruptions.

## Creating Agent Pools with Spot Instances

1. Follow the steps to [add an agent pool](/docs/automation-platform/overview-2/azure-services/agent-pool.md#adding-an-agent-pool).
2. On the **Add Azure Agent Pool** page, select **Spot** from the **Scale Set Priority** list box.

<figure><img src="/files/Kji6agVMEEaQsEINg7KE" alt=""><figcaption><p>The <strong>Add Azure Agent Pool</strong> page</p></figcaption></figure>

3. In the **Scale Set Eviction Policy** list box, specify how the virtual machines (VMs) should be managed when they need to be evicted due to capacity constraints or other reasons:

* **Delete**: When a VM is evicted, it is completely removed from the scale set and cannot be recovered. This option is typically used when you do not need to preserve the VM's state and prefer to free up resources immediately.
* **Deallocate**: The evicted VM is stopped and its resources are released, but its configuration and state are preserved and it can be restarted later. This is useful when you want to save the VM's state for potential future use.

3. In the **Spot Max Price** field, Specify the highest price you are willing to pay for a spot instance.

## Configuring a DuploCloud Service to use Spot Instances

When [adding](/docs/automation-platform/overview-2/azure-services/agent-pool.md#adding-an-agent-pool) or [editing](/docs/automation-platform/overview-2/azure-services/agent-pool.md#editing-an-agent-pool) a Service, select **Tolerate spot instances**.

<figure><img src="/files/jyxJPPiGU8bTTbaCV6hr" alt=""><figcaption><p>The <strong>Add Service</strong> page with <strong>Tolerate spot instances</strong> enabled</p></figcaption></figure>

Tolerations will be entered by default in the **Add Service** page, **Advanced Options, Other Container Config** field.

<figure><img src="/files/0PonGdPNTi7cWficewhb" alt=""><figcaption><p>The <strong>Add Service</strong> page, <strong>Advanced Options</strong>, with tolerations shown in the <strong>Other Container Config</strong> field</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.duplocloud.com/docs/automation-platform/overview-2/azure-services/agent-pool/spot-instances-for-aks-agent-pools.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.
