-
Couldn't load subscription status.
- Fork 50
Revamp tutorial section to have a single end-end tutorial #1551
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4b5b056
Revamp tutorial
Reshrahim 28b101a
Revamp tutorial
Reshrahim cb49055
Fix docsy error
Reshrahim eb463f2
Merge branch 're/tutorial' of https://github.com/radius-project/docs …
Reshrahim f362c1c
fix docsy
Reshrahim 3fe4a37
Fix minor things
Reshrahim 2717bfd
Fix minor things
Reshrahim 7a8896a
Address feedback-part1
Reshrahim c0ce03a
Address feedback on tutorial page
Reshrahim bbcc5c4
Update Recipe
Reshrahim e131a76
Add deploy application and other changes
Reshrahim 0266f3e
remove eshop
Reshrahim 1386611
Download from contrib
Reshrahim e2c6dd5
Address feedback
Reshrahim f53e3c0
Address feedback
Reshrahim d46a87c
spell check
Reshrahim 1e4f1a5
Merge branch 'edge' into re/tutorial
Reshrahim 0a7cabb
Apply suggestions from code review
Reshrahim 3f13686
Merge branch 'edge' into re/tutorial
Reshrahim 5410b23
Apply suggestions from code review
Reshrahim 2d017f1
Apply suggestions from code review
Reshrahim e6b0b8e
Update docs/content/tutorials/create-environment/index.md
Reshrahim e46b155
Apply suggestions from code review
Reshrahim e4e47f5
Update install-rad-cli.md
Reshrahim 41c05f8
Apply suggestions from code review
Reshrahim 6e60ff7
Address feedback
Reshrahim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| type: docs | ||
| title: "Samples" | ||
| linkTitle: "Samples" | ||
| description: "Reference samples" | ||
| weight: 400 | ||
| --- |
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,23 @@ | ||
| --- | ||
| type: docs | ||
| title: "Tutorials" | ||
| linkTitle: "Tutorials" | ||
| description: "Follow along with a set of tutorials to learn how to use the Radius platform" | ||
| title: "Tutorial: Deploy a To Do List Application" | ||
| linkTitle: "Tutorial" | ||
| description: "Step-by-step guide to define and deploy a Radius application" | ||
| weight: 30 | ||
| --- | ||
|
|
||
| This hands-on tutorial guides you through deploying a To Do List application that demonstrates key Radius concepts and capabilities. This will take approximately 30-60 minutes to complete. | ||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Prerequisites | ||
|
|
||
| - A Kubernetes cluster (local using kind/minikube or cloud-based) | ||
| - `kubectl` installed | ||
| - Basic familiarity with YAML, Terraform and Bicep | ||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Learning Outcomes | ||
|
|
||
| After completing this tutorial, you'll be able to: | ||
|
|
||
| - Understand Radius concepts like Resource Types, Environments, and Recipes | ||
| - Create Radius Resource Types and Recipes for your applications | ||
| - Deploy your applications using Radius | ||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| --- | ||
| type: docs | ||
| title: "3. Create Environment" | ||
| linkTitle: "3. Create Environment" | ||
| description: "Create a Radius Environment to deploy the application" | ||
| weight: 400 | ||
| --- | ||
|
|
||
| ## Create a workspace | ||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Radius Workspace is a combination of a Kubernetes context, a Radius Environment, and a Resource Group. | ||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Create a new workspace using the [`rad workspace create`]({{< ref rad_workspace_create >}}) command to manage the cluster configuration. | ||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| rad workspace create kubernetes my-workspace | ||
| ``` | ||
|
|
||
| ``` | ||
| $ rad workspace create my-workspace | ||
| Creating workspace 'my-workspace'... | ||
| Workspace 'my-workspace' created successfully. | ||
| ``` | ||
|
|
||
| Show the current Workspace. The `--output json` will show all the details of the Workspace. | ||
|
|
||
| ```bash | ||
| rad workspace show -o json | ||
| ``` | ||
|
|
||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
| $ rad workspace show -o json | ||
| { | ||
| "connection": { | ||
| "context": "my-kube-context", | ||
| "kind": "kubernetes" | ||
| }, | ||
| "environment": "/planes/radius/local/resourceGroups/default/providers/Applications.Core/environments/default", | ||
| "scope": "/planes/radius/local/resourceGroups/default" | ||
| } | ||
| ``` | ||
|
|
||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Notice that a | ||
| {{< alert title="💡 Workspaces" color="info" >}} | ||
| [Workspaces]({{< ref Workspaces >}}) are configurations set for the Radius CLI. Similar to kubectl contexts, you can have multiple Workspaces pointing to different Radius installation, Resource Groups, and Environments. | ||
| {{< /alert >}} | ||
|
|
||
|
|
||
| ## Create a Radius Resource Group | ||
|
|
||
| Create a Radius Resource Group using the rad group create command. | ||
|
|
||
| ```bash | ||
| rad group create my-group | ||
| ``` | ||
Reshrahim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Create a Radius Environment | ||
|
|
||
| Create a Radius Environment using the rad environment create command. | ||
|
|
||
| ```bash | ||
| rad environment create my-env | ||
| ``` | ||
|
|
||
| Inspect the Environment using the [`rad environment show`]({{< ref rad_environment_show >}}) commands. | ||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| rad environment show my-env --output json | ||
| ``` | ||
|
|
||
| ``` | ||
| $ rad environment show my-env --output json | ||
| { | ||
| "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/environments/my-env", | ||
| "location": "global", | ||
| "name": "my-env", | ||
| "properties": { | ||
| "compute": { | ||
| "kind": "kubernetes", | ||
| "namespace": "default" | ||
| }, | ||
| "provisioningState": "Succeeded", | ||
| "recipes": { | ||
| ... | ||
| } | ||
| }, | ||
| ... | ||
| "type": "Applications.Core/environments" | ||
| } | ||
| ``` | ||
| {{< button text="Next Step: Create Recipe" page="create-recipe" color="primary" >}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| --- | ||
| type: docs | ||
| title: "4. Create Recipes" | ||
| linkTitle: "4. Create Recipes" | ||
| description: "Author Bicep or Terraform Recipes implementing the Resource Type" | ||
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Reshrahim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| weight: 500 | ||
| --- | ||
| ## Prerequisites | ||
|
|
||
| You will use either Bicep or Terraform to author Recipes that implement the Resource Type you created in Step 2 and hence need a location to store your Recipe: | ||
|
|
||
| - **Terraform** configurations must be stored in a Git repository. Ideally for this tutorial the Git repository has anonymous access. If not, you will need to configure [Git authentication]({{< ref "guides/recipes/terraform/howto-private-registry" >}}). | ||
|
|
||
| - **Bicep** templates must be stored in an OCI registry. As with Git, you must have anonymous access to the registry or configure [authentication]({{< ref "guides/recipes/howto-private-bicep-registry" >}}). | ||
|
|
||
| ## Create a Recipe for the PostgreSQL resource type | ||
|
|
||
| [Recipes]({{< ref "/guides/recipes/overview" >}}) define how resource are deployed. Recipes can be either Terraform configurations or Bicep templates. Once the Terraform configuration or Bicep template has been published in a Git repo or OCI registry, it can be registered as a recipe in a Radius environment. | ||
|
|
||
| {{< tabs Terraform Bicep >}}{{% codetab %}} | ||
|
|
||
| Terraform configurations must be stored in a Git repository accessible by Radius. As discussed in the prerequisites, using a Git repository with anonymous access is easiest for this tutorial, otherwise you will need to configure [Git authentication]({{< ref "guides/recipes/terraform/howto-private-registry" >}}). Learn more about Recipes in this [How-to guide]({{< ref "/guides/recipes/howto-author-recipes" >}}). | ||
|
|
||
| 1. Create a new directory in your Git repository for the PostgreSQL Terraform module then create the `main.tf` file and add the following: | ||
|
|
||
| {{% rad file="snippets/recipes/terraform/main.tf" embed=true %}} | ||
|
|
||
| <!--TODO: Replace with button to download like in the composite recipe tutorial. Save the full contents for the Recipe how-to which explains what all of this is. --> | ||
|
|
||
| 1. Register the Terraform configuration as a Recipe called `default`. Since Recipes are registered with Environments, use the `default` environment created in the previous tutorial. | ||
|
|
||
| ```bash | ||
| rad recipe register default \ | ||
| --environment default \ | ||
| --resource-type Radius.Resources/postgreSQL \ | ||
| --template-kind terraform \ | ||
| --template-path git::<git-server-name>/<repository-name>.git//<directory>/<subdirectory> | ||
| ``` | ||
|
|
||
| For example, if the `main.tf` file is in a GitHub repository named `recipes` in a directory called `/kubernetes/postgresql`, the command would look like this: | ||
|
|
||
| ```bash | ||
| --template-path git::https://github.com/<github-user-name>/recipes.git//kubernetes/postgresql | ||
| ``` | ||
|
|
||
| The output will be: | ||
|
|
||
| ``` | ||
| Successfully linked recipe "default" to environment "default" | ||
| ``` | ||
|
|
||
Reshrahim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 1. Verify the Recipe is registered using the [`rad recipe list`]({{< ref rad_recipe_list >}}) command. | ||
|
|
||
| ```bash | ||
| rad recipe list | ||
| ``` | ||
|
|
||
| ``` | ||
| $ rad recipe list | ||
| RECIPE TYPE TEMPLATE KIND TEMPLATE VERSION TEMPLATE | ||
| ... | ||
| default Radius.Resources/postgreSQL terraform git::https://github.com/<github-user-name>/recipes.git//kubernetes/postgres | ||
| ``` | ||
|
|
||
| {{% /codetab %}} | ||
| {{% codetab %}} | ||
|
|
||
| Bicep templates must be stored in an OCI registry accessible by Radius. As discussed in the prerequisites, using an OCI registry with anonymous access is easiest for this tutorial, otherwise you will need to configure [authentication]({{< ref "guides/recipes/howto-private-bicep-registry" >}}). Learn more about Recipes in this [How-to guide]({{< ref "/guides/recipes/howto-author-recipes" >}}). | ||
|
|
||
| 1. Create a new file called `postgresql.bicep` and add the following: | ||
|
|
||
| {{% rad file="snippets/recipes/bicep/postgresql.bicep" embed=true %}} | ||
|
|
||
| <!--TODO: Replace with button to download like in the composite recipe tutorial. Save the full contents for the Recipe how-to which explains what all of this is. --> | ||
|
|
||
| 1. Publish the Recipe to the OCI registry. Make sure to replace `host` and `registry` with your container registry. | ||
|
|
||
| ```bash | ||
| rad bicep publish --file postgresql.bicep --target br:<host>/<registry>/postgresql:latest | ||
| ``` | ||
|
|
||
| ``` | ||
| Successfully published Bicep file "postgresql.bicep" to "<host>/<registry>/postgresql:latest" | ||
| ``` | ||
|
|
||
| 1. Register the Bicep template as a Recipe called `default`. Since Recipes are registered with Environments, use the `default` environment created in the previous tutorial. | ||
|
|
||
| ```bash | ||
| rad recipe register default --environment default \ | ||
| --resource-type Radius.Resources/postgreSQL \ | ||
| --template-kind bicep \ | ||
| --template-path <host>/<registry>/postgresql:latest | ||
| ``` | ||
|
|
||
| ``` | ||
| Successfully linked recipe "default" to environment "default" | ||
| ``` | ||
|
|
||
| 1. Verify the Recipe is registered using the [`rad recipe list`]({{< ref rad_recipe_list >}}) command. You should see output similar to: | ||
|
|
||
| ```bash | ||
| rad recipe list | ||
| ``` | ||
|
|
||
| ``` | ||
| $ rad recipe list | ||
| RECIPE TYPE TEMPLATE KIND TEMPLATE VERSION TEMPLATE | ||
| ... | ||
| default Radius.Resources/postgreSQL bicep <host>/<repository>/postgresql:latest | ||
| ``` | ||
|
|
||
| {{% /codetab %}} | ||
| {{< /tabs >}} | ||
|
|
||
| {{< button text="Next step: Deploy Application" page="deploy-application" color="primary" >}} | ||
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.