Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting manual Radius Environment setup #619

Merged
merged 37 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5e8f8b0
Manual rad setup doc
jasonviviano Jun 14, 2023
cb2dcfd
Merge branch 'edge' into jasonviviano/rad-setup
jasonviviano Jun 23, 2023
296afaf
Updated environment page with environment creation steps
jasonviviano Jun 23, 2023
c56ef8b
Fixed bash output snippets
jasonviviano Jun 23, 2023
cdad539
Merge remote-tracking branch 'origin/edge' into jasonviviano/rad-setup
jasonviviano Jun 23, 2023
2ec0295
Fixed merge conflcit
jasonviviano Jun 23, 2023
a1d2341
Fixed PR
jasonviviano Jun 23, 2023
43d13f7
Fixed pages changed
jasonviviano Jun 23, 2023
d467bdd
Added back aws provider
jasonviviano Jun 23, 2023
02418e8
Fixed list view
jasonviviano Jun 23, 2023
e2662ff
Fixed list view again
jasonviviano Jun 23, 2023
e98035f
Merge branch 'edge' into jasonviviano/rad-setup
jasonviviano Jun 27, 2023
91abaff
Apply suggestions from code review
jasonviviano Jun 27, 2023
8eda33e
How-to:Radius environments
jasonviviano Jun 27, 2023
3412693
Fixed render
jasonviviano Jun 27, 2023
f36185e
Merge branch 'edge' into jasonviviano/rad-setup
jasonviviano Jun 27, 2023
57ffd8c
Update docs/content/operations/environments/howto-environment/index.md
jasonviviano Jun 28, 2023
8aefd30
Update docs/content/operations/environments/howto-environment/index.md
jasonviviano Jun 28, 2023
69333be
Added new info to the cloud provider sections
jasonviviano Jun 28, 2023
36776ca
Merge branch 'edge' into jasonviviano/rad-setup
jasonviviano Jun 28, 2023
77bd4b2
Changes to environment
jasonviviano Jul 21, 2023
c7467fa
Merge branch 'edge' into jasonviviano/rad-setup
jasonviviano Jul 21, 2023
aebb719
Changed structure of page
jasonviviano Jul 24, 2023
e6dd585
Merge branch 'edge' into jasonviviano/rad-setup
jasonviviano Jul 24, 2023
8a4d7a4
Apply suggestions from code review
jasonviviano Jul 25, 2023
4d1a617
Update index.md
jasonviviano Jul 25, 2023
66a41c9
Messed up the previous commit
jasonviviano Jul 25, 2023
8c6b337
Update docs/content/operations/environments/howto-environment/index.md
jasonviviano Jul 26, 2023
43975d0
Update docs/content/operations/environments/howto-environment/index.md
jasonviviano Jul 26, 2023
1c531b3
Merge branch 'edge' into jasonviviano/rad-setup
jasonviviano Aug 7, 2023
53e2e85
Reformatted howto-environment.md to have outputs demonstrated for adv…
jasonviviano Aug 7, 2023
08b4eff
Fixed spelling check issue
jasonviviano Aug 7, 2023
d60bd01
Apply suggestions from code review
jasonviviano Aug 7, 2023
042510a
Updated AWS prerequisites and steps
jasonviviano Aug 7, 2023
f9a16b7
Update docs/content/operations/environments/howto-environment/index.md
jasonviviano Aug 7, 2023
88d74e7
Update docs/content/operations/environments/howto-environment/index.md
jasonviviano Aug 7, 2023
1ab5e7d
Small formatting updates
AaronCrawfis Aug 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/operations/environments/_index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
type: docs
title: "Radius environments"
title: "Radius Environments"
linkTitle: "Environments"
description: "Learn about Radius environments and how to interact with them"
description: "Learn about Radius Environments"
weight: 200
tags: ["environments"]
---
Expand Down
236 changes: 236 additions & 0 deletions docs/content/operations/environments/howto-environment/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
---
type: docs
title: "How-To: Initialize Radius Environments"
linkTitle: "How-To: Environments"
description: "Learn how to create Radius environments"
weight: 100
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved
categories: "How-To"
tags: ["environments"]
---

Radius environments are prepared landing zones for applications that contain configuration and Recipes. To learn more visit the [environments overview]({{< ref "/operations/environments/overview" >}}) page.

jasonviviano marked this conversation as resolved.
Show resolved Hide resolved
Radius environments can be setup with the rad CLI via two paths: interactive or manual.

## Pre-requisites

- Install the [rad CLI]({{< ref getting-started >}})
- Setup a supported [Kubernetes cluster]({{< ref "/operations/platforms/kubernetes" >}})

## Create an environment interactively

1. Initialize a new environment with `rad init` command:
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved
```bash
rad init
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved
```

1. 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]({{< ref "providers#azure-provider" >}})
- **AWS provider** (optional) - Allows you to [deploy and manage AWS resources]({{< ref "providers#aws-provider" >}})
- **Environment name** - The name of the environment to create

You should see the following output:

```bash
Initializing Radius...

✅ Install Radius v0.21
- Kubernetes cluster: k3d-k3s-default
- Kubernetes namespace: radius-system
✅ Create new environment default
- Kubernetes namespace: default
✅ Scaffold application samples
✅ Update local configuration

Initialization complete! Have a RAD time 😎
```

1. Verify the Radius services were installed by running:
```bash
kubectl get deployments -n radius-system
```

