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

Release v0.23.0 #651

Closed
wants to merge 10 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .github/config/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,7 @@ gg
kubernetesMetadata
daprSidecar
manualScaling
httpGet
tcp
BucketName
Balancer
6 changes: 3 additions & 3 deletions docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baseURL = "https://docs.radapp.dev/"
baseURL = "https://radapp.dev/"
languageCode = "en-us"
title = "Radius Docs"
theme = "docsy"
Expand Down Expand Up @@ -60,9 +60,9 @@ tag = "tags"
[params]
copyright = "Radius"

version = "v0.22"
version = "v0.23"
tag_version = "latest"
chart_version = "0.22.0"
chart_version = "0.23.0"

# Algolia Search
algolia_docsearch = true
Expand Down
4 changes: 2 additions & 2 deletions docs/content/author-apps/application/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linkTitle: "Application"
description: "Learn how to model your application and its services in Radius"
weight: 100
categories: "Overview"
tags: ["application"]
tags: ["applications"]
---

## Overview
Expand All @@ -30,4 +30,4 @@ The [Kubernetes Metadata extension]({{< ref "/operations/platforms/kubernetes/ku

## Further reading

Refer to the [applications]({{< ref "/tags/applications" >}}) tag for more guides on the application resource.
Refer to the [applications]({{< ref "/tags/applications" >}}) tag for more guides on the application resource.
91 changes: 78 additions & 13 deletions docs/content/author-apps/container/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,97 @@ title: "Containerized workloads"
linkTitle: "Containers"
description: "Model and run container workloads in your Radius application"
weight: 300
categories: "Concept"
categories: "Overview"
tags: ["containers"]
---

A Radius container represents a container workload within your application.
## Overview

## Example
A Radius container provides an abstraction to model and run your container workloads as part of your Radius application.

{{< tabs Bicep >}}

{{% codetab %}}
See the [Bicep authoring guide]({{< ref bicep >}}) for more information.
{{< rad file="snippets/container.bicep" embed=true marker="//CONTAINER" >}}
{{% /codetab %}}

{{< /tabs >}}
## Supported runtimes

Containers are run on the same Kubernetes cluster as your [Radius installation]({{< ref platforms >}}). We plan to support additional container runtimes and configurations in the future

## Capabilities

Radius containers enables you to specify the image for the container, the ports the container provides and consumes, the environment variables to set, the volumes to mount, and the probes to run.

Additionally you can customize the behavior of the containers with the help of [extensions](#extensions).

### Image

An image can be specified for your container workload to pull and run. Refer to the [container reference docs]({{< ref container-schema >}}) for more information on image requirements.

If you want to pull the container image from a private container register, you need to allow access from your Kubernetes cluster. Follow the documentation to [configure private container registries access]({{< ref "/operations/platforms/kubernetes/supported-clusters#configure-container-registry-access" >}}).

### Ports

Ports allow you to expose your container to incoming network traffic. Refer to the [networking guide]({{< ref networking >}}) for more information on container networking.

### Volumes

The volumes mounted to the container, either ephemeral or persistent, are defined in the volumes section.

Ephemeral volumes have the same lifecycle as the container, being deployed and deleted with the container. They create an empty directory on the host and mount it to the container.

Persistent volumes have life cycles that are separate from the container. Containers can mount these persistent volumes and restart without losing data. Persistent volumes can also be useful for storing data that needs to be accessed by multiple containers.

### Probes

#### Readiness Probe

Readiness probes detect when a container begins reporting it is ready to receive traffic, such as after loading a large configuration file that may take a couple seconds to process. There are three types of probes available, httpGet, tcp and exec.

For an **httpGet** probe, an HTTP GET request at the specified endpoint will be used to probe the application. If a success code is returned, the probe passes. If no code or an error code is returned, the probe fails, and the container won’t receive any requests after a specified number of failures. Any code greater than or equal to 200 and less than 400 indicates success. Any other code indicates failure.

For a **tcp** probe, the specified container port is probed to be listening. If not, the probe fails.

For an **exec probe**, a command is run within the container. A return code of 0 indicates a success and the probe succeeds. Any other return indicates a failure, and the container doesn’t receive any requests after a specified number of failures

Refer to the readiness probes section of the [container resource schema]({{< ref "container-schema#readiness-probes" >}}) for more details.

#### Liveness Probe

Liveness probes detect when a container is in a broken state, restarting the container to return it to a healthy state. There are three types of probes available, httpGet, tcp and exec.

For an **httpGet probe**, an HTTP GET request at the specified endpoint will be used to probe the application. If a success code is returned, the probe passes. If no code or an error code is returned, the probe fails, and the container won’t receive any requests after a specified number of failures. Any code greater than or equal to 200 and less than 400 indicates success. Any other code indicates failure.

For a **tcp probe**, the specified container port is probed to be listening. If not, the probe fails.

For an **exec probe**, a command is run within the container. A return code of 0 indicates a success and the probe succeeds. Any other return indicates a failure, and the container doesn’t receive any requests after a specified number of failures.

Refer to the probes section of the [container resource schema]({{< ref "container-schema#liveness-probes" >}}) for more details.

### Connections

Connections enable communication between your container and other resources, such as databases, message queues, and other services. A connection injects information about the resource you connect to as environment variables. This could be connection strings, access keys, password or other information needed for communication between the container and the resource it connects to. It also enables you to configure the RBAC permissions for the container to access the resource.

Refer to the [connections schema] for containers({{< ref "container-schema#connections" >}}) for more details.

### Extensions

Extensions define additional capabilities and configuration for a container.

#### Kubernetes metadata extension

The [Kubernetes metadata extension]({{< ref kubernetes-metadata>}}) enables you to configure the Kubernetes metadata for the container. This includes the labels and annotations for the container. Refer to to the extension overview page to get more details about the extension and how it works with other Radius resources.

#### Manual scaling extension

The manualScaling extension configures the number of replicas of a compute instance (such as a container) to run. Refer to the [container resource schema]({{< ref "container-schema#extensions" >}}) for more details.

## Platform resources
#### Dapr sidecar extension

Depending on the target environment and configuration, a container can be run on a variety of platforms leveraging Kubernetes as the container runtime.
The `daprSidecar` extensions adds and configures a [Dapr](https://dapr.io) sidecar to your application. Refer to the [container resource schema]({{< ref "container-schema#extensions" >}}) for more details

## More information
## Resource schema

- [Container schema]({{< ref container-schema >}})

## Other guides
## Further reading

{{< categorizeby category="Quickstart" tag="containers" >}}
{{< categorizeby category="How-To" tag="containers" >}}
18 changes: 0 additions & 18 deletions docs/content/author-apps/container/snippets/container.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@ resource container 'Applications.Core/containers@2022-03-15-privatepreview' = {
containerPort: 80
}
}
volumes: {
tmp: {
kind: 'ephemeral'
managedStore: 'memory'
mountPath: '/tmp'
}
}
}
extensions: [
{
kind: 'daprSidecar'
appId: 'mycontainer'
}
]
connections: {
statestore: {
source: statestore.id
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/author-apps/platform-resources/aws/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "AWS resources"
linkTitle: "AWS"
description: "Deploy and connect to AWS resources in your application"
weight: 900
categories: "Concept"
categories: "Overview"
tags: ["AWS"]
---

Expand Down
2 changes: 1 addition & 1 deletion docs/content/author-apps/platform-resources/azure/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Microsoft Azure resources"
linkTitle: "Microsoft Azure"
description: "Deploy and connect to Azure resources in your application"
weight: 800
categories: "Concept"
categories: "Overview"
tags: ["Azure"]
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Kubernetes resources"
linkTitle: "Kubernetes"
description: "Deploy and connect to Kubernetes resources in your application"
weight: 1000
categories: "Concept"
categories: "Overview"
tags: ["Kubernetes"]
---

Expand Down
8 changes: 4 additions & 4 deletions docs/content/getting-started/install/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ PowerShell for Cloud Shell is currently not supported.
{{% codetab %}}
{{< latest >}}
1. Download the `rad` CLI from one of these URLs:
- MacOS x64: https://get.radapp.dev/tools/rad/0.22/macos-x64/rad
- MacOS arm64: https://get.radapp.dev/tools/rad/0.22/macos-arm64/rad
- Linux x64: https://get.radapp.dev/tools/rad/0.22/linux-x64/rad
- Windows x64: https://get.radapp.dev/tools/rad/0.22/windows-x64/rad.exe
- MacOS x64: https://get.radapp.dev/tools/rad/0.23/macos-x64/rad
- MacOS arm64: https://get.radapp.dev/tools/rad/0.23/macos-arm64/rad
- Linux x64: https://get.radapp.dev/tools/rad/0.23/linux-x64/rad
- Windows x64: https://get.radapp.dev/tools/rad/0.23/windows-x64/rad.exe
1. Ensure the user has permission to execute the binary and place it somewhere on your PATH so it can be invoked easily.
{{< /latest >}}
{{< edge >}}
Expand Down
107 changes: 107 additions & 0 deletions docs/content/getting-started/quickstarts/quickstart-aws-s3/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
type: docs
title: "Quickstart: Deploy AWS resources"
linkTitle: "Deploy AWS resources"
description: "Learn about how to add AWS resources to your application and deploy them with Radius"
categories: "Quickstart"
tags: ["AWS"]

---

This quickstart will show you:

- How to model an AWS S3 resource in Bicep
- How to use a sample application to interact with AWS S3 bucket

<img src="./s3appdiagram.png" alt="Screenshot of the sample application to interact with s3 bucket " width=400>

## Prerequisites

- Make sure you have an [AWS account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account) and an [IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html)
- [Create an IAM AWS access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) and copy the AWS Access Key ID and the AWS Secret Access Key to a secure location for use later. If you have already created an Access Key pair, you can use that instead.
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
- Configure your CLI with [`aws configure`](https://docs.aws.amazon.com/cli/latest/reference/configure/index.html), specifying your configuration values
- [eksctl CLI](https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html)
- [kubectl CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/)

## Step 1: Create an EKS Cluster

Create an EKS cluster by using the `eksctl` CLI.

```bash
eksctl create cluster --name <my-cluster> --region=<my-region>
```

## Step 2: Create a Radius environment with the AWS cloud provider

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:

```bash
rad init
```

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:

- **Namespace** - When an application is deployed, this is the namespace where your containers and other Kubernetes resources will be run. By default, this will be in the `default` namespace.
{{% alert title="💡 About namespaces" color="success" %}} When you initialize a Radius Kubernetes environment, Radius installs the control plane resources within the `radius-system` namespace in your cluster, separate from your applications. The namespace specified in this step will be used for your application deployments.
{{% /alert %}}
- **Add AWS provider** - An [AWS cloud provider]({{<ref providers>}}) allows you to deploy and manage AWS resources as part of your application. Enter 'y' and follow the instructions. Provide a valid AWS region and the values obtained for IAM Access Key ID and IAM Secret Access Keys.
- **Environment name** - The name of the environment to create. You can specify any name with lowercase letters, such as `myawsenv`.

## Step 3: Create a Bicep file to model AWS Simple Storage Service (S3)

Create a new file called `app.bicep` and add the following bicep code to model an AWS S3 Bucket:

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

Radius uses the [AWS Cloud Control API](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/what-is-cloudcontrolapi.html) to interact with AWS resources. This means that you can model your AWS resources in Bicep and Radius will be able to deploy and manage them. You can find the list of supported AWS resources in the [AWS resource library]({{< ref "/author-apps/platform-resources/aws#resource-library" >}}).

## Step 4: Add a Radius container to interact with the AWS S3 Bucket

Open the `app.bicep` and append the following Radius resources:

{{< rad file="snippets/s3app.bicep" embed=true marker="//S3APP" >}}

Your final `app.bicep` file should look like this

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

This creates a container that will be deployed to your Kubernetes cluster. This container will interact with the AWS S3 Bucket you created in the previous step.

## Step 5: Deploy the application

1. Deploy your application to your environment:

```bash
rad deploy ./app.bicep -p aws_access_key_id=<AWS_ACCESS_KEY_ID> -p aws_secret_access_key=<AWS_SECRET_ACCESS_KEY>
```
> 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 %}}

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

```bash
rad resource expose containers frontend -a s3app --port 5234
```

1. Visit [localhost:5234](http://localhost:5234/swagger/index.html) in your browser. This is a swagger doc for the sample application. You can use this to interact with the AWS S3 Bucket you created. For example, you can try to upload a file to the bucket via the `/upload` endpoint.

<img src="./s3app.png" alt="Screenshot of the sample application to interact with s3 bucket " width=900>

## Step 6: Cleanup

1. When you're done with testing, you can use the rad CLI to [delete an environment]({{< ref rad_env_delete.md >}}) to delete all Radius resources running on the EKS Cluster.

2. Cleanup AWS Resources - AWS resources are not deleted when deleting a Radius environment, so make sure to delete all resources created in this reference app to prevent additional charges. You can delete these resources in the AWS Console or via the AWS CLI. Instructions to delete an AWS S3 Bucket are available [here](https://docs.aws.amazon.com/AmazonS3/latest/userguide/delete-bucket.html).

## Further Reading

{{< categorizeby category="Overview" tag="AWS" >}}

{{< categorizeby category="How-To" tag="AWS" >}}

{{< categorizeby category="Reference application" tag="AWS" >}}
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.
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import aws as aws
import radius as radius

param environment string

param bucket string

@secure()
param aws_access_key_id string

@secure()
param aws_secret_access_key string
import radius as radius

param aws_region string
@description('The name of your S3 bucket.The AWS S3 Bucket name must follow the [following naming conventions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html).')
param bucket string ='mys3bucket'

resource s3 'AWS.S3/Bucket@default' = {
alias: bucket
Expand All @@ -20,14 +12,28 @@ resource s3 'AWS.S3/Bucket@default' = {
}
}

// get a radius container which uses the s3 bucket
@description('The environment ID of your Radius application. Set automatically by the rad CLI.')
param environment string

resource app 'Applications.Core/applications@2022-03-15-privatepreview' = {
name: 'webapp'
name: 's3app'
properties: {
environment: environment
}
}

@description('IAM Access Key ID')
@secure()
param aws_access_key_id string

@description('IAM Access Key Secret')
@secure()
param aws_secret_access_key string

@description('Region where the S3 bucket is created. This will be the same region that you input when adding AWS cloudprovider to an environment in Radius.')
param aws_region string = 'us-west-2'

// get a radius container which uses the s3 bucket
resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = {
name: 'frontend'
properties: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import aws as aws

@description('The name of your S3 bucket.The AWS S3 Bucket name must follow the naming conventions described at https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html')
param bucket string ='mys3bucket-${uniqueString(resourceGroup().id)}'

resource s3 'AWS.S3/Bucket@default' = {
alias: bucket
properties: {
BucketName: bucket
}
}
Loading
Loading