How-To: Initialize Radius Environments
Categories:
Radius Environments are prepared landing zones for applications that contain configuration and Recipes. To learn more visit the environments overview page.
Radius Environments can be setup with the rad CLI via two paths: interactive or manual.
Pre-requisites
Create a development environment
-
Initialize a new Radius Environment with
rad init:rad initSelect
Yesto setup the application in the current directory. This will createapp.bicepandbicepconfig.jsonfilesInitializing Radius... 🕔 Install Radius v0.52 - Kubernetes cluster: kind - Kubernetes namespace: radius-system ⏳ Create new environment default - Kubernetes namespace: default - Recipe pack: local-dev ⏳ Scaffold application ⏳ Update local configuration -
Verify the initialization by running:
kubectl get deployments -n radius-systemYou should see:
NAME READY UP-TO-DATE AVAILABLE AGE ucp 1/1 1 1 53s appcore-rp 1/1 1 1 53s bicep-de 1/1 1 1 53s contour-contour 1/1 1 1 46sYou can also use
rad env listto view your environment:rad env list -
Use
rad recipe listto see the list of available Recipes:rad recipe listNAME TYPE TEMPLATE KIND TEMPLATE default Applications.Datastores/mongoDatabases bicep ghcr.io/radius-project/recipes/local-dev/mongodatabases:latest default Applications.Datastores/redisCaches bicep ghcr.io/radius-project/recipes/local-dev/rediscaches:latestYou can follow the Recipes documentation to learn more about the Recipes and how to use them in your application.
Create an environment interactively
-
Initialize a new environment with
rad init --full:rad init --full -
Follow the prompts, specifying:
- Namespace - The Kubernetes namespace where your application containers and networking resources will be deployed (different than the Radius control-plane namespace,
radius-system) - Azure provider (optional) - Allows you to deploy and manage Azure resources
- AWS provider (optional) - Allows you to deploy and manage AWS resources
- Environment name - The name of the environment to create
You should see the following output:
Initializing Radius... ✅ Install Radius v0.52 - Kubernetes cluster: k3d-k3s-default - Kubernetes namespace: radius-system ✅ Create new environment default - Kubernetes namespace: default - Recipe pack: dev ✅ Scaffold application samples ✅ Update local configuration Initialization complete! Have a RAD time 😎 - Namespace - The Kubernetes namespace where your application containers and networking resources will be deployed (different than the Radius control-plane namespace,
-
Verify the Radius services were installed by running:
kubectl get deployments -n radius-systemYou should see:
NAME READY UP-TO-DATE AVAILABLE AGE ucp 1/1 1 1 2m56s appcore-rp 1/1 1 1 2m56s bicep-de 1/1 1 1 2m56s contour-contour 1/1 1 1 2m33s -
Verify an environment was created with
rad env show:rad env show -o jsonYou should see your new environment:
{ "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/environments/default", "location": "global", "name": "default", "properties": { "compute": { "kind": "kubernetes", "namespace": "default" }, "provisioningState": "Succeeded", "recipes": {} } }, "systemData": {}, "tags": {}, "type": "Applications.Core/environments" }
Create an environment manually (advanced)
Radius can also be installed and an environment created with manual rad CLI commands. This is useful for pipelines or scripts that need to install and manage Radius.
-
Install Radius onto a Kubernetes cluster:
Run
rad install kubernetesto install Radius into your default Kubernetes context and cluster:rad install kubernetesYou should see the following message:
Installing Radius version 2134e8e to namespace: radius-system... -
Create a new Radius resource group:
Radius resource groups are used to organize Radius resources such as applications, environments, portable resources, and routes. Run
rad group createto create a new resource group:rad group create myGroupYou should see the following message:
creating resource group "myGroup" in workspace ""... resource group "myGroup" created -
Create your Radius Environment:
Run
rad env createto create a new environment in your resource group. Specify the--namespaceflag to select the Kubernetes namespace to deploy resources into:rad env create myEnvironment --group myGroup --namespace my-namespaceYou should see your Radius Environment being created and linked to your resource group:
Creating Environment... Successfully created environment "myEnvironment" in resource group "myGroup" -
Verify the initialization by running:
kubectl get deployments -n radius-systemYou should see:
NAME READY UP-TO-DATE AVAILABLE AGE ucp 1/1 1 1 2m56s appcore-rp 1/1 1 1 2m56s bicep-de 1/1 1 1 2m56s contour-contour 1/1 1 1 2m33sYou can also use
rad env listto see if the created environment gets listed:rad env list --group myGroupYou should see:
NAME myEnvironment
Next steps
Follow the cloud provider guides to configure cloud providers for your environment to deploy and manage cloud resources.
Feedback
Was this page helpful?
Glad to hear it! Please feel free to star our repo and join our Discord server to stay up to date with the project.
Sorry to hear that. If you would like to also contribute a suggestion visit and tell us how we can improve.