How to use other container platforms

Learn how to use other container platforms using Recipe Packs

In Radius, every resource in an application is deployed through a recipe, including the application’s containers. A container is modeled with the Radius.Compute/containers Resource Type, and just like a database or a message queue, Radius provisions it by running the recipe that the Environment’s Recipe Pack maps to that Resource Type. Because the container recipe is customizable like any other recipe, you control which platform your containers run on by choosing the Recipe Pack, without changing the application definition.

The default Recipe Pack deploys containers to Kubernetes

Out of the box, Radius comes configured with a default Recipe Pack that deploys every resource, including containers, to Kubernetes. When you install Radius with rad initialize, the Kubernetes Recipe Pack is assigned to the default Environment, so Radius.Compute/containers resources run as Kubernetes Deployments with no additional configuration. The same pack also provides recipes for the other Resource Types, such as databases and caches, so a newly installed Radius can deploy a complete application to Kubernetes immediately.

Because the container recipe is defined in a Recipe Pack like every other recipe, you can change where containers run by assigning an alternative Recipe Pack whose Radius.Compute/containers recipe targets a different platform.

Use an alternative container platform

To run containers on a platform other than Kubernetes, assign the Environment a Recipe Pack whose Radius.Compute/containers recipe provisions the container on that platform. The Radius community maintains Recipe Packs for several platforms, or you can author your own by following How to manage Recipe Packs.

Because each Resource Type can have only one recipe across the Recipe Packs assigned to an Environment, assigning a pack that provides a Radius.Compute/containers recipe replaces the default Kubernetes container recipe. Application definitions do not change: the same Radius.Compute/containers resource deploys to the new platform.

The rest of this guide walks through the azure-aci Recipe Pack, which deploys containers to Azure Container Instances (ACI).

Example: deploy containers to Azure Container Instances

The azure-aci Recipe Pack provisions Radius.Compute/containers on Azure Container Instances, along with the Radius.Compute/persistentVolumes and Radius.Security/secrets those containers use, backed by Azure Files and Azure Key Vault. For more information on the platform itself, consult the Azure Container Instances documentation. To see exactly how these resources are provisioned, review the ACI recipes in resource-types-contrib.

Prerequisites

The ACI recipes provision Azure resources, so before you use the pack you need:

Deploy the ACI Recipe Pack

The azure-aci Recipe Pack is maintained in the resource-types-contrib repository, where it is defined as a single Radius.Core/recipePacks resource that maps each Resource Type to its published ACI recipe. Deploy the pack directly from its URL. rad deploy resolves and deploys remote Bicep templates, so you do not need to clone the repository or author the file locally:

rad deploy https://raw.githubusercontent.com/radius-project/resource-types-contrib/main/recipe-packs/azure-aci/azure-aci.bicep

This creates the azure-aci Recipe Pack in the Radius control plane. To review the exact recipes and source versions the pack wires together, open azure-aci.bicep.

Assign the Recipe Pack to your Environment

Assign the azure-aci Recipe Pack to your Azure-configured Environment. This replaces the container recipe so subsequent deployments run containers on ACI:

rad environment update <environment-name> \
  --recipe-packs azure-aci \
  --preview

The azure-aci pack covers only Radius.Compute/containers, Radius.Compute/persistentVolumes, and Radius.Security/secrets, so assign it alongside any additional Recipe Packs that provide the other Resource Types your applications use, such as a data Recipe Pack:

rad environment update <environment-name> \
  --recipe-packs azure-aci,data-recipes \
  --preview

Deploy an application

Deploy an application to the Environment as you normally would:

rad deploy app.bicep

Its Radius.Compute/containers resources now run on Azure Container Instances instead of Kubernetes. The application definition is unchanged: only the Recipe Pack assigned to the Environment determines where the containers run.

Next steps

Now that you can target other container platforms, learn how to manage Workspaces.

Next step: How to manage Workspaces