Skip to content

Commit

Permalink
Merge branch 'edge' into aacrawfi/gateway-howtos
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronCrawfis committed Oct 9, 2023
2 parents 3d150b5 + 92e3a08 commit 8f95b79
Show file tree
Hide file tree
Showing 58 changed files with 216 additions and 403 deletions.
10 changes: 10 additions & 0 deletions docs/assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
.td-navbar .navbar-brand__name {
display: none;
}

.btn-success {
background: #3176d9;
background-color: #3176d9;
border-color: #3176d9;
}

.btn {
border-radius: 10px;
}
2 changes: 1 addition & 1 deletion docs/assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$info: #b89112;
$primary: #25BADC;
$primary: #c43821;

input[type="text"] {
width: 75%;
Expand Down
5 changes: 4 additions & 1 deletion docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ no_list: true

Welcome to the Radius documentation! Here you'll find everything you need to know about Radius, from getting started to advanced topics.

{{% alert title="What is Radius?" color="primary" %}}
{{% alert color="primary" %}}
<img src="radius-logo.svg" alt="Radius logo" width="400px" /> <br /><br />
Radius is a cloud native application platform. It enables developers and IT operators to collaborate on delivering and managing cloud-native applications. With Radius, teams can easily understand their applications and how applications are running environments including dev, cloud, edge, and on-prem. Plus, teams can ensure their application infrastructure meets cost, operations, and security requirements. Open-source and multi-cloud, Radius is the cloud-native application platform for delivering and managing applications anywhere.

[**Learn more**](https://radapp.dev/)
{{% /alert %}}

{{< button text="Get started with Radius 🚀" page="getting-started" color="success" size="btn-lg" >}}
Expand Down
12 changes: 6 additions & 6 deletions docs/content/community/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ description: "Information about the Radius community"
weight: 80
---

Welcome to the Radius community. We are currently in a private release phase which is open to Microsoft FTEs and select partners. The team is working on a public preview release which will be announced on this page.
Welcome to the Radius community!

## Discussions

The best way to interact with us currently is through Discord over at the Radius Discord server:
The best way to interact with the community is via the Radius Discord server:

{{< button link="https://discord.gg/SRG3ePMKNy" text="Radius Discord" newtab="true" >}}

## Community meetings

Every month we host a community meeting to showcase new features, review upcoming milestones, and engage in a Q&A.
Anyone from the Radius Private Preview community can participate, present a topic, or host. All are welcome!
Anyone from the Radius community can participate, present a topic, or host. All are welcome!

### Meeting link

The meeting link and details are sent out via email. Contact your Radius Core Team contact to be added to the meeting invite.
The meeting link and details are sent out via email.

### Present your topic

Expand All @@ -42,8 +42,8 @@ To present a specific topic on the next Radius community call start by filling o

## GitHub Issues & repositories

GitHub access is optional and not required to try out and run Radius. If you would like to directly file Issues and have access to the source code, please contact your Radius Core Team contact.
If you would like to file Issues, access the source code, or use Codespaces please visit the [Radius GitHub repo] (https://github.com/radius-project).

## How can I get involved?

One of the easiest ways to contribute is to participate in discussions at community engagements or the Teams channel. We are always seeking feedback from. Suggestions around improving the product and docs are always welcome.
One of the easiest ways to contribute is to participate in discussions at community engagements or via the Discord server referenced above. We are always seeking feedback, especially for suggestions around improving the product and docs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
type: docs
title: "How To: Service to service networking"
linkTitle: "Service networking"
description: "Learn how your Radius services can communicate with each other"
weight: 200
slug: 'service-networking'
categories: "How-To"
---

This guide will show you how two services can communicate with each other. In this example, we will have a frontend container service that communicates with a backend container service.

<img src="overview.png" alt="Diagram of the frontend talking to the backend over HTTP port 80" width="400px" >

## Prerequisites

- [rad CLI]({{< ref "/guides/tooling/rad-cli/overview" >}})
- [Radius environment]({{< ref getting-started >}})

## Step 1: Define the services

First, define the containers in a file named `app.bicep`. We will define two services: `frontend` and `backend`:

{{< rad file="snippets/1-app.bicep" embed=true markdownConfig="{linenos=table}" >}}

Note the frontend container doesn't yet have a connection to the backend container. We will add that in the next step.

## Step 2: Add a connection

With the services defined, we can now add the connection between them. Add a connection to `frontend`:

{{< rad file="snippets/2-app.bicep" embed=true marker="//FRONTEND" markdownConfig="{linenos=table,hl_lines=[\"14-18\"],linenostart=5}" >}}

## Step 3: Deploy the application

Deploy the application using the `rad deploy` command:

```bash
rad run app.bicep -a networking-demo
```

You should see the application deploy successfully and the log stream start:

```
Building app.bicep...
Deploying template 'app.bicep' for application 'networking-demo' and environment 'default' from workspace 'default'...
Deployment In Progress...
Completed backend Applications.Core/containers
Completed frontend Applications.Core/containers
Deployment Complete
Resources:
backend Applications.Core/containers
frontend Applications.Core/containers
Starting log stream...
```

## Step 4: Test the connection

Visit [http://localhost:3000](http://localhost:3000) in your browser. You should see a connection to the backend container, along with the environment variables that have automatically been set on the frontend container:

<img src="backend-connection.png" alt="Screenshot of the demo container showing the backend connections" width="600px" >

## Done

You have successfully added a connection between two containers. Make sure to delete your application to clean up the containers:

```bash
rad app delete networking-demo -y
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import radius as rad

@description('The application ID of the Radius environment. Automatically set by the rad CLI.')
param application string

resource frontend 'Applications.Core/containers@2023-10-01-preview' = {
name: 'frontend'
properties: {
application: application
container: {
image: 'radius.azurecr.io/tutorial/webapp:edge'
ports: {
web: {
containerPort: 3000
}
}
}
}
}

resource backend 'Applications.Core/containers@2023-10-01-preview' = {
name: 'backend'
properties: {
application: application
container: {
image: 'nginx:latest'
ports: {
web: {
containerPort: 80
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import radius as rad

@description('The application ID of the Radius environment. Automatically set by the rad CLI.')
param application string

//FRONTEND
resource frontend 'Applications.Core/containers@2023-10-01-preview' = {
name: 'frontend'
properties: {
application: application
container: {
image: 'radius.azurecr.io/tutorial/webapp:edge'
ports: {
web: {
containerPort: 3000
}
}
}
connections: {
backend: {
source: 'http://backend:80'
}
}
}
}
//FRONTEND

resource backend 'Applications.Core/containers@2023-10-01-preview' = {
name: 'backend'
properties: {
application: application
container: {
image: 'nginx:latest'
ports: {
web: {
containerPort: 80
}
}
}
}
}
27 changes: 16 additions & 11 deletions docs/content/guides/author-apps/networking/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,36 @@ linkTitle: "Overview"
description: "Learn how to add networking to your Radius application"
weight: 100
categories: "Overview"
tags: ["routes","gateways"]
---

Radius networking resources allow you to model:

- Communication between a user and a service
- Communication between services
- Communication between a user and a service

## HTTP Routes
<img src="networking.png" alt="Diagram of a gateway with traffic going to a frontend container, which in turn sends traffic to the basket and catalog containers" width="400px">

An `HttpRoute` resources defines HTTP communication between two [services]({{< ref "guides/author-apps/containers" >}}). They can be used to define both one-way communication, as well as cycles of communication between services.
## Service to service communication

<img src="networking-cycles.png" style="width:400px" alt="Diagram of Radius service-to-service networking with cycles" /><br />
Radius containers can define connections to other containers, just like they can define connections to dependencies.

Refer to the [HTTP Route schema]({{< ref httproute >}}) for more information on how to model HTTP routes.
Network connections are defined as strings containing:

A gateway can optionally be added for external users to access the Route.
- The **scheme** (protocol) of the connection _(http, https, tcp, etc.)_
- The **target** container/service to connect to _(basket, catalog, etc.)_
- The **port** to connect to _(80, 443, etc.)_

## Gateways
For example, a frontend container may need to connect to a basket container. The frontend container would define a connection to the basket container, with the scheme `http`, the target `basket`, and the port `3000`. The connection would look like this: `http://basket:3000`.

`Gateway` defines how requests are routed to different resources, and also provides the ability to expose traffic to the internet. Conceptually, gateways allow you to have a single point of entry for traffic in your application, whether it be internal or external traffic.
<img src="network-connection.png" alt="Diagram showing the components of a network connection" width="400px">

`Gateway` in Radius are split into two main pieces; the `Gateway` resource itself, which defines which port and protocol to listen on, and Route(s) which define the rules for routing traffic to different resources.
For more information on how to do service to service networking, visit the [service networking how-to guide]({{< ref howto-service-networking >}}):

{{< button text="How-To: Service to service networking" page="howto-service-networking" >}}

## Gateways

<img src="networking-gateways.png" style="width:400px" alt="Diagram of Radius gateways" /><br />
A `gateway` defines how requests are routed to different resources, and also provides the ability to expose traffic to the internet. Conceptually, gateways allow you to have a single point of entry for traffic in your application, whether it be internal or external.

Refer to the [Gateway schema]({{< ref gateway >}}) for more information on how to model gateways.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8f95b79

Please sign in to comment.