diff --git a/.github/config/en-custom.txt b/.github/config/en-custom.txt index 8624fee94..7934bac7c 100644 --- a/.github/config/en-custom.txt +++ b/.github/config/en-custom.txt @@ -980,6 +980,7 @@ SRE SREs OSI ghcr +sharding png src todoapp @@ -1010,3 +1011,62 @@ sngm nmqpk fluentbit nmqpk +interoperate +ToDo +dfb +vhj +Helming +mv +secretName +bcd +jmgn +xgj +Fs +FsOjYzNzksYWJvcnRDb +JyYTNkN +LmRlbW +Ly +NjM +OQ +PUZhbHNl +VoNi +Yy +ZXIubG +ZjLmNsdXN +ZmFsc +bea +blockOwnerDeletion +cb +cmVkaXM +cmVkaXMtcjV +creationTimestamp +dWg +fb +jYWw +jbHVzdGVyLmxvY +kZW +ownerReferences +resourceVersion +uZWN +uc +uid +vLnN +wPw +yNXRjcnJhM +yZWRpcy +matchLabels +plc +cdf +dcf +Tanzu +Kubevela +curation +Waypoint +Crossplane +GitOps +stateful +DSL +unopinionated +Incubations +HCP +Backstage diff --git a/.github/workflows/redirect.yml b/.github/workflows/redirect.yml new file mode 100644 index 000000000..0390de50b --- /dev/null +++ b/.github/workflows/redirect.yml @@ -0,0 +1,48 @@ +name: Radius Redirect + +on: + workflow_dispatch: + push: + branches: + - edge + - v*.* + paths: + - 'redirect/**' + - '.github/workflows/redirect.yml' + pull_request: + branches: + - edge + - v*.* + paths: + - 'redirect/**' + - '.github/workflows/redirect.yml' + +jobs: + deploy-website: + name: Deploy Redirect Website + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + submodules: false + - name: Deploy staging site + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.SWA_REDIRECT_TOKEN }} + action: "upload" + app_location: "redirect/src" + skip_api_build: true + skip_app_build: true + + close_pr_site: + name: Close PR Staging Site + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.SWA_REDIRECT_TOKEN }} + action: "close" diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index 5c1c4679d..d9e275314 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -27,17 +27,11 @@ jobs: steps: - name: Check out repo uses: actions/checkout@v2 - - name: az CLI login - run: | - az login --service-principal \ - --username ${{ secrets.AZURE_SP_TESTS_APPID }} \ - --password ${{ secrets.AZURE_SP_TESTS_PASSWORD }} \ - --tenant ${{ secrets.AZURE_SP_TESTS_TENANTID }} - name: Parse release version and set environment variables run: python ./.github/scripts/get_docs_version.py - name: Download rad-bicep run: | - ./.github/scripts/curl-with-retries.sh https://get.radapp.dev/tools/bicep-extensibility/${{ env.DOCS_CHANNEL }}/linux-x64/rad-bicep --output rad-bicep + oras pull ghcr.io/radius-project/radius/bicep/rad-bicep/linux-x64:latest chmod +x rad-bicep ./rad-bicep --version - name: Verify Bicep files diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 830cab0e5..3080fa00b 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -38,7 +38,6 @@ jobs: repository: radius-project/radius ref: ${{ env.RELEASE_BRANCH }} path: ./radius - token: ${{ secrets.GH_RAD_CI_BOT_PAT }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -122,29 +121,14 @@ jobs: uses: Azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.ENV_STATICWEBAPP_TOKEN }} + skip_deploy_on_missing_secrets: true repo_token: ${{ secrets.GITHUB_TOKEN }} action: "upload" app_location: "site/" api_location: "site/" output_location: "" skip_app_build: true - - name: Find SWA Comment - uses: peter-evans/find-comment@v2 - id: fc - if: github.event_name == 'pull_request' - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: 'Azure Static Web Apps:' - direction: last - - name: Update SWA Comment - if: github.event_name == 'pull_request' && steps.fc.outputs.comment-id != '' - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - body: | - - **Password**: `Radiu$1234` + close_pr_site: name: Close PR Staging Site @@ -159,6 +143,7 @@ jobs: uses: Azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.ENV_STATICWEBAPP_TOKEN }} + skip_deploy_on_missing_secrets: true action: "close" algolia_index: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1015e254..f57a8067e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,23 @@ # Contributing to Radius documentation Thank you for your interesting in contributing to the Radius documentation! For more information please refer to [https://docs.radapp.io/community/contributing/docs/](https://docs.radapp.io/community/contributing/docs/) + +## Developer Certificate of Origin + +The Radius project follows the [Developer Certificate of Origin](https://developercertificate.org/). This is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. + +Contributors sign-off that they adhere to these requirements by adding a Signed-off-by line to commit messages. + +``` +This is my commit message + +Signed-off-by: Random J Developer +``` + +Git even has a -s command line option to append this automatically to your commit message: + +``` +$ git commit -s -m 'This is my commit message' +``` + +Visual Studio Code has a setting, `git.alwaysSignOff` to automatically add a Signed-off-by line to commit messages. Search for "sign-off" in VS Code settings to find it and enable it. diff --git a/README.md b/README.md index 85588b5a0..b364ce4b1 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The latest release docs are available at https://radapp.io ### Edge docs -Edge docs are available at https://edge.radapp.io +Edge docs are available at https://edge.docs.radapp.io ### Staging docs diff --git a/docs/content/_index.md b/docs/content/_index.md index 9c0f44944..5915cf8c2 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -27,7 +27,7 @@ Radius is a cloud native application platform. It enables developers and IT ope {{< /card >}} {{< /cardpane >}} {{< cardpane >}} - {{< card header="**๐Ÿ’ญ Concepts**" footer="[**Learn the concepts โ†’**]({{< ref tutorials >}})" >}} + {{< card header="**๐Ÿ’ญ Concepts**" footer="[**Learn the concepts โ†’**]({{< ref concepts >}})" >}} Learn about the background and concepts behind Radius with in-depth explanations. We'll cover the main concepts and how Radius works, so you have the broader context to deeply understand Radius and use it most effectively. {{< /card >}} {{< card header="**๐Ÿงพ Reference**" footer="[**Visit reference material โ†’**]({{< ref guides >}})" >}} diff --git a/docs/content/community/_index.md b/docs/content/community/_index.md index f0fd89bda..96daf0a19 100644 --- a/docs/content/community/_index.md +++ b/docs/content/community/_index.md @@ -3,5 +3,5 @@ type: docs title: "Radius Community" linkTitle: "Community" description: "Information about the Radius community" -weight: 80 +weight: 90 --- diff --git a/docs/content/community/contributing/contributing-docs/index.md b/docs/content/community/contributing/contributing-docs/index.md index 15d481cd7..cab4ec1f4 100644 --- a/docs/content/community/contributing/contributing-docs/index.md +++ b/docs/content/community/contributing/contributing-docs/index.md @@ -89,6 +89,26 @@ It's easy to get up and running with a GitHub Codespace. This will give you a fu 3. Navigate to `http://localhost:1313/` +## Developer Certificate of Origin + +The Radius project follows the [Developer Certificate of Origin](https://developercertificate.org/). This is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. + +Contributors sign-off that they adhere to these requirements by adding a Signed-off-by line to commit messages. + +``` +This is my commit message + +Signed-off-by: Random J Developer +``` + +Git even has a -s command line option to append this automatically to your commit message: + +``` +$ git commit -s -m 'This is my commit message' +``` + +Visual Studio Code has a setting, `git.alwaysSignOff` to automatically add a Signed-off-by line to commit messages. Search for "sign-off" in VS Code settings to find it and enable it. + ## Types of docs There are 5 types of docs in Radius: diff --git a/docs/content/community/contributing/github.md b/docs/content/community/contributing/github.md index 84743cea3..1273f5dfb 100644 --- a/docs/content/community/contributing/github.md +++ b/docs/content/community/contributing/github.md @@ -8,10 +8,6 @@ weight: 200 Radius is a community-driven project that lives on GitHub within the [Radius organization](https://github.com/radius-project). -## Access - -Visit https://aka.ms/ProjectRadius/GitHubAccess to request access to the Radius GitHub organization. - ## Source code The source code for Radius is available on GitHub within the [radius repo](https://github.com/radius-project/radius). diff --git a/docs/content/community/overview.md b/docs/content/community/overview.md index 4bf144fb6..85b143b7d 100644 --- a/docs/content/community/overview.md +++ b/docs/content/community/overview.md @@ -12,34 +12,11 @@ Welcome to the Radius community! 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" >}} +{{< button link="https://aka.ms/radius/discord" 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 community can participate, present a topic, or host. All are welcome! - -### Meeting link - -The meeting link and details are sent out via email. - -### Present your topic - -To present a specific topic on the next Radius community call start by filling out this short form, [Radius community call presenter sign-up form](https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbRw_b7M-8iE1NkIMvs0xAJFFUQlozVThYSzI4OVhRU0E3NlI0U05GNzZFTi4u). - -### Calendar - -| Date | Topic(s) | Meeting Link | Recording | -|------|----------|--------------|-----------| -| Thursday Feb 16th 9:00am Pacific Time (PST) | v0.17 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-02-16%20Project%20Radius%20Community%20Call.mp4?csf=1&web=1&e=u11ceV) | -| Thursday Mar 16th 9:00am Pacific Time (PST) | v0.18 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-03-16%20Project%20Radius%20Community%20Call.mp4?csf=1&web=1&e=LMW6HE) | -| Thursday Apr 20th 9:00am Pacific Time (PST) | v0.19 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-04-20%20Project%20Radius%20Community%20Call.mp4?csf=1&web=1&e=RCA5Qx) | -| Thursday May 18th 9:00am Pacific Time (PST) | v0.20 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-05-18%20Project%20Radius%20Community%20Call.mp4?csf=1&web=1&e=fKcbzm) | -| Thursday June 15th 9:00am Pacific Time (PST) | v0.21 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-06-15%20Project%20Radius%20Community%20Call.mp4?csf=1&web=1&e=WIRhP5) | -| Thursday July 13th 9:00am Pacific Time (PST) | v0.22 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-07-13%20Project%20Radius%20Community%20Call.mp4?csf=1&web=1&e=v30w8D) | -| Thursday Aug 8th 9:00am Pacific Time (PST) | v0.23 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-08-08%20Project%20Radius%20Community%20Call.mp4?csf=1&web=1&e=6Lew1D&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZyIsInJlZmVycmFsQXBwUGxhdGZvcm0iOiJXZWIiLCJyZWZlcnJhbE1vZGUiOiJ2aWV3In19) | -| Thursday Aug 31st 9:00am Pacific Time (PST) | v0.24 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-08-31%20Radius%20Community%20Call.mp4?csf=1&web=1&e=YBjiMv&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZyIsInJlZmVycmFsQXBwUGxhdGZvcm0iOiJXZWIiLCJyZWZlcnJhbE1vZGUiOiJ2aWV3In19) | -| Tuesday, Oct 2nd 9:00am Pacific Time (PST) | v0.25 release | - | [Stream](https://microsoft.sharepoint.com/:v:/r/teams/radius/Shared%20Documents/General/Community%20Calls/2023-10-03%20Radius%20Community%20Call.mp4?csf=1&web=1&e=9iXqbg) +Every month we host a community meeting to showcase new features, review upcoming milestones, and engage in a Q&A. Anyone from the Radius community can participate, present a topic, or host. All are welcome! For the meeting schedule, links, and more information, visit the Radius [community repo](https://github.com/radius-project/community#community-meetings). ## GitHub Issues & repositories diff --git a/docs/content/concepts/api-concept/index.md b/docs/content/concepts/api-concept/index.md index 27a43f918..10930fb4e 100644 --- a/docs/content/concepts/api-concept/index.md +++ b/docs/content/concepts/api-concept/index.md @@ -64,7 +64,7 @@ The common structure of a resource id is the following: ### Root scope -A hierarchical set of key-value pairs that identify the original of the resource. Root scopes answer questions like: +A hierarchical set of key-value pairs that identify the origin of the resource. Root scopes answer questions like: - *"What cloud is this resource from?"* - *"What cloud account contains this resource?"* @@ -201,4 +201,4 @@ AWS: Radius: -- [API Reference]({{< ref resource-schema >}}) \ No newline at end of file +- [API Reference]({{< ref resource-schema >}}) diff --git a/docs/content/concepts/architecture-concept/index.md b/docs/content/concepts/architecture-concept/index.md index 0f28f3bf7..372764235 100644 --- a/docs/content/concepts/architecture-concept/index.md +++ b/docs/content/concepts/architecture-concept/index.md @@ -43,7 +43,7 @@ The service that performs this central functionality in Radius is called the Uni UCP contains functionality for federating with separate resource managers as well as its resource providers. For example UCP can route requests to Azure or AWS to manage resources on those cloud systems. -UCP is a scalable REST API that can function either with a single global shard or using regional sharing. UCP is based on the design principles of the Azure Resource Manager (ARM) control-plane but generalizes to work across multiple clouds and systems. The UCP codebase is fully open-source and was created from scratch as part of the Radius project. UCP is written in Go. +UCP is a scalable REST API that can function either with a single global shard or using regional sharding. UCP is based on the design principles of the Azure Resource Manager (ARM) control-plane but generalizes to work across multiple clouds and systems. The UCP codebase is fully open-source and was created from scratch as part of the Radius project. UCP is written in Go. UCP provides routing and federation with internal and external services: diff --git a/docs/content/concepts/faq/index.md b/docs/content/concepts/faq/index.md new file mode 100644 index 000000000..58925a22d --- /dev/null +++ b/docs/content/concepts/faq/index.md @@ -0,0 +1,181 @@ +--- +type: docs +title: "Frequently asked questions" +linkTitle: "FAQ & Comparisons" +description: "Commonly asked questions about best practices" +weight: 999 +--- + +## General + +### Is Kubernetes required to use Radius? + +Currently yes. Although Radius is architected to run on any platform, today Kubernetes is the only hosting platform for Radius for the Radius control-plane and for containerized workloads. In the future, we plan to support other hosting platforms for serverless platforms. + +### Can I incrementally adopt, or "try out" Radius? + +Yes. The easiest way to add Radius to an existing application is through [Radius annotations](#TODO). Simply add the annotations to your existing Helm chart or Kubernetes YAML and you can use the Radius app graph, connections, and Recipes. [Try the tutorial](#TODO) to learn more. + +### Do I have to self-host Radius? Is there a managed service for Radius? + +Open-source Radius requires that you self-host and run your own Radius instance in your Kubernetes cluster. In the future, we hope for providers to include Radius as a part of their managed service offerings. + +### What languages does Radius support? + +For application code, Radius supports any programming language as long as it is containerized. + +Radius resources (_applications, environments, portable resource_) can be authored in Bicep. See the [Radius resource schema]({{< ref resource-schema >}}) for more details. Additional support for other languages (_like Terraform_) is on our backlog. + +Recipes support both Bicep and Terraform. See the [Recipe docs]({{< ref "/guides/recipes/overview" >}}) for more details. + +### When would/should I use more than one environment? + +Users can employ multiple environments for isolation and organization, for example based on: + +- Permissions (managed at the Resource Group/Subscription level in Azure) +- Purpose (dev vs. prod) +- Difference in hosting (standalone Kubernetes vs Microsoft Azure) +- Multi-region deployments (deploy an application to multiple regions) + +[Workspaces]({{< ref "/guides/operations/workspaces/overview" >}}) can be used to manage multiple environments from one machine. + +## Recipes + +### What resources do Recipes support? + +Recipes currently support the set of [Radius portable resources]({{< ref "/guides/author-apps/portable-resources/overview" >}}): Redis, Mongo, RabbitMQ, SQL, Dapr State Stores, Dapr Secret Stores, Dapr Pub/Sub, and the untyped extender resource. Additional support for other resources (_Azure, AWS, etc._) will come in a future release. + +### What infrastructure can Recipes deploy? + +Radius Recipes support any resources that can be modeled in Bicep, or the AWS, Azure, and Kubernetes Terraform providers. + +### Can I use any Terraform provider with Recipes? + +Terraform Recipes currently support the Azure, AWS, and Kubernetes providers, plus any provider that does not require any credentials or configuration to be passed in (_e.g. Oracle, GCP, etc. are not currently supported_). Support for provider configuration is a high priority we plan to address in an upcoming release. + +### Do developers need write access to a cloud provider (_Azure subscription, AWS account, etc._) to use Recipes? + +No. Recipes are deployed on-behalf-of the Radius Environment so developers do not need any write access to an Azure subscription, resource group, or AWS account. This allows a least-privilege access model to cloud resources and for IT operators to only allow approved IaC templates to be deployed to their cloud environments. + +## Cloud/platform support + +### What AWS services does Radius support? + +Radius Applications can include AWS services that are also supported by the AWS cloud control API. See the [AWS resource library]({{< ref "/guides/author-apps/aws/overview#resource-library" >}}) for the complete list of supported AWS resources. Connections from a Radius container to an AWS resource are not yet supported. Properties such as hostnames, ports, endpoints, and connection strings need to be manually specified as environment variables. Additional support for Connections to AWS resources is on our backlog. + +### What Azure services does Radius support? + +Radius Applications can include any Azure service, with support for direct connections and managed identities. Compute services (Web Apps, Container Apps, App Service, Functions, Logic Apps, and others) can be deployed but cannot currently declare connections to other resources. + +### Does Radius support Google Cloud Platform (GCP)? + +Not yet, but it is on the backlog. + +### Does Radius support Dapr? + +Yes. Radius has first-class support for [Dapr building blocks]({{< ref "/guides/author-apps/dapr" >}}) such as state stores, secret stores, and pub/sub brokers. Developers can add Dapr resources to their applications and operators can define Recipes that deploy and manage the underlying infrastructure. + +## Comparison to other tools + +### How does Radius compare to Kubernetes? + +[Kubernetes](https://kubernetes.io/) is an open-source system for automating deployment, scaling, and management of containerized applications and custom resources. + +Radius leverages Kubernetes in two ways: + +1. As a hosting platform for the Radius control-plane +2. As a runtime for containerized workloads + +While Radius only supports Kubernetes today, it is architected to support other hosting platforms in the future, including serverless platforms. Radius is not a Kubernetes controller and the primary user experience is not through CRDs. Instead, Radius Applications are an abstraction layer on top of Kubernetes and other cloud platforms. + +### How does Radius compare to Helm? + +[Helm](https://helm.sh/) is a package manager for Kubernetes that allows you to define, install, and upgrade Kubernetes applications. Helm is a great tool for deploying Kubernetes objects, but doesn't provide a way to model dependencies between services and infrastructure, or to define and manage infrastructure-as-code. It also only supports Kubernetes as a targeted platform. + +Radius was built to provide a platform for modeling and deploying an entire application, as cloud-native applications are more than just Kubernetes. They include cloud infrastructure, running services, the underlying platforms, and all the connections between them. + +Teams looking to leverage existing Helm charts can use the [Radius annotations and Recipe CRD](#TODO) to add Radius capabilities to their existing application. With just a few annotations, you can add the power of the Radius app graph, connections, and Recipes to your existing Helm chart. + +Teams building or migrating applications on Radius can use Bicep to model their application and deploy to Kubernetes today, as well as future platforms, including serverless platforms. + +### How does Radius compare to Bicep? + +[Bicep](https://github.com/Azure/bicep) is a Domain Specific Language (DSL) for deploying infrastructure declaratively. Radius leverages Bicep as one of its supported languages for defining applications and Recipes. + +Similar to how you can define Azure resources in Bicep, you can define Radius resources in Bicep. + +Radius currently uses a temporary fork of Bicep to add support for the Radius resources, but work is underway to merge extensibility support into the main Bicep repo and eliminate the need for a fork. + +### How does Radius compare to Terraform? + +[Terraform](https://www.terraform.io/) is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform is a great tool for deploying infrastructure, but doesn't provide a way to model an entire application and the dependencies between services and infrastructure, or act as an abstraction layer for multiple cloud providers. + +Teams looking to leverage existing Terraform modules can use [Recipes]({{< ref "/guides/recipes/overview" >}}) to manage infrastructure provisioning, with the application defined in Bicep. The ability to define Radius applications in Terraform in addition to Bicep is on the roadmap. + +### How does Radius compare to Dapr? + +[Dapr](https://dapr.io/) is a portable, event-driven runtime that makes it easy for developers to build resilient, microservice stateless and stateful applications that run on the cloud and edge. Dapr is a great tool for writing microservice code, but doesn't provide a way to model or deploy an entire application and its infrastructure. + +Radius provides [built-in Dapr support]({{< ref "/guides/author-apps/dapr" >}}) to make it easy to model Dapr building blocks and Dapr-enabled services within your app. Like peanut butter and jelly, Radius and Dapr are better together. + +### How does Radius compare to Acorn? + +[Acorn](https://www.acorn.io/) is a cloud platform to build and share applications ("acorns"). It provides a dev environment with the ability to move to cloud environments as part of a paid service. + +Radius is an open-source project that allows you to model, deploy, and manage applications across multiple cloud providers. Radius is not a hosting platform and is not a paid service. Instead, Radius allows you to host your own Radius environments on your own Kubernetes clusters, and deploy applications to any cloud provider or on-premises infrastructure. Radius also offers Recipes and the Application Graph to allow developers and operators to work together on an application. + +### How does Radius compare to Crossplane? + +[Crossplane](https://crossplane.io/) is an open source Kubernetes add-on that extends any cluster with the ability to provision and manage cloud infrastructure, services, and applications using kubectl, GitOps, or any tool that works with the Kubernetes API. As Radius is unopinionated about how infrastructure is deployed through Recipes, Crossplane could be used within a Recipe. Both Bicep and Terraform modules are able to include Kubernetes resources and Crossplane CRDs. + +Once deployed, Crossplane-managed infrastructure can be included in a Radius application and queried via the Radius application graph. + +### How does Radius compare to Open Application Model (OAM)? + +[OAM](https://oam.dev) is a specification for describing applications so that the application description is separated from the details of how the application is deployed onto and managed by the infrastructure. It originated from the Azure Incubations team from which Radius also originated. + +The key difference between OAM and Radius is that OAM is a spec, whereas Radius is an implementation. The expectation with OAM is that there would be a common spec and if it was successful, there would be multiple (compatible) implementations of OAM for various platforms. [Kubevela](https://github.com/kubevela/kubevela) is one example of an OAM implementation. + +Radius is a new project that takes what we learned from OAM and focuses more on the hosting platforms and the developer/operator experience, not just the spec. With Radius we're providing an implementation that's meant to be re-used and hosted in different scenarios. Right now we're focused on Kubernetes. Radius is also taking a more holistic approach with Radius that's bigger than just compute and networking. We're doing more to work with existing tools like Terraform as well that are outside of Kubernetes. Lastly, Radius puts a lot of emphasis on the developer and operator handoff by building features such as Recipes and Environments that bind an application to different cloud providers and runtime platforms. + +### How does Radius compare to Waypoint? + +[HCP Waypoint](https://developer.hashicorp.com/hcp/docs/waypoint) is a HashiCorp-managed application deployment platform that simplifies the process of deploying applications into your infrastructure and helps you standardize your deployment process. + +While Radius also is able to model and deploy applications, it also provides an application graph and Recipes to offer an end-to-end platform that is application-focused at every stage. Radius is more than an abstraction and deployment automation. The Radius app graph allows teams to understand their entire application and all the dependencies within it, even after an application is deployed. Recipes are also more than template automation. They provide abstraction + encapsulation so developers never are required to directly interact with cloud infrastructure templates or parameters. + +### How does Radius compare to Tanzu? + +[Tanzu](https://tanzu.vmware.com/) is a portfolio of products and services for modernizing applications and infrastructure with a common goal: deliver better software to production, continuously. + +Radius is an open-source project that provides a platform for modeling and deploying applications. Radius is not a paid product or service. Instead, Radius allows you to host your own Radius environments on your own Kubernetes clusters, and deploy applications to any cloud provider or on-premises infrastructure. Radius provides differentiated value through Recipes and the Application Graph. Recipes make it easier for developers and platform engineers/IT engineers to collaborate when building cloud native apps. The Application Graph makes it easier to see all of the various components that make up a cloud native application. + +### How does Radius compare to Backstage? + +[Backstage](https://backstage.io/) is an open platform for building developer portals. It provides a common way to define and manage services, and a central place for developers to discover and connect to those services. + +Radius and the application graph could easily fit into Backstage as a plugin. This is on our backlog and is being explored. + +### How does Radius compare to Azure Deployment Environments? + +[Azure Deployment Environments](https://azure.microsoft.com/products/deployment-environments/) allow developers to quickly spin up infrastructure environments with project-based templates. It handles template curation via catalogs of templates, and provides a self-service experience for developers to deploy and manage their environments without needing direct access to the underlying Azure resource groups. + +Radius Recipes provide a similar experience for developers to deploy and manage infrastructure, but with a few key differences: + +- Recipes are defined on a per-resource basis instead of per-environment. This allows developers to "mix and match" resources in any combination and swap out the backing Recipe depending on which environment they are targeting. +- Recipes support both Bicep and Terraform, allowing operators to leverage existing Terraform modules. +- Recipes support both Azure and AWS, allowing operators to manage infrastructure across multiple cloud providers. + +### How does Radius compare to Azure Arc? + +[Azure Arc](https://azure.microsoft.com/services/azure-arc/) is a set of technologies that extends Azure management and services to any infrastructure. It brings Azure services and management to any infrastructure. + +Radius is an open-source project that provides a platform for modeling and deploying applications that can run across Azure, AWS, or private clouds. Instead of extending an existing cloud platform, Radius is a new platform that sits above existing cloud platforms and provides a consistent way to model and deploy applications across these platforms. + +While there isn't direct support for targeting Azure Arc for Radius containers today, Arc services and infrastructure can be modeled and deployed using [Recipes]({{< ref "/guides/recipes/overview" >}}). + +### How does Radius compare to Azure Container Apps? + +[Azure Container Apps](https://azure.microsoft.com/products/container-apps/) is a service that allows developers to deploy containerized applications to Azure without managing any infrastructure. + +While Radius only supports Kubernetes today, it is architected to support other hosting platforms in the future, including serverless platforms such as Azure Container Apps. Serverless support is on our roadmap. diff --git a/docs/content/concepts/why-radius-concept/index.md b/docs/content/concepts/why-radius-concept/index.md index aa5a2e25d..68add0a2c 100644 --- a/docs/content/concepts/why-radius-concept/index.md +++ b/docs/content/concepts/why-radius-concept/index.md @@ -3,7 +3,7 @@ type: docs title: "Concept: Why Radius?" linkTitle: "Why Radius?" description: "Describes the motivations for creating Radius." -weight: 300 +weight: 100 categories: "Concept" --- diff --git a/docs/content/getting-started/index.md b/docs/content/getting-started/index.md index e2425f0b7..007020c1c 100644 --- a/docs/content/getting-started/index.md +++ b/docs/content/getting-started/index.md @@ -22,6 +22,12 @@ The Radius getting-started guide can be [run **for free** in a GitHub Codespace] [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/radius-project/samples) {{< /alert >}} +{{< alert title="๐Ÿš€ Run in a free GitHub Codespace" color="primary" >}} +The Radius getting-started guide can be [run **for free** in a GitHub Codespace](https://github.blog/changelog/2022-11-09-codespaces-for-free-and-pro-accounts/). Visit the following link to get started in seconds: + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/radius-project/samples) +{{< /alert >}} + ## 1. Have your Kubernetes cluster handy Radius runs inside [Kubernetes]({{< ref "guides/operations/kubernetes" >}}). However you run Kubernetes, get a cluster ready. diff --git a/docs/content/guides/author-apps/portable-resources/overview/portable-resources.png b/docs/content/guides/author-apps/portable-resources/overview/portable-resources.png index 607bf52b3..300f27aac 100644 Binary files a/docs/content/guides/author-apps/portable-resources/overview/portable-resources.png and b/docs/content/guides/author-apps/portable-resources/overview/portable-resources.png differ diff --git a/docs/content/guides/recipes/overview/index.md b/docs/content/guides/recipes/overview/index.md index fff130d46..9d528831f 100644 --- a/docs/content/guides/recipes/overview/index.md +++ b/docs/content/guides/recipes/overview/index.md @@ -16,10 +16,10 @@ Recipes enable a **separation of concerns** between infrastructure operators and ### Support for multiple IaC languages -| Language | Supported sources | -|----------|-------------------| -| [Bicep](https://learn.microsoft.com/azure/azure-resource-manager/bicep/) | [OCI registries](https://opencontainers.org/) | -| [Terraform](https://developer.hashicorp.com/terraform/docs) | [Public Terraform registries](https://registry.terraform.io/) | +| Language | Supported sources | Notes | +|----------|-------------------|-------| +| [Bicep](https://learn.microsoft.com/azure/azure-resource-manager/bicep/) | [OCI registries](https://opencontainers.org/) | Supports Azure, AWS, and Kubernetes +| [Terraform](https://developer.hashicorp.com/terraform/docs) | [Public Terraform registries](https://registry.terraform.io/) | Supports Azure, AWS, and Kubernetes providers
Other providers not yet configurable ### Select the Recipe that meets your needs diff --git a/docs/content/reference/_index.md b/docs/content/reference/_index.md index 796a51a47..30d41b833 100644 --- a/docs/content/reference/_index.md +++ b/docs/content/reference/_index.md @@ -3,5 +3,5 @@ type: docs title: "Radius reference documentation" linkTitle: "Reference" description: "Detailed reference documentation on various Radius components" -weight: 90 +weight: 100 --- diff --git a/docs/content/reference/faq.md b/docs/content/reference/faq.md deleted file mode 100644 index e24d471d6..000000000 --- a/docs/content/reference/faq.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -type: docs -title: "Frequently asked questions" -linkTitle: "FAQ" -description: "Commonly asked questions about best practices" -weight: 999 ---- - -## General - -### Is Kubernetes required to use Radius? - -Currently yes. Today Kubernetes is the only hosting platform for Radius. We are working on additional hosting platforms and container runtimes, so stay tuned for updates. - -### Can I incrementally adopt, or "try out" Radius? - -Yes. Teams can incrementally adopt the Radius platform as they write new applications or add existing applications. Direct connections allow apps with existing platform dependencies (such as Azure and AWS) move to Radius without any code rewrites. Dapr support allows existing Dapr apps to be brought to Radius without any code rewrites as well. Portability and automation can be layered on with Radius portable resources and Recipes. In the future we will add Kubernetes YAML support which enables developers to wrap their existing Kubernetes YAML objects in a Radius container so that they may bring their existing deployments and pods as-is into a Radius Application. - -### Do I have to self-host Radius? Is there a managed service for Radius? - -Open-source Radius requires that you self-host and run your own Radius instance in your Kubernetes cluster. In the future, we hope for providers to include Radius as a part of their managed service offerings. Stay tuned for updates. - -### What languages does Radius support? - -For application code, Radius supports any programming language as long as it is containerized. - -Radius resources (_applications, environments, portable resource_) can be authored in Bicep. See the [Radius resource schema]({{< ref resource-schema >}}) for more details. Additional support for other languages will come in a future release. Stay tuned for updates. - -Recipes support both Bicep and Terraform. See the [Recipe docs]({{< ref "/guides/recipes/overview" >}}) for more details. Additional support for other languages will come in a future release. Stay tuned for updates. - -## Environments - -### Can I connect to an existing environment? - -Yes. When you initialize an environment via `rad init`, you can provide an existing Kubernetes cluster context. Radius will update your `config.yaml` file with the appropriate values. - -### When would/should I use more than one environment? - -Users can employ multiple environments for isolation and organization, for example based on: -- Permissions (managed at the Resource Group/Subscription level in Azure) -- Purpose (dev vs. prod) -- Difference in hosting (standalone Kubernetes vs Microsoft Azure) - -## Recipes - -### What resources can Recipes deploy? - -Radius Recipes support any resources that can be modeled in Bicep, or the AWS, Azure, and Kubernetes Terraform providers. Additional Terraform providers will be offered in an upcoming release. - -### What resources do Recipes support? - -Recipes currently support the set of Radius portable resources: Redis, Mongo, RabbitMQ, SQL, Dapr State Stores, Dapr Secret Stores, Dapr Pub/Sub, the untyped extender resource, and more to come in the future. See the [Radius resource schema]({{< ref resource-schema >}}) for more details. Additional support for other resources (Azure, AWS, etc.) will come in a future release. Stay tuned for updates. - -### Do developers need contributor or owner access to a cloud provider (Azure subscription, AWS account, etc.) to leverage Radius Recipes? - -No. Recipes are deployed on-behalf-of the Radius Environment so developers do not need any write access to an Azure subscription, resource group, or AWS account. This allows a least-privilege access model to cloud resources and for IT operators to only allow approved IaC templates to be deployed to their cloud environments. - -### Why do I need to manually output a Kubernetes UCP ID as part of my Bicep Recipe? - -The Bicep deployment engine currently does not output Kubernetes resource (UCP) IDs upon completion, meaning Recipes cannot automatically link a Recipe-enabled resource to the underlying infrastructure. This also means Kubernetes resources are not automatically cleaned up when a Recipe-enabled resource is deleted. - -To fix this, you can manually build and output UCP IDs, which will cause the infrastructure to be linked to the resource: - -```bicep -import kubernetes as k8s { - kubeConfig: '' - namespace: 'default' -} - -resource deployment 'apps/Deployment@v1' = {...} - -resource service 'core/Service@v1' = {...} - -output values object = { - resources: [ - // Manually build UCP IDs (/planes//local/namespaces//providers///) - '/planes/kubernetes/local/namespaces/${deployment.metadata.namespace}/providers/apps/Deployment/${deployment.metadata.name}' - '/planes/kubernetes/local/namespaces/${service.metadata.namespace}/providers/core/Service/${service.metadata.name}' - ] -} -``` - -## Bicep templates - -### Can one bicep file represent more than one application? - -Yes. You can have multiple application resources defined in one file. - -### Can a bicep file represent something other than applications? - -Yes. Bicep files can contain both Radius resources and Azure resources. Everything in a Bicep file becomes an ARM deployment. - -## Resources - -### Can I modify a resource after it's been deployed? - -Yes. You will need to modify the resource definition in your .bicep file's application definition and re-deploy the application. - -### What AWS services does Radius support - -Radius Applications can include AWS services that are also supported by the AWS cloud control API. See the [AWS resource library]({{< ref "/guides/author-apps/aws/overview#resource-library" >}}) for the complete list of supported AWS resources. Radius does not currently support direct connections to AWS resources, but it is on the backlog. Stay tuned for updates. - -### What Azure services does Radius support? - -Radius Applications can include any non-compute Azure service, with support for direct connections and managed identities. Compute services (Web Apps, Container Apps, App Service, Functions, Logic Apps, and others) will be added in a future release. - -### Does Radius support Google Cloud Platform (GCP)? - -Not yet, but it is on the backlog. Stay tuned for updates. - -### Does Radius support Dapr? - -Yes. Radius has first-class support for Dapr building blocks such as state stores, secret stores, and pub/sub brokers. Developers can add Dapr resources to their applications and operators can define Recipes that deploy and manage the underlying infrastructure. diff --git a/docs/content/reference/limitations.md b/docs/content/reference/limitations.md index 3b7d0ddd9..c6d3eb56f 100644 --- a/docs/content/reference/limitations.md +++ b/docs/content/reference/limitations.md @@ -56,6 +56,33 @@ When running `rad env show`, the `lastmodifiedat` and `createdat` fields display This will be addressed in an upcoming release. +## Recipes + +### Kubernetes Bicep resources require manual UCP ID output + +The Bicep deployment engine currently does not output Kubernetes resource (UCP) IDs upon completion, meaning Recipes cannot automatically link a Recipe-enabled resource to the underlying infrastructure. This also means Kubernetes resources are not automatically cleaned up when a Recipe-enabled resource is deleted. + +To fix this, you can manually build and output UCP IDs, which will cause the infrastructure to be linked to the resource: + +```bicep +import kubernetes as k8s { + kubeConfig: '' + namespace: 'default' +} + +resource deployment 'apps/Deployment@v1' = {...} + +resource service 'core/Service@v1' = {...} + +output values object = { + resources: [ + // Manually build UCP IDs (/planes//local/namespaces//providers///) + '/planes/kubernetes/local/namespaces/${deployment.metadata.namespace}/providers/apps/Deployment/${deployment.metadata.name}' + '/planes/kubernetes/local/namespaces/${service.metadata.namespace}/providers/core/Service/${service.metadata.name}' + ] +} +``` + ## Bicep & Deployment Engine ### Currently using a forked version of Bicep diff --git a/docs/content/reference/resource-schema/aws/index.md b/docs/content/reference/resource-schema/aws/index.md index a9c1d64de..995997ca7 100644 --- a/docs/content/reference/resource-schema/aws/index.md +++ b/docs/content/reference/resource-schema/aws/index.md @@ -10,8 +10,6 @@ Radius supports AWS resource types that are supported by the [AWS Cloud Control Following table lists the resource types that are currently supported and the limitations for each of the resource types. -> *If you don't have access to the Bicep-types-aws github repo, please visit https://aka.ms/ProjectRadius/GitHubAccess to request access to the Radius GitHub organization.* - | Resource Type | Notes | | ------------- | ----- | | **[AWS::ACMPCA::Certificate](https://github.com/radius-project/bicep-types-aws/blob/main/artifacts/bicep/aws/aws.acmpca/default/types.md)** | โš  This resource type is non-idempotent. See [here](https://github.com/radius-project/bicep-types-aws/blob/main/docs/reference/limitations.md) for more information. | diff --git a/docs/content/tutorials/helm/demo-screenshot.png b/docs/content/tutorials/helm/demo-screenshot.png new file mode 100644 index 000000000..0d9f25d79 Binary files /dev/null and b/docs/content/tutorials/helm/demo-screenshot.png differ diff --git a/docs/content/tutorials/helm/demo-with-redis-screenshot.png b/docs/content/tutorials/helm/demo-with-redis-screenshot.png new file mode 100644 index 000000000..77caa8eac Binary files /dev/null and b/docs/content/tutorials/helm/demo-with-redis-screenshot.png differ diff --git a/docs/content/tutorials/helm/demo-with-todolist.png b/docs/content/tutorials/helm/demo-with-todolist.png new file mode 100644 index 000000000..6bab2cb7d Binary files /dev/null and b/docs/content/tutorials/helm/demo-with-todolist.png differ diff --git a/docs/content/tutorials/helm/diagram.png b/docs/content/tutorials/helm/diagram.png new file mode 100644 index 000000000..8c65eb5ef Binary files /dev/null and b/docs/content/tutorials/helm/diagram.png differ diff --git a/docs/content/tutorials/helm/index.md b/docs/content/tutorials/helm/index.md new file mode 100644 index 000000000..33343bc59 --- /dev/null +++ b/docs/content/tutorials/helm/index.md @@ -0,0 +1,641 @@ +--- +type: docs +title: "Tutorial: Use Helm to run your first app" +linkTitle: "Run app using Helm" +weight: 200 +description: "Take a tour of Radius by updating an existing Helm chart to add Radius support." +categories: "Tutorial" +tags : ["kubernetes", "helm"] +--- + +This tutorial will teach you the following about Radius: + +* How to use update a Helm chart to include its resources in a Radius application +* How to use features like Recipes and Connections within Kubernetes YAML or Helm + +Diagram of the application and its resources + +## Prerequisites + +- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}}) +- [Helm](https://helm.sh/docs/intro/install/) +- [Setup a supported Kubernetes cluster]({{< ref "/guides/operations/kubernetes/overview#supported-clusters" >}}) + +## Step 1. Clone and open the sample code + +{{< tabs "Codespace" "Local machine" >}} + +{{% codetab %}} + +It's easy and free to get up and running with a Radius Codespace in GitHub. Spin up a Radius environment in seconds with the following link: + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/radius-project/samples) + +Once launched you should already have the application cloned locally. Use the terminal to navigate to the `./demo/` directory: + +```bash +cd ./samples/demo +``` +{{% /codetab %}} + +{{% codetab %}} +Use the terminal to clone the `samples` repository locally and navigate to the `./samples/demo` directory: + +```bash +git clone https://github.com/radius-project/samples.git +cd ./samples/samples/demo +``` +{{% /codetab %}} + +{{< /tabs >}} + + +## Step 2. Initialize Radius + +Initialize Radius. For this example, answer **NO** when asked whether to set up an application: + +> Select 'No' when prompted to create an application. + +```bash +rad init +``` + +## Step 3. Understand and deploy the application + +1. Navigate to the `./Chart` folder and browse its contents. This contains a Helm chart for the application that you will modify. + + Here are the contents of `./demo/Chart/templates/app.yaml`. This file is part of the Helm chart, and describes the container used for this tutorial: + + ```yaml + apiVersion: apps/v1 + kind: Deployment + metadata: + name: webapp + namespace: {{ .Release.Namespace }} + spec: + selector: + matchLabels: + app: webapp + template: + metadata: + labels: + app: webapp + spec: + containers: + - name: webapp + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + env: + - name: CONNECTION_REDIS_URL + valueFrom: + secretKeyRef: + name: redis-secret + key: url + ports: + - containerPort: 3000 + ``` + + The container that you will be working with is a ToDo application that uses Redis as a database. + + - The container is configured to listen on port 3000. + - The container will use the environment variable `CONNECTION_REDIS_URL` to connect to Redis. + - This `CONNECTION_REDIS_URL` environment variable is populated by a Kubernetes Secret. + + You can deploy this application for the first time by following these steps: + + - Create the Kubernetes namespace `demo` + - Create the Kubernetes Secret `redis-secret` containing the Redis URL. + - Install the Helm chart. + + {{< alert title="๐Ÿ’ก Redis" color="info" >}} For now you're not going to actually deploy Redis and the URL in this step is fake. You will deploy Redis using a Recipe later in the tutorial that will replace the fake URL contained within `redis-secret` with an actual container and URL.{{< /alert >}} + +2. Complete these steps by running the following commands: + + ```bash + kubectl create namespace demo + kubectl create secret generic --namespace demo --from-literal=url=redis://fake-server redis-secret + helm upgrade demo ./Chart -n demo --install + ``` + + The output should look similar to the following: + + ``` + > kubectl create namespace demo + namespace/demo created + + > kubectl create secret generic --namespace demo --from-literal=url=redis://fake-server redis-secret + secret/redis-secret created + + > helm upgrade demo ./Chart -n demo --install + Release "demo" does not exist. Installing it now. + NAME: demo + LAST DEPLOYED: Wed Sep 13 01:05:19 2023 + NAMESPACE: demo + STATUS: deployed + REVISION: 1 + TEST SUITE: None + ``` + + {{< alert title="โš ๏ธ Chart Directory" color="warning" >}} If you see an error message like **Error: path "./Chart" not found** then you are in the wrong directory. Make sure your terminal is in the `./demo` directory of the `samples` repository.{{< /alert >}} + +3. Run the following command to check if everything is running: + + ```bash + kubectl get all -n demo + ``` + + The output should look similar to the following: + + ``` + > kubectl get all -n demo + NAME READY STATUS RESTARTS AGE + pod/webapp-79d5dfb99-vhj9g 1/1 Running 0 2m48s + + NAME READY UP-TO-DATE AVAILABLE AGE + deployment.apps/webapp 1/1 1 1 2m49s + + NAME DESIRED CURRENT READY AGE + replicaset.apps/webapp-79d5dfb99 1 1 1 2m49s + ``` + + > The generated names and ages of the objects will be different in your output. Make sure you see the status of `Running` for the `pod/webapp-...` entry. If the status is not `Running`, try repeating the `kubectl get all -n demo` after waiting. + + At this point you've deployed the application but you have not actually used Radius yet. You will start doing that in the next step, as well as set up and use Redis. + +The steps so far are similar to how many applications are managed today: + +- Dependencies like Redis are provisioned manually and separately from application deployment. +- Connection information like passwords and addresses is manually stored in secret stores. +- Applications access the connection information from those secret stores when they are deployed. + +Over the next few steps you will update this application to use Radius so that: + +- โœ… Dependencies like Redis are provisioned on-demand when they are needed. +- โœ… Connection information is managed automatically, secret stores are an implementation detail. +- โœ… Applications have a documented relationship with the dependencies they connect to. + +From here you will go through a series of steps to incrementally add more Radius features to the application. + +## Step 4. Add Radius + +1. Make sure the `app.yaml` file from `./demo/Chart/templates/app.yaml` is open in your editor. You will make some edits to this file to enable Radius. + + Add the `annotations` property to `metadata`, and then add the `radapp.io/enabled: 'true'` annotation. The `'true'` must be surrounded in quotes. + + The example below shows the updated `metadata` section after making the changes. + + ```yaml + apiVersion: apps/v1 + kind: Deployment + metadata: + name: webapp + namespace: {{ .Release.Namespace }} + # Add the following two lines + annotations: + radapp.io/enabled: 'true' + spec: + ... + ``` + + Adding the `radapp.io/enabled: 'true'` annotation enables Radius for the deployment. + +2. Save the file after you have made the edits and deploy the application again using Helm. Since the namespace and secret have already been created, we only need to run the `helm` command. + + ```bash + helm upgrade demo ./Chart -n demo --install + ``` + + The output should look like: + + ``` + > helm upgrade demo ./Chart -n demo --install + Release "demo" has been upgraded. Happy Helming! + NAME: demo + LAST DEPLOYED: Wed Sep 13 01:31:58 2023 + NAMESPACE: demo + STATUS: deployed + REVISION: 2 + TEST SUITE: None + ``` + + You should confirm that your output contains `REVISION: 2`, that means that the changes were applied. + +3. Run the following command to confirm that everything is running: + + ```bash + kubectl get all -n demo + ``` + + The output should look similar to the following: + + ``` + > kubectl get all -n demo + NAME READY STATUS RESTARTS AGE + pod/webapp-79d5dfb99-mv6q9 1/1 Running 0 10m + + NAME READY UP-TO-DATE AVAILABLE AGE + deployment.apps/webapp 1/1 1 1 10m + + NAME DESIRED CURRENT READY AGE + replicaset.apps/webapp-79d5dfb99 1 1 1 10m + ``` + + Notice that the `AGE` of `pod/webapp-...` reflects the time of your **first** deployment. Enabling Radius for an application does not change any of its behaviors, so Kubernetes did not need to restart the container. + +4. Now that Radius has been enabled, run this command to display the state of the Radius application: + + ```bash + rad app graph -a demo -g default-demo + ``` + + The output should look like this: + + ``` + > rad app graph -a demo -g default-demo + Displaying application: demo + + Name: webapp (Applications.Core/containers) + Connections: (none) + Resources: + webapp (kubernetes: apps/Deployment) + ``` + + This means that Radius has found the Kubernetes `Deployment` running your container and cataloged it as part of the application. + + {{< alert title="๐Ÿ’ก Application Name" color="info" >}}Radius will use the Kubernetes namespace as the application name by default. {{< /alert >}} + +## Step 5. Add Recipe + +This step will add a database (Redis Cache) to the application. + +You can create a Redis Cache using [Recipes]({{< ref "guides/recipes/overview" >}}) provided by Radius. The Radius community provides [Recipes](https://github.com/radius-project/recipes) for running commonly used application dependencies, including Redis. + +In this step you will: + +- Add Redis to the application using a Recipe. +- Update the Kubernetes secret with the connection information from Redis. + +1. First, check recipes installed in your environment by running: + + ```bash + rad recipe list + ``` + + You will see output like this: + + ``` + NAME TYPE TEMPLATE KIND TEMPLATE VERSION TEMPLATE + default Applications.Datastores/sqlDatabases bicep radius.ghcr.io/recipes/local-dev/sqldatabases:latest + default Applications.Messaging/rabbitMQQueues bicep radius.ghcr.io/recipes/local-dev/rabbitmqqueues:latest + default Applications.Dapr/pubSubBrokers bicep radius.ghcr.io/recipes/local-dev/pubsubbrokers:latest + default Applications.Dapr/secretStores bicep radius.ghcr.io/recipes/local-dev/secretstores:latest + default Applications.Dapr/stateStores bicep radius.ghcr.io/recipes/local-dev/statestores:latest + default Applications.Datastores/mongoDatabases bicep radius.ghcr.io/recipes/local-dev/mongodatabases:latest + default Applications.Datastores/redisCaches bicep radius.ghcr.io/recipes/local-dev/rediscaches:latest + ``` + + The recipe for `Applications.Datastores/redisCaches` is what you will use in this example. + + {{< alert title="๐Ÿ’ก Recipes" color="info" >}} + Radius includes Recipes for local development when you use `rad init`. These [**local-dev**](https://github.com/radius-project/recipes/tree/main/local-dev) Recipes run popular OSS technologies as containerized infrastructure without requiring a cloud account. + + In a production environment you can substitute recipes that will create cloud or on-premises dependencies instead. + {{< /alert >}} + +2. Make sure the `app.yaml` file from `./demo/Chart/templates/app.yaml` is open in your editor. At the bottom of the file add the following text, including the `---`: + + ```yaml + --- + apiVersion: radapp.io/v1alpha3 + kind: Recipe + metadata: + name: db + namespace: {{ .Release.Namespace }} + spec: + type: Applications.Datastores/redisCaches + secretName: redis-secret + ``` + + Defining a `Recipe` object in Kubernetes will use a Radius Recipe to create dependencies for your application: + + - The `.spec.type` field defines the type of resource to create. `Applications.Datastores/redisCaches` is the type for a Redis Cache. + - The `.spec.secretName` field tells Radius where to store connection information. This is optional, and should be used to interoperate with other Kubernetes technologies that read from secrets. This tutorial example uses the secret to populate an environment variable. + +3. Save the file after you have made the edits and deploy the application again using Helm. Since the namespace and secret have already been created, you only need to run the `helm` command. + + ```bash + helm upgrade demo ./Chart -n demo --install + ``` + + The output should look like: + + ``` + > helm upgrade demo ./Chart -n demo --install + Release "demo" has been upgraded. Happy Helming! + NAME: demo + LAST DEPLOYED: Wed Sep 13 01:44:04 2023 + NAMESPACE: demo + STATUS: deployed + REVISION: 3 + TEST SUITE: None + ``` + + This time you should see `REVISION: 3`. + +4. Now that you are using a Recipe, you should see more resources running in Kubernetes. Run the following command: + + ```bash + kubectl get all -n demo + ``` + + The output should look similar to the following: + + ``` + > kubectl get all -n demo + + pod/redis-r5tcrra3d7uh6-7bcd8b8d8d-jmgn4 2/2 Running 0 51s + pod/webapp-79d5dfb99-f6xgj 1/1 Running 0 52s + + NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + service/redis-r5tcrra3d7uh6 ClusterIP 10.43.104.63 6379/TCP 51s + + NAME READY UP-TO-DATE AVAILABLE AGE + deployment.apps/redis-r5tcrra3d7uh6 1/1 1 1 51s + deployment.apps/webapp 1/1 1 1 52s + + NAME DESIRED CURRENT READY AGE + replicaset.apps/redis-r5tcrra3d7uh6-7bcd8b8d8d 1 1 1 51s + replicaset.apps/webapp-79d5dfb99 1 1 1 52s + + NAME TYPE SECRET STATUS + recipe.radapp.io/db Applications.Datastores/redisCaches redis-secret Ready + ``` + + Look at the status of the `recipe.radapp.io/db` resource. If the status is not `Ready`, then try running the command again after a delay. The status should show as `Ready` when the Recipe has fully-deployed. You can also see additional resources starting with `redis-`. These were created by the Recipe. + + {{< alert title="โš ๏ธ Missing resources" color="warning" >}} If you do not see the additional resources starting with `redis-` then it's likely they are in a different Kubernetes namespace. Run `kubectl get all -A` to see everything.{{< /alert >}} + +5. Now that you have added a Recipe, run this command to display the state of the Radius application: + + ```bash + rad app graph -a demo -g default-demo + ``` + + The output should look like this: + + ``` + > rad app graph -a demo -g default-demo + Displaying application: demo + + Name: webapp (Applications.Core/containers) + Connections: (none) + Resources: + webapp (kubernetes: apps/Deployment) + + Name: db (Applications.Datastores/redisCaches) + Connections: (none) + Resources: + redis-r5tcrra3d7uh6 (kubernetes: apps/Deployment) + redis-r5tcrra3d7uh6 (kubernetes: core/Service) + ``` + + `rad app graph` shows the **Application Graph** of the application. This includes: + + - Entries for each major resource: `webapp` is an `Applications.Core/containers` and `db` is an `Applications.Datastores/redisCaches`. + - Connections between resources: (none yet, you will add this next). + - Resources that were created: see the Kubernetes `Deployment` listed for `webapp` and the Kubernetes `Deployment` and `Service` listed for `db`. + + The Redis Cache created by the recipe is visible as part of the application. You can also see the `Resources` created in Kubernetes that make up the Redis Cache. In a previous step you saw these listed by `kubectl`. Since Radius deployed the Recipe, it knows that these resources *logically* are part of the Redis Cache in the application. + +6. You can also see the contents of `redis-secret` as created by Radius. Run the following command: + + ```bash + kubectl get secret -n demo redis-secret -o yaml + ``` + + The output should look like the following: + + ``` + >kubectl get secret -n demo redis-secret -o yaml + apiVersion: v1 + data: + connectionString: cmVkaXMtcjV0Y3JyYTNkN3VoNi5kZW1vLnN2Yy5jbHVzdGVyLmxvY2FsOjYzNzksYWJvcnRDb25uZWN0PUZhbHNl + host: cmVkaXMtcjV0Y3JyYTNkN3VoNi5kZW1vLnN2Yy5jbHVzdGVyLmxvY2Fs + password: "" + port: NjM3OQ== + tls: ZmFsc2U= + url: cmVkaXM6Ly9yZWRpcy1yNXRjcnJhM2Q3dWg2LmRlbW8uc3ZjLmNsdXN0ZXIubG9jYWw6NjM3OS8wPw== + username: "" + kind: Secret + metadata: + creationTimestamp: "2023-09-13T01:49:36Z" + name: redis-secret + namespace: demo + ownerReferences: + - apiVersion: radapp.io/v1alpha3 + blockOwnerDeletion: true + controller: true + kind: Recipe + name: db + uid: d40567a1-cd52-4984-8321-6cb8bea5f798 + resourceVersion: "3672" + uid: b1613fb0-09e6-4f76-8685-02f458e173b9 + type: Opaque + ``` + + The actual values like `connectionString` are Base64 encoded in this display. The `url` value in this secret is being used by the container to connect to the Redis Cache. For each type of Recipe, Radius stores the most-commonly used connection information for the convenience of application developers. + +## Step 6. Add Connection + +At this point you have added Radius to your existing container and used a Recipe to create a Redis Cache. In this step, you will use Radius Connections to inject settings into the container instead of explicitly managing a secret. + +Make sure the `app.yaml` file from `./demo/Chart/templates/app.yaml` is open in your editor. + +1. First, add another annotation. This time add the `radapp.io/connection-redis: 'db'` annotation, to `.metadata.annotations`. Order does not matter but indentation does. + + Here's the updated content of `metadata`: + + ```yaml + apiVersion: apps/v1 + kind: Deployment + metadata: + name: webapp + namespace: {{ .Release.Namespace }} + annotations: + radapp.io/enabled: 'true' + radapp.io/connection-redis: 'db' + spec: + ... + ``` + + The `radapp.io/connection-` annotation defines a connection from the container to some other dependency. Each connection has: + + - A name: `redis` is the connection name this case. + - A source: `db` is the name of the Recipe you created earlier. + + Connections are named because you can define many of them. The connection name is used to generate environment variables that are unique to the connection. + + Since you're using a connection called `redis`, Radius will automatically define the `CONNECTION_REDIS_URL` environment variable. The prefix of `CONNECTION_REDIS_` will be combined with each of the settings that you could see in the `redis-secret` secret in the previous step. + +2. You can remove the manual definition of `CONNECTION_REDIS_URL` from `app.yaml` since Radius will provide it automatically. Find the `env` property and delete all of its contents. You can also remove `.spec.secretName` from the `Recipe`. + + The final contents of `app.yaml` should look like: + + ```yaml + apiVersion: apps/v1 + kind: Deployment + metadata: + name: webapp + namespace: {{ .Release.Namespace }} + annotations: + radapp.io/enabled: 'true' + radapp.io/connection-redis: 'db' + spec: + selector: + matchLabels: + app: webapp + template: + metadata: + labels: + app: webapp + spec: + containers: + - name: webapp + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + ports: + - containerPort: 3000 + --- + apiVersion: radapp.io/v1alpha3 + kind: Recipe + metadata: + name: db + namespace: {{ .Release.Namespace }} + spec: + type: Applications.Datastores/redisCaches + ``` + +3. Save the file after you have made the edits and deploy the application again using Helm. + + ```bash + helm upgrade demo ./Chart -n demo --install + ``` + + The output should look like: + + ``` + > helm upgrade demo ./Chart -n demo --install + Release "demo" has been upgraded. Happy Helming! + NAME: demo + LAST DEPLOYED: Wed Sep 13 02:09:41 2023 + NAMESPACE: demo + STATUS: deployed + REVISION: 4 + TEST SUITE: None + ``` + + This time you should see `REVISION: 4`. + + Check the status in Kubernetes again by running: + + ```bash + kubectl get all -n demo + ``` + + The output should look like: + + ``` + > kubectl get all -n demo + NAME READY STATUS RESTARTS AGE + pod/redis-r5tcrra3d7uh6-7bcd8b8d8d-jmgn4 2/2 Running 0 20m + pod/webapp-76db7964d8-plc2s 1/1 Running 0 37s + + NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + service/redis-r5tcrra3d7uh6 ClusterIP 10.43.104.63 6379/TCP 20m + + NAME READY UP-TO-DATE AVAILABLE AGE + deployment.apps/redis-r5tcrra3d7uh6 1/1 1 1 20m + deployment.apps/webapp 1/1 1 1 20m + + NAME DESIRED CURRENT READY AGE + replicaset.apps/redis-r5tcrra3d7uh6-7bcd8b8d8d 1 1 1 20m + replicaset.apps/webapp-79d5dfb99 0 0 0 20m + replicaset.apps/webapp-76db7964d8 1 1 1 37s + replicaset.apps/webapp-687dcf5cdf 0 0 0 38s + + NAME TYPE SECRET STATUS + recipe.radapp.io/db Applications.Datastores/redisCaches Ready + ``` + + Depending on the timing you may see pods in the `Terminating` state. This is normal as old replicas take some time to shut down. + +4. Check the Radius status again. Now Radius is aware of the connection from `webapp->db`: + + ```bash + rad app graph -a demo -g default-demo + ``` + + The output should look like the example below: + + ``` + > rad app graph -a demo -g default-demo + Displaying application: demo + + Name: webapp (Applications.Core/containers) + Connections: + webapp -> db (Applications.Datastores/redisCaches) + Resources: + webapp (kubernetes: apps/Deployment) + + Name: db (Applications.Datastores/redisCaches) + Connections: + webapp (Applications.Core/containers) -> db + Resources: + redis-r5tcrra3d7uh6 (kubernetes: apps/Deployment) + redis-r5tcrra3d7uh6 (kubernetes: core/Service) + ``` + +## Step 7. Try it out + +In this step you can access the application and explore its features. Since the container is running inside Kubernetes, you need to run a port-forward to use it locally. + +1. Run the following command to start the port-forward: + + ```bash + kubectl port-forward -n demo deployment/webapp 3000 + ``` + + If you are inside Codespaces this will open a new browser tab that you can use to access the webapp. + + If you are not using Codespaces then open your browser and navigate to `http://localhost:3000` + + Screenshot of the demo container +