You 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
```

1. Verify an environment was created with [`rad env show`]({{< ref rad_env_show.md >}}):

```bash
rad env show -o json
```

You 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": {
"Applications.Link/daprStateStores": {
"default": {
"templateKind": "bicep",
"templatePath": "radius.azurecr.io/recipes/local-dev/daprstatestores:0.21"
}
},
"Applications.Link/mongoDatabases": {
"default": {
"templateKind": "bicep",
"templatePath": "radius.azurecr.io/recipes/local-dev/mongodatabases:0.21"
}
},
"Applications.Link/redisCaches": {
"default": {
"templateKind": "bicep",
"templatePath": "radius.azurecr.io/recipes/local-dev/rediscaches:0.21"
}
}
}
},
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved
"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.

jasonviviano marked this conversation as resolved.
Show resolved Hide resolved
1. Install Radius onto a Kubernetes cluster:

Run [`rad install kubernetes`]({{< ref rad_install_kubernetes >}}) to install Radius into your default Kubernetes context and cluster:


```bash
rad install kubernetes
```

1. Create a new Radius resource group:
[Radius resource groups]({{< ref groups >}}) are used to organize Radius resources such as applications, environments, links, and routes. Run [`rad group create`]({{< ref rad_group_create >}}) to create a new resource group:
```bash
rad group create myGroup
```

1. Create your Radius environment:

Run [`rad env create`]({{< ref rad_env_create >}}) to create a new environment in your resource group. Specify the `--namespace` flag to select the Kubernetes namespace to deploy resources into:

```bash
rad env create myEnvironment --group myGroup --namespace my-namespace
```


1. Verify the initialization by running:
AaronCrawfis marked this conversation as resolved.
Show resolved Hide resolved
```bash
kubectl get deployments -n radius-system
```

You 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
```

You can also use [`rad env list`]({{< ref rad_env_list.md >}}) to see if the created environment gets listed:

```bash
rad env list --group myGroup
```
## Configure cloud providers

Setting up a [cloud provider]({{<ref providers>}}) allows you to deploy and manage resources from either Azure or AWS as part of your Radius Application.
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved

{{< tabs Azure AWS >}}

{{% codetab %}}
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved

### Pre-requisites

- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/what-is-azure-cli)

### Configuration steps

1. Use [`rad env update`]({{< ref rad_env_update >}}) to update your Radius Environment with your Azure subscription ID and Azure resource group:

```bash
rad env update myEnvironment --azure-subscription-id myAzureSubscriptionId --azure-resource-group myAzureResourceGroup
```

2. Run `az ad sp create-for-rbac` to create a Service Principal without a role assignment and obtain your `appId`, `displayName`, `password`, and `tenant` information.

```bash
{
"appId": "****",
"displayName": "****",
"password": "****",
"tenant": "****"
}
```


3. Use [`rad credential register azure`]({{< ref rad_credential_register_azure >}}) to add the Azure service principal to your Radius installation:
```bash
rad credential register azure --client-id myClientId --client-secret myClientSecret --tenant-id myTenantId
```
Radius will use the provided service principal for all interactions with Azure, including Bicep and Recipe deployments.

{{% /codetab %}}
{{% codetab %}}
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved

### Pre-requisites

- Make sure you have an [AWS account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account) and an [IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html)
- [Create an IAM AWS access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) and copy the AWS Access Key ID and the AWS Secret Access Key to a secure location for use later. If you have already created an Access Key pair, you can use that instead.
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
- Configure your CLI with [`aws configure`](https://docs.aws.amazon.com/cli/latest/reference/configure/index.html), specifying your configuration values
- [eksctl CLI](https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html)

### Configuration steps

1. Create an EKS cluster by using the `eksctl` CLI. This command will create a cluster in the `us-west-2` region, as well as a VPC and the Subnets, Security Groups, and IAM Roles required for the cluster.
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved

```bash
eksctl create cluster --name my-cluster --region=us-west-2 --zones=us-west-2a,us-west-2b,us-west-2c
```

> Note: If you are using an existing cluster, you can skip this step. However, make sure that the each of the Subnets in your EKS cluster Subnet Group are within the [list of supported MemoryDB availability zones](https://docs.aws.amazon.com/memorydb/latest/devguide/subnetgroups.html). If your cluster includes Subnets outside of a supported MemoryDB availability zone, or if using your own custom subnets, supply them as part of the deployment file as the following:

```bash
rad deploy ./app.bicep --parameters eksClusterName=YOUR_EKS_CLUSTER_NAME
```
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved

2. Update your Radius Environment with your AWS region and AWS account ID:
```bash
rad env update myEnvironment --aws-region myAwsRegion --aws-account-id myAwsAccountId
```
This command updates the configuration of an environment for properties that are able to be changed. For more information visit [`rad env update`]({{< ref rad_env_update >}})
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved
3. Add your AWS cloud provider credentials:
```bash
rad credential register aws --access-key-id myAccessKeyId --secret-access-key mySecretAccessKey
```
For more information on the command arguments visit [`rad credential register aws`]({{< ref rad_credential_register_aws >}})
{{% /codetab %}}
{{< /tabs >}}

## Next steps

- Learn about [Radius Workspaces]({{< ref workspaces >}})
5 changes: 0 additions & 5 deletions docs/content/operations/environments/workspaces/index.md
jasonviviano marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,3 @@ When you have multiple environments initialized for different purposes like stag
scope: /planes/radius/local/resourceGroups/staging
```
1. You can now deploy applications to both staging and prod using [`rad deploy`]({{< ref rad_deploy >}}), specifying the `-w` flag:

```sh
rad deploy -w staging
```
This will deploy the applications to the staging environment.