-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'edge' into aacrawfi/gateway-howtos
- Loading branch information
Showing
58 changed files
with
216 additions
and
403 deletions.
There are no files selected for viewing
This file contains 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,3 +1,13 @@ | ||
.td-navbar .navbar-brand__name { | ||
display: none; | ||
} | ||
|
||
.btn-success { | ||
background: #3176d9; | ||
background-color: #3176d9; | ||
border-color: #3176d9; | ||
} | ||
|
||
.btn { | ||
border-radius: 10px; | ||
} |
This file contains 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,5 +1,5 @@ | ||
$info: #b89112; | ||
$primary: #25BADC; | ||
$primary: #c43821; | ||
|
||
input[type="text"] { | ||
width: 75%; | ||
|
This file contains 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 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
Binary file added
BIN
+157 KB
...t/guides/author-apps/networking/howto-service-networking/backend-connection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions
74
docs/content/guides/author-apps/networking/howto-service-networking/index.md
This file contains 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,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 | ||
``` |
Binary file added
BIN
+31.9 KB
docs/content/guides/author-apps/networking/howto-service-networking/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
docs/content/guides/author-apps/networking/howto-service-networking/snippets/1-app.bicep
This file contains 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,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 | ||
} | ||
} | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
docs/content/guides/author-apps/networking/howto-service-networking/snippets/2-app.bicep
This file contains 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,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 | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Binary file added
BIN
+52.1 KB
docs/content/guides/author-apps/networking/overview/network-connection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-64.9 KB
docs/content/guides/author-apps/networking/overview/networking-cycles.png
Binary file not shown.
Binary file removed
BIN
-43.8 KB
docs/content/guides/author-apps/networking/overview/networking-gateways.png
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.
34 changes: 0 additions & 34 deletions
34
docs/content/guides/author-apps/networking/overview/snippets/networking-sslpassthrough.bicep
This file was deleted.
Oops, something went wrong.
68 changes: 0 additions & 68 deletions
68
docs/content/guides/author-apps/networking/overview/snippets/networking-tlstermination.bicep
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.