+ + Congrats! You're running your first Radius app. + + You can use the homepage to view information about the container and its settings. + +2. Navigate to the ToDo List tab and test out the application. Using the ToDo page will update the saved state in Redis. + + Screenshot of the todolist +

+ + When you're ready to move on to the next step, use `CTRL+C` to exit the command. + +## Cleanup and next steps + +To delete your app, run the following command: + +> This command also cleans up all the resources created by the Radius Recipe you deployed earlier. + +```bash +helm uninstall demo -n demo +``` + +In summary, this tutorial walked through a hands-on example to show you how-to: + +- Enable Radius for a Helm or Kubernetes-based application to catalog your assets. +- Use Recipes to create dependencies either for development or production use. +- Use Connections to automate the management of connection information. + +
+{{< button text="Next step: Try another tutorial" page="tutorials" >}} diff --git a/docs/content/tutorials/new-app/index.md b/docs/content/tutorials/new-app/index.md index 4d08874d5..7cadf5464 100644 --- a/docs/content/tutorials/new-app/index.md +++ b/docs/content/tutorials/new-app/index.md @@ -252,13 +252,13 @@ In addition to containers, you can add dependencies like Redis caches, Dapr Stat Resources: myapp Applications.Core/applications - frontend Applications.Core/containers + demo Applications.Core/containers mongodb Applications.Datastores/mongoDatabases Starting log stream... ``` -1. Open [localhost:3000](http://localhost:3000) to interact with the frontend container. You should see the container's connections and metadata, this time with a connection to the Mongo database and new environment variables set: +1. Open [localhost:3000](http://localhost:3000) to interact with the demo container. You should see the container's connections and metadata, this time with a connection to the Mongo database and new environment variables set: {{< image src="demo-landing-connection.png" alt="Screenshot of the Radius demo container" width=500px >}} @@ -275,20 +275,20 @@ In addition to containers, you can add dependencies like Redis caches, Dapr Stat ``` Displaying application: myapp - Name: frontend (Applications.Core/containers) + Name: demo (Applications.Core/containers) Connections: - frontend -> mongodb (Applications.Datastores/mongoDatabases) + demo -> mongodb (Applications.Datastores/mongoDatabases) Resources: - frontend (kubernetes: apps/Deployment) - frontend (kubernetes: core/Secret) - frontend (kubernetes: core/Service) - frontend (kubernetes: core/ServiceAccount) - frontend (kubernetes: rbac.authorization.k8s.io/Role) - frontend (kubernetes: rbac.authorization.k8s.io/RoleBinding) + demo (kubernetes: apps/Deployment) + demo (kubernetes: core/Secret) + demo (kubernetes: core/Service) + demo (kubernetes: core/ServiceAccount) + demo (kubernetes: rbac.authorization.k8s.io/Role) + demo (kubernetes: rbac.authorization.k8s.io/RoleBinding) Name: mongodb (Applications.Datastores/mongoDatabases) Connections: - frontend (Applications.Core/containers) -> mongodb + demo (Applications.Core/containers) -> mongodb Resources: mongo-bzmp2btdgzez6 (kubernetes: apps/Deployment) mongo-bzmp2btdgzez6 (kubernetes: core/Service) @@ -302,7 +302,7 @@ In addition to dependencies, you can add more containers to make your applicatio {{% rad file="snippets/3-app-backend.bicep" embed=true marker="//BACKEND" %}} -1. Add a new connection from your `frontend` container to the `backend` container: +1. Add a new connection from your `demo` container to the `backend` container: {{% rad file="snippets/3-app-backend.bicep" embed=true marker="//CONTAINER" markdownConfig="{hl_lines=[\"20-22\"]}" %}} @@ -322,14 +322,14 @@ In addition to dependencies, you can add more containers to make your applicatio Deployment Complete Resources: - frontend Applications.Core/containers + demo Applications.Core/containers backend Applications.Core/containers mongodb Applications.Datastores/mongoDatabases Starting log stream... ``` -1. Open [localhost:3000](http://localhost:3000) to interact with the frontend container. You should see the container's connections and metadata, this time with a connection to the backend container and new environment variables set: +1. Open [localhost:3000](http://localhost:3000) to interact with the demo container. You should see the container's connections and metadata, this time with a connection to the backend container and new environment variables set: {{< image src="demo-landing-backend.png" alt="Screenshot of the demo container with a connection to the backend container" width=600px >}} @@ -359,7 +359,7 @@ Finally, you can add a gateway to your application. Gateways are used to expose Deployment Complete Resources: - frontend Applications.Core/containers + demo Applications.Core/containers backend Applications.Core/containers gateway Applications.Core/gateways mongodb Applications.Datastores/mongoDatabases diff --git a/docs/content/tutorials/new-app/snippets/3-app-backend.bicep b/docs/content/tutorials/new-app/snippets/3-app-backend.bicep index 9f4e76db7..e3ad8d405 100644 --- a/docs/content/tutorials/new-app/snippets/3-app-backend.bicep +++ b/docs/content/tutorials/new-app/snippets/3-app-backend.bicep @@ -8,8 +8,8 @@ param application string param environment string //CONTAINER -resource frontend 'Applications.Core/containers@2023-10-01-preview' = { - name: 'frontend' +resource demo 'Applications.Core/containers@2023-10-01-preview' = { + name: 'demo' properties: { application: application container: { @@ -28,7 +28,7 @@ resource frontend 'Applications.Core/containers@2023-10-01-preview' = { source: mongodb.id } backend: { - source: 'http://backend:3000' + source: 'http://backend:80' } } } diff --git a/docs/content/tutorials/new-app/snippets/4-app-gateway.bicep b/docs/content/tutorials/new-app/snippets/4-app-gateway.bicep index e551086b6..0d075265a 100644 --- a/docs/content/tutorials/new-app/snippets/4-app-gateway.bicep +++ b/docs/content/tutorials/new-app/snippets/4-app-gateway.bicep @@ -8,8 +8,8 @@ param application string param environment string //CONTAINER -resource frontend 'Applications.Core/containers@2023-10-01-preview' = { - name: 'frontend' +resource demo 'Applications.Core/containers@2023-10-01-preview' = { + name: 'demo' properties: { application: application container: { @@ -70,7 +70,7 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' = { routes: [ { path: '/' - destination: 'http://frontend:3000' + destination: 'http://demo:3000' } ] } diff --git a/docs/content/tutorials/tutorial-dapr/index.md b/docs/content/tutorials/tutorial-dapr/index.md index de6f08801..7b82b66bb 100644 --- a/docs/content/tutorials/tutorial-dapr/index.md +++ b/docs/content/tutorials/tutorial-dapr/index.md @@ -14,22 +14,40 @@ This tutorial will teach you the following about Dapr: - How to use Radius to deploy a Dapr microservices sample application for an online shop - How [Dapr and Radius]({{< ref "guides/author-apps/dapr" >}}) seamlessly work together -For more details on the app and access to the source code, visit the `tutorials/dapr` directory in the [samples repo](https://github.com/radius-project/samples). _For access to the radius-project GitHub org, please complete and submit [this form](https://aka.ms/ProjectRadius/GitHubAccess)._ +For more details on the app and access to the source code, visit the `tutorials/dapr` directory in the [samples repo](https://github.com/radius-project/samples). ## Prerequisites - [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}}) - [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}}) - [Radius environment]({{< ref "installation#step-3-initialize-radius" >}}) +- [Setup a supported Kubernetes cluster](https://docs.radapp.io/guides/operations/kubernetes/overview/#supported-clusters) - [Dapr installed on your Kubernetes cluster](https://docs.dapr.io/operations/hosting/kubernetes/kubernetes-deploy/) -## Step 1: Define the application, `backend` container, and Dapr state store +## Step 1: Initialize a Radius Environment + +1. Begin in a new directory for your application: + + ```bash + mkdir dapr + cd dapr + ``` + +2. Initialize a new dev environment: + + *Select 'Yes' when prompted to create an application.* + + ```bash + rad init + ``` + +## Step 2: Define the application, `backend` container, and Dapr state store Begin by creating a new file named `dapr.bicep` with a Radius Application that consists of a `backend` container and Dapr state store with Redis: {{< rad file="snippets/dapr.bicep" embed=true marker="//BACKEND" >}} -## Step 2: Deploy the `backend` application +## Step 3: Deploy the `backend` application 1. Deploy the application's `backend` container and Dapr state store: @@ -68,13 +86,13 @@ Begin by creating a new file named `dapr.bicep` with a Radius Application that c default-dapr statestore state.redis v1 2023-07-21 16:04.27 21m ``` -## Step 3: Define the `frontend` container +## Step 4: Define the `frontend` container Add a `frontend` [container]({{< ref "guides/author-apps/containers" >}}) which will serve as the application's user interface. {{< rad file="snippets/dapr.bicep" embed=true marker="//FRONTEND" >}} -## Step 4. Deploy and run the `frontend` application +## Step 5. Deploy and run the `frontend` application 1. Use Radius to deploy and run the application with a single command: @@ -94,7 +112,7 @@ Add a `frontend` [container]({{< ref "guides/author-apps/containers" >}}) which statestore Applications.Dapr/stateStores ``` -## Step 5. Test your application +## Step 6. Test your application In your browser, navigate to the endpoint (e.g. [http://localhost:8080](http://localhost:8080)) to view and interact with your application: @@ -102,12 +120,12 @@ In your browser, navigate to the endpoint (e.g. [http://localhost:8080](http://l ## Cleanup -1. Press CTRL+C to terminate the `rad run` log console +1. Press `CTRL`+`C` to terminate the log console -1. Run `rad app delete` to cleanup your Radius Application, containers, and Dapr statestore. The Recipe resources (_Redis container and Dapr component_) are also automatically cleaned up. +1. Run the following command to cleanup your Radius Application, containers, and Dapr statestore. The Recipe resources (_Redis container and Dapr component_) are also automatically cleaned up. ```bash - rad app delete -a dapr + rad app delete ``` ## Next steps diff --git a/docs/content/tutorials/tutorial-dapr/snippets/dapr.bicep b/docs/content/tutorials/tutorial-dapr/snippets/dapr.bicep index 62bd724d2..3a0777c8b 100644 --- a/docs/content/tutorials/tutorial-dapr/snippets/dapr.bicep +++ b/docs/content/tutorials/tutorial-dapr/snippets/dapr.bicep @@ -4,18 +4,14 @@ import radius as radius @description('Specifies the environment for resources.') param environment string -resource app 'Applications.Core/applications@2023-10-01-preview' = { - name: 'dapr' - properties: { - environment: environment - } -} +@description('The ID of your Radius Application. Automatically injected by the rad CLI.') +param application string // The backend container that is connected to the Dapr state store resource backend 'Applications.Core/containers@2023-10-01-preview' = { name: 'backend' properties: { - application: app.id + application: application container: { // This image is where the app's backend code lives image: 'ghcr.io/radius-project/samples/dapr-backend:latest' @@ -46,7 +42,7 @@ resource stateStore 'Applications.Dapr/stateStores@2023-10-01-preview' = { properties: { // Provision Redis Dapr state store automatically via the default Radius Recipe environment: environment - application: app.id + application: application } } //BACKEND @@ -56,13 +52,15 @@ resource stateStore 'Applications.Dapr/stateStores@2023-10-01-preview' = { resource frontend 'Applications.Core/containers@2023-10-01-preview' = { name: 'frontend' properties: { - application: app.id + application: application container: { // This image is where the app's frontend code lives image: 'ghcr.io/radius-project/samples/dapr-frontend:latest' env: { // An environment variable to tell the frontend container where to find the backend CONNECTION_BACKEND_APPID: 'backend' + // An environment variable to override the default port that .NET Core listens on + ASPNETCORE_URLS: 'http://*:8080' } // The frontend container exposes port 8080, which is used to serve the UI ports: { diff --git a/docs/layouts/shortcodes/schemaExample.html b/docs/layouts/shortcodes/schemaExample.html new file mode 100644 index 000000000..1a540eee4 --- /dev/null +++ b/docs/layouts/shortcodes/schemaExample.html @@ -0,0 +1,7 @@ +{{ $bicepExample := "example.bicep" }} +{{ $bicepExamplePath := path.Join .Page.File.Dir $bicepExample }} + +{{ if fileExists $bicepExamplePath }} +{{ $bicepContent := $bicepExamplePath | readFile }} +{{ highlight $bicepContent "bicep" }} +{{ end }} \ No newline at end of file diff --git a/redirect/README.md b/redirect/README.md new file mode 100644 index 000000000..0f2d8e625 --- /dev/null +++ b/redirect/README.md @@ -0,0 +1,3 @@ +# Redirect Page + +Our current domain, `radapp.io`, is the homepage for Radius. We previously operated on `radapp.dev` and may still have some remaining links to that domain. This directory contains a redirect page that we host on `radapp.dev` to redirect to `radapp.io`. diff --git a/redirect/src/index.html b/redirect/src/index.html new file mode 100644 index 000000000..2e9a35686 --- /dev/null +++ b/redirect/src/index.html @@ -0,0 +1,10 @@ + + + + Redirecting to https://radapp.io + + + +

Please wait while you are redirected to https://radapp.io

+ +