Skip to content

Commit

Permalink
rebase to v0.23
Browse files Browse the repository at this point in the history
Signed-off-by: Will Tsai <[email protected]>
  • Loading branch information
willtsai committed Aug 4, 2023
2 parents 12f4673 + f0f560b commit a8e561d
Show file tree
Hide file tree
Showing 24 changed files with 95 additions and 188 deletions.
1 change: 1 addition & 0 deletions .github/config/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ manualScaling
httpGet
tcp
BucketName
roadmap
Balancer
authSource
mongodb
Expand Down
4 changes: 2 additions & 2 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ weight: 1

{{< cardpane >}}
{{< card header="**App-centric**" >}}
Teams [describe their application]({{< ref appmodel-concept >}}) services and relationships, rather than just a list of infrastructure.
Teams [describe their application]({{< ref application-graph>}}) services and relationships, rather than just a list of infrastructure.

<img src="app-diagram.png" alt="Screenshot of a Radius applications diagram" style="width:100%" >
{{< /card >}}
Expand Down Expand Up @@ -41,7 +41,7 @@ Teams can offload the complexity of wiring-up applications and let Radius employ
<table style="max-width:600px;margin-top:5%">
<tr>
<td style="width:25%;text-align:center">
<a href="{{< ref appmodel-concept >}}"><img src="connect-logo.svg" alt="Connections logo" style="width:40%"></a>
<a href="{{< ref application-graph>}}"><img src="connect-logo.svg" alt="Connections logo" style="width:40%"></a>
</td>
<td style="width:25%;text-align:center">
<a href="{{< ref networking >}}"><img src="network-logo.svg" alt="Networking logo" style="width:40%"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/content/author-apps/application/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tags: ["applications"]

## Overview

An [application]({{< ref appmodel-concept >}}) is the primary resource that contains all of your services and relationships.
An [application]({{< ref application-graph>}}) is the primary resource that contains all of your services and relationships.

## Extensions

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions docs/content/concepts/application-graph/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
type: docs
title: Radius Application Graph
linkTitle: Application graph
description: Learn how the Radius application graph allows you to model your entire application
weight: 200
---

## Radius applications

Radius offers an [application resource]({{< ref "/author-apps/application" >}}) which teams can use to define and deploy their entire application, including all of the compute, relationships, and infrastructure that make up the application. Since the graph of relationships between deployed resources is much more descriptive than a basic list of resources, the Radius application graph can automate complex deployment tasks and enable rich visualization experiences.

<img src="application.png" alt="A diagram showing an application and all it's resources" width=400px >

## Graphs are better than lists

Within an application deployed with Radius, developers can express both the resources (_containers, databases, message queues, etc._), as well as all the relationships between them. This forms the Radius application graph. This graph is powerful because it allows Radius to understand the relationships between resources, and automate the deployment and configuration of your application. Plus, it allows you to visualize your application in a way that is more intuitive than a list of resources.

<img src="list-to-graph.png" alt="A diagram showing the move from a set of infrastructure lists to a graph of resources" width=600px >

## Automate your application deployment

Because Radius now has all the relationships and requirements of an application, it can be deployed and configured automatically. Developers no longer need to specify all the identity, networking, or other configuration that is normally required, and operators don’t need to write custom deployment scripts.

For example, if you want a container to read from an Azure Storage Account without using Radius, this normally requires creating managed identities, RBAC roles, identity federation, Kubernetes service accounts, and more. With Radius, developers can define a single connection from their container to a Storage Account, and Radius sets up all the required configuration automatically.

<img src="graph-automation.png" alt="A diagram showing a connection from a Radius container to an Azure storage account resulting in managed identities, role-based access control, and CSI drivers." width=600px >

## Self-documenting applications

The Radius application graph also allows your application to be self-documenting, where developers and operators can query and reason about the same application definition. Instead of multiple views of logs, infrastructure, and code, Radius provides a single source of truth for your application.

<img src="dashboard.png" alt="A mockup of a dashboard UI showing an application, its resources, and its connections" width=700px >

> **Note:** A Radius dashboard is still on the roadmap, but in the meantime you can use the [Radius API]({{< ref api-concept >}}) to build your own visual experiences today.
## Mine the app graph API

The Radius application graph is also exposed as an API, allowing you to build your own visualizations, workflows, and more on top of Radius. Learn more in the [API docs]({{< ref api-concept >}}).

For example, I can get the status of my `frontend` container, and get its definition and its connections to other resources:

```bash
GET /planes/radius/local/resourceGroups/default/providers/Applications.Core/containers/frontend
```

