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

Update docs with new rad init behavior #660

Merged
merged 7 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Radius development environments enable you to quickly get started with Radius an

## How-to: Initialize a new dev environment

1. Initialize a new [Radius environment]({{< ref "operations/environments/overview">}}) with `rad init` command:
1. Initialize a new [Radius environment]({{< ref "operations/environments/overview">}}) with [`rad init`]({{< ref rad_init >}}):
```bash
rad init
```
Expand Down Expand Up @@ -83,4 +83,3 @@ Radius development environments enable you to quickly get started with Radius an
## Further reading

Refer to the [environments]({{< ref "/tags/environments" >}}) tag for more guides on the environment resource.

2 changes: 1 addition & 1 deletion docs/content/getting-started/first-app/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ cd first-app
Initialize Radius. For this example, accept all the default options (press ENTER to confirm):

```bash
rad init --dev
rad init
```

Example output:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ eksctl create cluster --name <my-cluster> --region=<my-region>

Create a [Radius environment]({{< ref "/operations/environments" >}}) where you will deploy your application.

Use the `rad init` command to initialize a new environment into your current kubectl context:
Run [`rad init --full`]({{< ref rad_init >}}) to initialize a new environment into your current kubectl context:

```bash
rad init
rad init --full
```

Follow the prompts to install the [control plane services]({{< ref architecture-concept >}}), create an [environment resource]({{< ref "operations/environments" >}}), and create a [local workspace]({{< ref workspaces >}}). You will be asked for:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ The steps below will showcase a "rad-ified" version of the existing [Azure AD wo

## Step 1: Initialize Radius

Begin by running `rad init`. Make sure to configure an Azure cloud provider:
Begin by running [`rad init --full`]({{< ref rad_init >}}). Make sure to configure an Azure cloud provider:

```bash
rad init
rad init --full
```

## Step 2: Define a Radius environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ This quickstart will provide an overview of how to:

## Step 1: Initialize Radius

Begin by running `rad init`. Make sure to configure an Azure cloud provider:
Begin by running [`rad init --full`]({{< ref rad_init >}}). Make sure to configure an Azure cloud provider:

```bash
rad init
rad init --full
```

## Step 2: Define a Radius environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Developers don't need to specify what cloud resources they're using in their app
2. Initialize a new dev environment:

```bash
rad init --dev
rad init
```

**Select 'Yes' when prompted to create an application.**
Expand Down Expand Up @@ -74,7 +74,7 @@ Developers don't need to specify what cloud resources they're using in their app

Update `app.bicep` with the following set of resources:

> app.bicep was created automatically when you ran `rad init --dev`
> app.bicep was created automatically when you ran `rad init`

{{< rad file="snippets/app.bicep" embed=true >}}

Expand Down
58 changes: 33 additions & 25 deletions docs/content/operations/environments/workspaces/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ weight: 200
categories: "Overview"
---

Workspaces allow you to manage multiple Radius platforms and environments using a local configuration file. You can easily define and switch between workspaces to deploy and manage applications across local, test, and production environments.
Workspaces allow you to manage multiple Radius platforms and environments using a local configuration file. You can easily define and switch between workspaces to deploy and manage applications across separate environments.

<img src=workspaces.png alt="Diagram showing a Radius configuration file mapping workspaces to Kubernetes clusters" width=800px />

Expand Down Expand Up @@ -97,47 +97,55 @@ Visit the [`config.yaml` reference docs]({{< ref config >}}) to learn about work

## How-to: Use workspaces to switch between environments

When you have multiple environments initialized for different purposes like staging or production, workspaces enable you to switch between different environments easily. You can create separate workspaces for staging/production and switch between them as you are working through your deployment lifecycle.
When you have multiple environments initialized for different purposes workspaces enable you to switch between different environments easily. You can create separate workspaces and switch between them as you are working through your deployment lifecycle.

1. Install the Radius control plane on kubernetes cluster
```sh
rad install kubernetes
```
1. Create a workspace named `staging` using [`rad workspace create`]({{< ref rad_workspace_create >}}):
1. Create a resource group named `myworkspace` using [`rad group create`]({{< ref rad_group_create >}}):
```sh
rad group create myworkspace
```
1. Create an environment named `myworkspace` using [`rad env create`]({{< ref rad_env_create >}}):
```sh
rad env create myworkspace
```
1. Create a workspace named `myworkspace` using [`rad workspace create`]({{< ref rad_workspace_create >}}):
```sh
rad workspace create kubernetes staging
rad workspace create kubernetes myworkspace --group myworkspace --environment myworkspace
```
Radius writes the workspace details to your local configuration file (`~/.rad/config.yaml` on Linux and macOS, `%USERPROFILE%\.rad\config.yaml` on Windows).
1. Initialize a Radius environment in your staging workspace via `rad init`:

```sh
rad init
```
Name your environment 'staging' when prompted.
1. Create another workspace named `production`:

1. Create another resource group named `yourworkspace` using [`rad group create`]({{< ref rad_group_create >}}):
```sh
rad group create yourworkspace
```
1. Create an environment named `yourworkspace` using [`rad env create`]({{< ref rad_env_create >}}):
```sh
rad env create yourworkspace
```
1. Create a workspace named `yourworkspace` using [`rad workspace create`]({{< ref rad_workspace_create >}}):
```sh
rad init kubernetes
rad workspace create kubernetes yourworkspace --group yourworkspace --environment yourworkspace
```
Name your environment 'production' when prompted.
1. Verify your `config.yaml` file. It should show both `staging` and `production` workspaces, with your environments:
1. Verify your `config.yaml` file. It should show both `myworkspace` and `yourworkspace` workspaces, with your environments:
```yaml
workspaces:
default: production
default: yourworkspace
items:
production:
yourworkspace:
connection:
context: mycluster
kind: kubernetes
environment: /planes/radius/local/resourcegroups/production
/providers/applications.core/environments/production
scope: /planes/radius/local/resourceGroups/production
staging:
environment: /planes/radius/local/resourcegroups/yourworkspace
/providers/applications.core/environments/yourworkspace
scope: /planes/radius/local/resourceGroups/yourworkspace
myworkspace:
connection:
context: mycluster
kind: kubernetes
environment: /planes/radius/local/resourcegroups/staging
/providers/applications.core/environments/staging
scope: /planes/radius/local/resourceGroups/staging
environment: /planes/radius/local/resourcegroups/myworkspace
/providers/applications.core/environments/myworkspace
scope: /planes/radius/local/resourceGroups/myworkspace
```
1. You can now deploy applications to both staging and prod using [`rad deploy`]({{< ref rad_deploy >}}), specifying the `-w` flag:
1. You can now deploy applications to both myworkspace and yourworkspace using [`rad deploy`]({{< ref rad_deploy >}}), specifying the `-w` flag.
Loading