Skip to content

Latest commit

 

History

History
72 lines (57 loc) · 7.11 KB

File metadata and controls

72 lines (57 loc) · 7.11 KB

Overview

The Radius.Compute/containers Resource Type is the primary resource type for running one or more containers. It is always part of a Radius Application. It is analogous to a Kubernetes Deployment. The schema in the Resource Type definition is heavily biased towards Kubernetes Pods and Deployments but is designed with the intention of supporting Recipes for AWS ECS, Azure Container Apps, Azure Container Instances, and Google Cloud Run in the fullness of time.

Developer documentation is embedded in the Resource Type definition YAML file. Developer documentation is accessible via rad resource-type show Radius.Compute/containers.

Recipes

A list of available Recipes for this Resource Type, including links to the Bicep and Terraform templates:

Platform IaC Language Recipe Name Stage
TODO TODO TODO Alpha

Recipe Input Properties

Radius Property Kubernetes Property
context.resource.properties.containers PodSpec.containers
context.resource.properties.containers.image PodSpec.containers.image
context.resource.properties.containers.cmd PodSpec.containers.cmd
context.resource.properties.containers.args PodSpec.containers.args
context.resource.properties.containers.env PodSpec.containers.env
context.resource.properties.containers.env.value PodSpec.containers.env.value
context.resource.properties.containers.env.valueFrom.secretKeyRef PodSpec.containers.env.valueFrom.secretKeyRef
context.resource.properties.containers.env.valueFrom.secretKeyRef.secretName N/A (Radius Secret)
context.resource.properties.containers.env.valueFrom.secretKeyRef.key N/A (Radius Secret)
context.resource.properties.containers.workingDir PodSpec.containers.workingDir
context.resource.properties.containers.resources.requests.cpu PodSpec.containers.resources.requests.cpu
context.resource.properties.containers.resources.requests.memoryInMib PodSpec.containers.resources.requests.memory
context.resource.properties.containers.resources.limits.cpu PodSpec.containers.resources.limits.cpu
context.resource.properties.containers.resources.limits.memoryInMib PodSpec.containers.resources.limits.memory
context.resource.properties.containers.ports.* PodSpec.containers.ports.*
context.resource.properties.containers.volumeMounts PodSpec.containers.volumeMounts
context.resource.properties.containers.volumeMounts.volumeName PodSpec.containers.volumeMounts.name
context.resource.properties.containers.volumeMounts.mountPath PodSpec.containers.volumeMounts.mountPath
context.resource.properties.containers.readinessProbe.* PodSpec.containers.readinessProbe.*
context.resource.properties.containers.livenessProbe.* PodSpec.containers.livenessProbe.*
context.resource.properties.initContainers (same as containers) PodSpec.initContainers (same as containers)
context.resource.properties.volumes PodSpec.volumes
context.resource.properties.volumes.persistentVolume PersistentVolumeClaim
context.resource.properties.volumes.persistentVolume.resourceId N/A (Radius PersistentVolume)
context.resource.properties.volumes.persistentVolume.accessMode PersistentVolumeClaim.accessModes
context.resource.properties.volumes.secretName N/A (Radius Secret)
context.resource.properties.volumes.emptyDir PodSpec.volumes.emptyDir
context.resource.properties.restartPolicy PodSpec.restartPolicy
context.resource.properties.replicas DeploymentSpec.replicas
context.resource.properties.autoScaling.* HorizontalPodAutoscalerSpec.*
context.resource.properties.extensions Dapr extension for Radius
context.resource.properties.platformOptions Kubernetes Deployment and Pod override properties

Connections and secrets

For ordinary connections, the Kubernetes Recipes preserve the existing behavior of injecting scalar metadata from context.resource.connections.<name> and values from context.resource.connections.<name>.properties as CONNECTION_<CONNECTION-NAME>_<PROPERTY-NAME> environment variables. When a producer Recipe returns secrets, Radius supplies reference metadata under context.resource.connections.<name>.secrets; the same connection injects each secret through a Kubernetes secretKeyRef. For example, Redis connection redis supplies its ordinary host and port values together with the secret-backed CONNECTION_REDIS_URL.

Direct connections to user-authored Radius.Security/secrets resources remain supported and inject one secret-backed variable per data key. Both regular and init containers receive generated variables. Explicit container environment variables take precedence, managed secret references take precedence over ordinary properties with the same generated name, and disableDefaultEnvVars: true disables both ordinary and secret-backed variables for that connection.

Connection names, property names, and secret names are uppercased when generating environment variable names. Secret names that collide after uppercasing are rejected. Direct Secret connections now fully uppercase the generated variable name, including the data key; this intentionally replaces the previous envFrom behavior, which preserved the Secret data key's casing after the uppercase connection prefix. The Kubernetes Secret name is derived from the final segment of each full Radius Secret resource ID. Secret values remain in Kubernetes references and are never copied into Recipe output or plaintext container configuration.

The Azure ACI Recipe is unchanged and does not consume the Kubernetes secret reference metadata described above.

Note: The Azure ACI recipe does not support context.resource.properties.extensions.daprSidecar and ignores Dapr sidecar configuration provided through extensions. Note: The Azure ACI recipe does not support context.resource.properties.replicas or context.resource.properties.autoScaling.*; scaling is controlled by recipe-specific parameters (desiredCount and maintainDesiredCount). Note: The Azure ACI recipe does not support context.resource.properties.containers.args or context.resource.properties.containers.workingDir; args are only used by merging into the ACI command array, and workingDir is ignored. Note: The Azure ACI recipe accepts an optional allowPlatformOptions parameter (default true). When set to false, the recipe ignores all context.resource.properties.platformOptions values. Note: The Azure ACI recipe always deploys to resourceGroup().location; context.resource.properties.platformOptions.location is not supported and is ignored.

Recipe Output Properties

Radius Property Kubernetes Property Notes
context.resource.properties.hosts Service in-cluster DNS names Read-only. Map of container name to that container's Kubernetes Service DNS name (<container-resource-name>-<container-name>.<namespace>). The name is cluster-domain-independent, so it resolves regardless of the cluster's configured DNS domain. Populated for every container that exposes a port, so a multi-container resource publishes all of its Service hosts. Peers reference <peer>.properties.hosts.<containerName>.