```
{
"name": "frontend",
"type": "Applications.Core/containers"
"id": "/planes/radius/local/resourceGroups/default/providers/Applications.Core/containers/frontend",
"properties": {
"container": {
"image": "nginx:latest",
"env": {...},
"ports": {...},
},
"environment": "myenvironment",
"application": "myapp"
},
"connections": {
"backend": {
"source": "/planes/radius/local/resourceGroups/default/providers/Applications.Core/containers/backend",
},
"storage": {
"source": "/planes/azure/subscriptions/ee3dbd5a-68b4-4eea-bc48-f064009e6ff9/resourceGroups/myrg/providers/Microsoft.Storage/storageAccounts/mystorage",
"iam": {
"kind": "azure",
"roles": [
"Storage Blob Data Reader"
]
}
}
},
}
```

## Next step

Now that you have an understanding of the Radius app graph, learn how you can deploy Radius applications to prepared landing zones with Radius Environments:

{{< button text="Radius Environments" page="environments-concept" color="success" >}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 0 additions & 107 deletions docs/content/concepts/appmodel-concept/_index.md
Original file line number Diff line number Diff line change
@@ -1,107 +0,0 @@
---
type: docs
title: "Radius application model"
linkTitle: "App model"
description: "Learn how to model your applications with the Radius application model"
weight: 200
categories: ["Concept"]
---

## Deployable architecture diagrams

Cloud-native applications are often designed and described using lines-and-boxes architecture diagrams as the starting point:

<img alt="Whiteboard diagram of an application and its components" src="app-diagram.png" width="500px" /><br />

These diagrams often include:

1. Infrastructure resources, including databases, messages queues, API gateways, and secret stores
1. Services that run application code, such as containers.
1. Relationships between resources, like protocols, settings, and permissions

The Radius app model provides a way for developers to translate human-understandable application diagrams into human-understandable application code.

## Defining an Application

The Radius application contains everything on an app diagram. That includes all the compute, data, and infrastructure.

{{% alert title="📄 Application" color="primary" %}}
The largest circle you can draw around your resources where names have meaning.
{{% /alert %}}

<img alt="Whiteboard diagram of an application and its components" src="radius-application.png" width="500px" /><br />

An application is defined as a top-level `resource app` in an infrastructure-as-code file:

{{< tabs Bicep >}}

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

{{< /tabs >}}

## Adding resources

Currently, this example app is an empty shell and has no child resources defined. It's up to the user to define what they consider part of the app. Users can include both services (containers) and infrastructure resources (databases, caches, etc.).

<img alt="Diagram of available Radius resources" src="resources.png" width="500px" /><br />

Each node of an architecture diagram maps to one resource. Together, an application's resources capture all of the important behaviors and requirements needed for a runtime to host that app.

Updating our IaC file, this would look like:

{{< tabs Bicep >}}

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

{{< /tabs >}}

## Adding connections

Once you define your application and the resources inside of it, you can define the connections between them. Connections are defined as:

{{% alert title="📄 Connections" color="primary" %}}
A **logical** unit of communication between resources.
{{% /alert %}}

The use cases for connections are flexible, and include features like:

- Configuring role based access control (RBAC) between resources
- Passing resource information like connection strings, credentials, etc. to the consumer of a resource
- Configuring security policies between resources and runtimes

### Injected values

When a connection between two resources is declared, Radius injects resource related information into environment variables that are then used to access the respective resource without having to hard code URIs, connection strings, secrets, etc. into your application code. This is a form of *cloud-native service discovery* and makes it easy for you to decouple your application code from the environment where its deployed.

These environment variables follow a naming convention that makes their use predictable. The naming pattern is derived from the name given to the connection and its type, which determines what values are required. This way the code that needs to read the values gets to define how they are named. For example, adding a connection called `myconnection` that connects to a MongoDB resource would result in the following environment variables being injected:

```bash
# the connection string to the resource, e.g. 'mongodb://mongo:27017/mongo?authSource=admin'
CONNECTION_MYCONNECTION_CONNECTIONSTRING
# the type of connection, e.g. 'mongo-connector'
CONNECTION_MYCONNECTION_DATABASE
```

Each kind of connection defines values that are useful for communication. These could be URIs, connection strings, access keys, or anything that application code needs to successfully communicate. Refer to each [resource's reference documentation]({{< ref resource-schema >}}) for more information.

The values provided through connections are a convenience and are also available as properties and functions (for secrets) when authoring your IaC files. You can ignore the values generated by a connection if you prefer to be explicit, or if you already have another convention you would like to follow.

Adding connections to the above IaC file, it becomes:

{{< tabs Bicep >}}

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

{{< /tabs >}}

## Next step

Now that you have an understanding of the Radius app model, learn more about the Radius Environments:

{{< button text="Radius Environments" page="environments-concept" size="btn-lg" color="success" >}}
Binary file not shown.
Binary file removed docs/content/concepts/appmodel-concept/custom.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions docs/content/concepts/appmodel-concept/snippets/app.bicep

This file was deleted.

4 changes: 2 additions & 2 deletions docs/content/concepts/overview/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ At the heart of Radius is a new **application resource**, with an accompanying s

<img alt="Diagram showing modeling an app with Radius" src="cloud-apps-radius.png" width="600px" />

These new resources form the [**Radius app model**]({{< ref appmodel-concept >}}), which allow you to:
These new resources form the [**Radius app model**]({{< ref application-graph>}}), which allow you to:

- Visualize the entire application, including its dependencies and relationships
- Investigate cross-app health and diagnostics, including dependencies and connections
Expand Down Expand Up @@ -88,4 +88,4 @@ As teams onboard to Radius and begin deploying across platforms, the tooling and

Now that you have an overview of Radius, learn more about the Radius app model:

{{< button text="Learn about the Radius application model" page="appmodel-concept" size="btn-lg" color="success" >}}
{{< button text="Learn about the Radius application model" page="application-graph" size="btn-lg" color="success" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ This creates a container that will be deployed to your Kubernetes cluster. This
> Replace `<AWS_ACCESS_KEY_ID>` and `<AWS_SECRET_ACCESS_KEY>` with the values obtained from the previous step.

{{% alert title="Warning" color="warning" %}}It is always recommended to have separate IAM credentials for your container to communicate with S3 or any other data store.
Radius is currently working on supporting [direct connections]({{< ref "appmodel-concept#adding-connections" >}}) to AWS resources so that your container can automatically communicate with the data store securely without having to manage separate credentials for data plane operations{{% /alert %}}
Radius is currently working on supporting direct connections to AWS resources so that your container can automatically communicate with the data store securely without having to manage separate credentials for data plane operations{{% /alert %}}

1. Port-forward the container to your machine with [`rad resource expose`]({{< ref rad_resource_expose >}}):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Next, download the latest `rad` CLI release and setup your workspace:
- name: Initialize Radius environment
run: |
./rad group create default
./rad workspace create default --group default
./rad workspace create kubernetes default --group default
./rad env create temp
./rad env switch temp
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ You can choose between a Redis container or Azure Table Storage

Radius captures both logical relationships and related operational details. Examples of this include: wiring up connection strings, granting permissions, or restarting components when a dependency changes.

The [`connections` property]({{< ref "appmodel-concept" >}}) is used to configure relationships between from a service to another resource.
The [`connections` property]({{< ref "application-graph" >}}) is used to configure relationships between from a service to another resource.

Add a [`connection`]({{< ref "appmodel-concept" >}}) from `backend` to the `orders` state store. This declares the _intention_ from the `backend` container to communicate with the `statestore` resource
Add a [`connection`]({{< ref "application-graph" >}}) from `backend` to the `orders` state store. This declares the _intention_ from the `backend` container to communicate with the `statestore` resource

{{< rad file="snippets/connection.bicep" embed=true marker="//BACKEND" replace-key-container="//CONTAINER" replace-value-container="container: {...}" replace-key-extensions="//EXTENSIONS" replace-value-extensions="extensions: [...]" >}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You can view and download the source code in the [samples repo](https://github.c
## Containers

This Radius application will have two [containers]({{< ref appmodel-concept >}}):
This Radius application will have two [containers]({{< ref application-graph>}}):

- A frontend UI for users to place orders. Written with .NET Blazor.
- A backend order processing microservice. Written in Node.JS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Next, add to `app.bicep` a [Mongo link]({{< ref links-resources >}}), leveraging

## Step 5: Connect to the Mongo Link

Connections from a container to a link result in environment variables for connection information [automatically being set on the container]({{< ref "appmodel-concept#injected-values" >}}). Update your container definition to add a connection to the new Mongo link:
Connections from a container to a link result in environment variables for connection information automatically being set on the container. Update your container definition to add a connection to the new Mongo link:

{{< rad file="snippets/3-app.bicep" embed=true marker="//CONTAINER" >}}

Expand Down
2 changes: 1 addition & 1 deletion docs/content/reference/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ output values object = {

### Does Radius support all Azure resources?

**Yes**. You can use any Azure resource type by modeling it in Bicep outside the `Applications.Core/applications` resource and defining a connection to the resource from a `Applications.Core/containers`. See the [connections page]({{< ref appmodel-concept >}}) for more details.
**Yes**. You can use any Azure resource type by modeling it in Bicep outside the `Applications.Core/applications` resource and defining a connection to the resource from a `Applications.Core/containers`. See the [connections page]({{< ref application-graph>}}) for more details.

0 comments on commit a8e561d

Please sign in to comment.