diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..307cd13c4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +# text files use OS defaults on checkout, LF on checkin +* text eol=auto + +# shell scripts always use LF +*.sh text eol=lf + +# images are binary +*.png binary diff --git a/.github/workflows/spellcheck.yaml b/.github/workflows/spellcheck.yaml index 03a04fa3a..1e0530acf 100644 --- a/.github/workflows/spellcheck.yaml +++ b/.github/workflows/spellcheck.yaml @@ -6,22 +6,20 @@ on: branches: - v*.* - edge - paths: - - 'docs/**' - - '.github/workflows/spellcheck.yaml' - - '.github/config/**' pull_request: types: [opened, synchronize, reopened] branches: - v*.* - edge - paths: - - 'docs/**' - - '.github/workflows/spellcheck.yaml' - - '.github/config/**' + +env: + ACTION_LINK: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + +concurrency: + group: spellcheck-${{ github.ref }}-${{ github.event.pull_request.number || github.sha }} jobs: - build: + spellcheck: name: Spellcheck runs-on: ubuntu-latest steps: @@ -31,3 +29,31 @@ jobs: uses: rojopolis/spellcheck-github-actions@0.27.0 with: config_path: .github/config/.pyspelling.yml + - name: Post GitHub workkflow output on failure + if: failure() + run: | + echo "## :x: Spellcheck Failed" >> $GITHUB_STEP_SUMMARY + echo "There are spelling errors in your PR. Visit [the workflow output](${{ env.ACTION_LINK }}) to see what words are failing." >> $GITHUB_STEP_SUMMARY + echo "### Adding new words" >> $GITHUB_STEP_SUMMARY + echo "If you are adding a new custom word refer to the [docs guide](https://docs.radapp.dev/contributing/docs/#spelling)" >> $GITHUB_STEP_SUMMARY + - name: Post GitHub workflow output on success + run: | + echo "## :white_check_mark: Spellcheck Passed" >> $GITHUB_STEP_SUMMARY + echo "There are no spelling errors in your PR." >> $GITHUB_STEP_SUMMARY + - name: Post GitHub comment on failure + if: failure() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: spellcheck + recreate: true + message: | + ## :x: Spellcheck Failed + There are spelling errors in your PR. Visit [the workflow output](${{ env.ACTION_LINK }}) to see what words are failing. + ### Adding new words + If you are adding a new custom word refer to the [docs guide](https://docs.radapp.dev/contributing/docs/#spelling) + - name: Clear GitHub comment on success + uses: marocchino/sticky-pull-request-comment@v2 + continue-on-error: true + with: + header: spellcheck + delete: true diff --git a/docs/assets/scss/_sidebar-tree.scss b/docs/assets/scss/_sidebar-tree.scss index a8f9bb568..8a4dfb840 100644 --- a/docs/assets/scss/_sidebar-tree.scss +++ b/docs/assets/scss/_sidebar-tree.scss @@ -58,7 +58,6 @@ &__page { color: $gray-700; - font-weight: $font-weight-light; } } diff --git a/docs/config.toml b/docs/config.toml index 8e96aa039..4dcd9d569 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -93,4 +93,5 @@ version_menu = "Releases" [params.ui] sidebar_menu_compact = true sidebar_search_disable = true +sidebar_menu_foldable = true ul_show = 1 diff --git a/docs/content/author-apps/dev-environment/initialize-environment.md b/docs/content/author-apps/dev-environment/initialize-environment.md index 1b73c3edf..c41be30ed 100644 --- a/docs/content/author-apps/dev-environment/initialize-environment.md +++ b/docs/content/author-apps/dev-environment/initialize-environment.md @@ -25,7 +25,7 @@ Radius development environments enable you to quickly get started with Radius an ## How-to: Initialize a new dev environment -1. Initialize a new [Radius environment]{{(< ref "operations/environments">)}} with `rad init --dev` command: +1. Initialize a new [Radius environment]({{< ref "operations/environments/overview">}}) with `rad init --dev` command: ```bash rad init --dev ``` diff --git a/docs/content/author-apps/networking/_index.md b/docs/content/author-apps/networking/_index.md index d0cc0f573..a995eac9d 100644 --- a/docs/content/author-apps/networking/_index.md +++ b/docs/content/author-apps/networking/_index.md @@ -7,71 +7,3 @@ weight: 400 categories: "Concept" tags: ["routes","gateways"] --- - -Radius networking resources allow you to model: - -- Communication between a user and a service -- Communication between services - -## HTTP Routes - -An `HttpRoute` resources defines HTTP communication between two [services]({{< ref container >}}). They can be used to define both one-way communication, as well as cycles of communication between services. - -Diagram of Radius service-to-service networking with cycles
- -Refer to the [HTTP Route schema]({{< ref httproute >}}) for more information on how to model HTTP routes. - -A gateway can optionally be added for external users to access the Route. - -## Gateways - -`Gateway` defines how requests are routed to different resources, and also provides the ability to expose traffic to the internet. Conceptually, gateways allow you to have a single point of entry for traffic in your application, whether it be internal or external traffic. - -`Gateway` in Radius are split into two main pieces; the `Gateway` resource itself, which defines which port and protocol to listen on, and Route(s) which define the rules for routing traffic to different resources. - -Diagram of Radius gateways
- -Refer to the [Gateway schema]({{< ref gateway >}}) for more information on how to model gateways. - -### TLS Termination - -Gateways support TLS termination. This allows incoming encrypted traffic to be decrypted with a user-specific certificate and then routed, unencrypted, to the specified routes. TLS certificates can be stored or referenced via a [Radius secret store]({{< ref secretstore >}}). - -### SSL Passthrough - -A gateway can be configured to passthrough encrypted SSL traffic to an HTTP route and container. This is useful for applications that already have SSL termination configured, and do not want to terminate SSL at the gateway. - -To set up SSL passthrough, set `tls.sslPassthrough` to `true` on the gateway, and set a single route with no `path` defined (just `destination`). - -## Example - -### Path-based HTTP routing - -{{< tabs Bicep >}} - -{{< codetab >}} -{{< rad file="snippets/networking.bicep" embed=true >}} -{{< /codetab >}} - -{{< /tabs >}} - -### TLS termination - -{{< tabs Bicep >}} - -{{< codetab >}} -{{< rad file="snippets/networking-tlstermination.bicep" embed=true marker="//GATEWAY" >}} -{{< /codetab >}} - -{{< /tabs >}} - - -### SSL Passthrough - -{{< tabs Bicep >}} - -{{< codetab >}} -{{< rad file="snippets/networking-sslpassthrough.bicep" embed=true marker="//GATEWAY" >}} -{{< /codetab >}} - -{{< /tabs >}} diff --git a/docs/content/author-apps/networking/overview/index.md b/docs/content/author-apps/networking/overview/index.md new file mode 100644 index 000000000..3dd2c3cbf --- /dev/null +++ b/docs/content/author-apps/networking/overview/index.md @@ -0,0 +1,77 @@ +--- +type: docs +title: "Overview: Application networking" +linkTitle: "Application networking" +description: "Learn how to add networking to your Radius application" +weight: 100 +categories: "Overview" +tags: ["routes","gateways"] +--- + +Radius networking resources allow you to model: + +- Communication between a user and a service +- Communication between services + +## HTTP Routes + +An `HttpRoute` resources defines HTTP communication between two [services]({{< ref container >}}). They can be used to define both one-way communication, as well as cycles of communication between services. + +Diagram of Radius service-to-service networking with cycles
+ +Refer to the [HTTP Route schema]({{< ref httproute >}}) for more information on how to model HTTP routes. + +A gateway can optionally be added for external users to access the Route. + +## Gateways + +`Gateway` defines how requests are routed to different resources, and also provides the ability to expose traffic to the internet. Conceptually, gateways allow you to have a single point of entry for traffic in your application, whether it be internal or external traffic. + +`Gateway` in Radius are split into two main pieces; the `Gateway` resource itself, which defines which port and protocol to listen on, and Route(s) which define the rules for routing traffic to different resources. + +Diagram of Radius gateways
+ +Refer to the [Gateway schema]({{< ref gateway >}}) for more information on how to model gateways. + +### TLS Termination + +Gateways support TLS termination. This allows incoming encrypted traffic to be decrypted with a user-specific certificate and then routed, unencrypted, to the specified routes. TLS certificates can be stored or referenced via a [Radius secret store]({{< ref secretstore >}}). + +### SSL Passthrough + +A gateway can be configured to passthrough encrypted SSL traffic to an HTTP route and container. This is useful for applications that already have SSL termination configured, and do not want to terminate SSL at the gateway. + +To set up SSL passthrough, set `tls.sslPassthrough` to `true` on the gateway, and set a single route with no `path` defined (just `destination`). + +## Example + +### Path-based HTTP routing + +{{< tabs Bicep >}} + +{{< codetab >}} +{{< rad file="snippets/networking.bicep" embed=true >}} +{{< /codetab >}} + +{{< /tabs >}} + +### TLS termination + +{{< tabs Bicep >}} + +{{< codetab >}} +{{< rad file="snippets/networking-tlstermination.bicep" embed=true marker="//GATEWAY" >}} +{{< /codetab >}} + +{{< /tabs >}} + + +### SSL Passthrough + +{{< tabs Bicep >}} + +{{< codetab >}} +{{< rad file="snippets/networking-sslpassthrough.bicep" embed=true marker="//GATEWAY" >}} +{{< /codetab >}} + +{{< /tabs >}} diff --git a/docs/content/author-apps/networking/networking-cycles.png b/docs/content/author-apps/networking/overview/networking-cycles.png similarity index 100% rename from docs/content/author-apps/networking/networking-cycles.png rename to docs/content/author-apps/networking/overview/networking-cycles.png diff --git a/docs/content/author-apps/networking/networking-gateways.png b/docs/content/author-apps/networking/overview/networking-gateways.png similarity index 100% rename from docs/content/author-apps/networking/networking-gateways.png rename to docs/content/author-apps/networking/overview/networking-gateways.png diff --git a/docs/content/author-apps/networking/snippets/networking-sslpassthrough.bicep b/docs/content/author-apps/networking/overview/snippets/networking-sslpassthrough.bicep similarity index 100% rename from docs/content/author-apps/networking/snippets/networking-sslpassthrough.bicep rename to docs/content/author-apps/networking/overview/snippets/networking-sslpassthrough.bicep diff --git a/docs/content/author-apps/networking/snippets/networking-tlstermination.bicep b/docs/content/author-apps/networking/overview/snippets/networking-tlstermination.bicep similarity index 100% rename from docs/content/author-apps/networking/snippets/networking-tlstermination.bicep rename to docs/content/author-apps/networking/overview/snippets/networking-tlstermination.bicep diff --git a/docs/content/author-apps/networking/snippets/networking.bicep b/docs/content/author-apps/networking/overview/snippets/networking.bicep similarity index 100% rename from docs/content/author-apps/networking/snippets/networking.bicep rename to docs/content/author-apps/networking/overview/snippets/networking.bicep diff --git a/docs/content/getting-started/quickstarts/quickstart-aws/icon.png b/docs/content/getting-started/quickstarts/quickstart-aws/icon.png new file mode 100755 index 000000000..e6fb19177 Binary files /dev/null and b/docs/content/getting-started/quickstarts/quickstart-aws/icon.png differ diff --git a/docs/content/getting-started/quickstarts/quickstart-aws/index.md b/docs/content/getting-started/quickstarts/quickstart-aws/index.md new file mode 100644 index 000000000..a4bbf8419 --- /dev/null +++ b/docs/content/getting-started/quickstarts/quickstart-aws/index.md @@ -0,0 +1,256 @@ +--- +type: docs +title: "Quickstart: Deploy AWS resources" +linkTitle: "Deploy AWS resources" +description: "Learn about how to setup an AWS cloud provider and deploy an AWS MemoryDB for Redis with Radius" +weight: 500 +categories: "Quickstart" +tags: ["AWS"] +--- + +This quickstart will teach you: +* How to create a Radius environment with an AWS cloud provider +* How to model an AWS resource in bicep +* How to use an AWS resource as part of your Radius application + +## 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) + +## Step 1: Create an EKS cluster + +Create an EKS cluster by using the `eksctl` CLI. This command will create a cluster in the `us-west-2` region, as well as a VPC and the Subnets, Security Groups, and IAM Roles required for the cluster. + +```bash +eksctl create cluster --name my-cluster --region=us-west-2 --zones=us-west-2a,us-west-2b,us-west-2c +``` + +> Note: If you are using an existing cluster, you can skip this step. However, make sure that the each of the Subnets in your EKS cluster Subnet Group are within the [list of supported MemoryDB availability zones](https://docs.aws.amazon.com/memorydb/latest/devguide/subnetgroups.html). If your cluster includes Subnets outside of a supported MemoryDB availability zone, or if using your own custom subnets, supply them as part of the deployment file in Step 5. + +## Step 2: Create a Radius environment with the AWS cloud provider + +Create a [Radius environment]({{< ref "operations/environments/overview" >}}) where you will deploy your application. + +1. You can view the current context for kubectl by running: + + ```bash + kubectl config current-context + ``` + {{% alert color="success" %}} Make sure that your kubecontext is set to a running EKS cluster. + {{% /alert %}} + +1. Use the `rad init` command to initialize a new environment into your current kubectl context: + + ```bash + rad init + ``` + + Follow the prompts to install Radius, create an [environment resource]({{< ref "operations/environments/overview" >}}), 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]({{}}) 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 with MemoryDB for Redis + +This Bicep file defines a MemoryDB cluster, configuring it in the same VPC as your EKS cluster. Deploying to the same VPC is the recommended way to access a MemoryDB cluster from your EKS cluster. It also optionally accepts `subnetIds` as a parameter, which can be supplied to use a different set of Subnet Ids. + +{{< tabs "New MemoryDB Resource" "Existing MemoryDB Resource" >}} + +{{% codetab %}} +### aws-memorydb.bicep + +{{< rad file="snippets/aws-memorydb.bicep" embed=true >}} + +{{% /codetab %}} + +{{% codetab %}} + +Alternatively, if you have an existing MemoryDB resource that you would want to use instead: + +### aws-memorydb-existing.bicep + +{{< rad file="snippets/aws-memorydb-existing.bicep" embed=true >}} + +{{% /codetab %}} + +{{< /tabs >}} + +## Step 4: Create an app.bicep that uses the MemoryDB + +This Bicep file defines a webapp [container]({{< ref container >}}), which connects to the MemoryDB we created in Step 3 and uses it as a datastore. + +{{< tabs "New MemoryDB Resource" "Existing MemoryDB Resource" >}} + +{{% codetab %}} +### app.bicep + +{{< rad file="snippets/app.bicep" embed=true >}} + +{{% /codetab %}} + +{{% codetab %}} + +### app.bicep + +{{< rad file="snippets/app-existing.bicep" embed=true >}} + +{{% /codetab %}} + +{{< /tabs >}} + + +## Step 5: Deploy the application + +1. Deploy your application to your environment: + + {{< tabs "New MemoryDB Resource" "New Memory DB Resource with custom Subnets" "Existing MemoryDB Resource" >}} + + {{% codetab %}} + + ```bash + rad deploy ./app.bicep --parameters eksClusterName=YOUR_EKS_CLUSTER_NAME + ``` + + Make sure to replace `YOUR_EKS_CLUSTER_NAME` with your EKS cluster name. + + This will deploy the application into your environment and launch the container resource for the frontend website. This operation may take some time, since it is deploying a MemoryDB resource to AWS. You should see the following resources deployed at the end of `rad deploy`: + + ``` + Deployment In Progress... + + Completed memorydb-module Microsoft.Resources/deployments + Completed webapp Applications.Core/applications + Completed demo-memorydb-subnet-group AWS.MemoryDB/SubnetGroup + Completed demo-memorydb-cluster AWS.MemoryDB/Cluster + Completed AWS.EKS/Cluster + Completed demo-memorydb-cluster AWS.MemoryDB/Cluster + Completed db Applications.Link/redisCaches + Completed frontend Applications.Core/containers + + Deployment Complete + + Resources: + AWS.EKS/Cluster + demo-memorydb-cluster AWS.MemoryDB/Cluster + demo-memorydb-subnet-group AWS.MemoryDB/SubnetGroup + db Applications.Link/redisCaches + webapp Applications.Core/applications + frontend Applications.Core/containers + ``` + + {{% /codetab %}} + + {{% codetab %}} + + You can specify the Subnet IDs to use for the MemoryDB cluster by replacing the Subnet IDs in `aws-memorydb.bicep`: + + ### aws-memorydb.bicep + + ```bicep + param subnetGroupName string = 'demo-memorydb-subnet-group' + resource subnetGroup 'AWS.MemoryDB/SubnetGroup@default' = { + alias: subnetGroupName + properties: { + SubnetGroupName: subnetGroupName + // Update this line to include your subnets: + SubnetIds: ['subnet-0a1b2c3d4e5f6g7h8', 'subnet-0a1b2c3d4e5f6g7h9'] + } + } + ``` + + ```bash + rad deploy ./app.bicep --parameters eksClusterName=YOUR_EKS_CLUSTER_NAME + ``` + + Make sure to replace `YOUR_EKS_CLUSTER_NAME` with your EKS cluster name. + + This will deploy the application into your environment and launch the container resource for the frontend website. This operation may take some time, since it is deploying a MemoryDB resource to AWS. You should see the following resources deployed at the end of `rad deploy`: + + ``` + Deployment In Progress... + + Completed memorydb-module Microsoft.Resources/deployments + Completed webapp Applications.Core/applications + Completed demo-memorydb-subnet-group AWS.MemoryDB/SubnetGroup + Completed demo-memorydb-cluster AWS.MemoryDB/Cluster + Completed AWS.EKS/Cluster + Completed demo-memorydb-cluster AWS.MemoryDB/Cluster + Completed db Applications.Link/redisCaches + Completed frontend Applications.Core/containers + + Deployment Complete + + Resources: + AWS.EKS/Cluster + demo-memorydb-cluster AWS.MemoryDB/Cluster + demo-memorydb-subnet-group AWS.MemoryDB/SubnetGroup + db Applications.Link/redisCaches + webapp Applications.Core/applications + frontend Applications.Core/containers + ``` + + {{% /codetab %}} + + {{% codetab %}} + + ```bash + rad deploy ./app.bicep + ``` + + This will deploy the application into your environment and launch the container resource for the frontend website. You should see the following resources deployed at the end of `rad deploy`: + + ``` + Deployment In Progress... + + Completed memorydb-module Microsoft.Resources/deployments + Completed webapp Applications.Core/applications + Completed demo-memorydb-cluster AWS.MemoryDB/Cluster + Completed db Applications.Link/redisCaches + Completed frontend Applications.Core/containers + + Deployment Complete + + Resources: + demo-memorydb-cluster AWS.MemoryDB/Cluster + db Applications.Link/redisCaches + webapp Applications.Core/applications + frontend Applications.Core/containers + ``` + + {{% /codetab %}} + + {{< /tabs >}} + +1. Port-forward the container to your machine with [`rad resource expose`]({{< ref rad_resource_expose >}}): + + ```bash + rad resource expose containers frontend -a webapp --port 3000 + ``` +1. Visit [localhost:3000](http://localhost:3000) in your browser. You should see a page like: + + screenshot of the todo application with an AWS MemoryDB database + + If your page matches, then it means that the container is able to communicate with the AWS MemoryDB database. + + You can play around with the application's features: + + - Add a todo item + - Mark a todo item as complete + - Delete a todo item + +## Cleanup + +{{% alert title="Delete environment" color="warning" %}} +If 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. +{{% /alert %}} + +{{% alert title="Cleanup AWS Resources" color="warning" %}} +AWS resources are not deleted when deleting a Radius environment, so to prevent additional charges, make sure to delete all resources created in this quickstart. This includes the SubnetGroup and MemoryDB created in Step 3. You can delete these resources in the AWS Console or via the AWS CLI. +{{% /alert %}} diff --git a/docs/content/getting-started/quickstarts/quickstart-aws/snippets/app-existing.bicep b/docs/content/getting-started/quickstarts/quickstart-aws/snippets/app-existing.bicep new file mode 100644 index 000000000..5537a4126 --- /dev/null +++ b/docs/content/getting-started/quickstarts/quickstart-aws/snippets/app-existing.bicep @@ -0,0 +1,43 @@ +import radius as radius + +param environment string + +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'webapp' + properties: { + environment: environment + } +} + +resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'frontend' + properties: { + application: app.id + container: { + image: 'radius.azurecr.io/tutorial/webapp:edge' + } + connections: { + redis: { + source: db.id + } + } + } +} + +resource db 'Applications.Link/redisCaches@2022-03-15-privatepreview' = { + name: 'db' + properties: { + environment: environment + resourceProvisioning: 'manual' + host: memoryDB.outputs.memoryDBHost + port: memoryDB.outputs.memoryDBPort + secrets: { + connectionString: memoryDB.outputs.memoryDBConnectionString + } + } +} + +module memoryDB 'aws-memorydb-existing.bicep' = { + name: 'memorydb-module' +} + diff --git a/docs/content/getting-started/quickstarts/quickstart-aws/snippets/app.bicep b/docs/content/getting-started/quickstarts/quickstart-aws/snippets/app.bicep new file mode 100644 index 000000000..7adb44015 --- /dev/null +++ b/docs/content/getting-started/quickstarts/quickstart-aws/snippets/app.bicep @@ -0,0 +1,48 @@ +import radius as radius + +param eksClusterName string + +param environment string +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'webapp' + properties: { + environment: environment + } +} + +resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'frontend' + properties: { + application: app.id + container: { + image: 'radius.azurecr.io/tutorial/webapp:edge' + } + connections: { + redis: { + source: db.id + } + } + } +} + +// Radius Redis cache link resource that enables connection to the underlying MmeoryDB cluster with outputs from the Bicep module below +resource db 'Applications.Link/redisCaches@2022-03-15-privatepreview' = { + name: 'db' + properties: { + environment: environment + resourceProvisioning: 'manual' + host: memoryDB.outputs.memoryDBHost + port: memoryDB.outputs.memoryDBPort + secrets: { + connectionString: memoryDB.outputs.memoryDBConnectionString + } + } +} + +// Invoke the memoryDB provisioning using Bicep module and pass in the name of the EKS cluster. +module memoryDB 'aws-memorydb.bicep' = { + name: 'memorydb-module' + params: { + eksClusterName: eksClusterName + } +} diff --git a/docs/content/getting-started/quickstarts/quickstart-aws/snippets/aws-memorydb-existing.bicep b/docs/content/getting-started/quickstarts/quickstart-aws/snippets/aws-memorydb-existing.bicep new file mode 100644 index 000000000..ca5b9cb29 --- /dev/null +++ b/docs/content/getting-started/quickstarts/quickstart-aws/snippets/aws-memorydb-existing.bicep @@ -0,0 +1,13 @@ +import aws as aws + +param memoryDBClusterName string = 'demo-memorydb-cluster' +resource memoryDBCluster 'AWS.MemoryDB/Cluster@default' existing = { + alias: memoryDBClusterName + properties: { + ClusterName: memoryDBClusterName + } +} + +output memoryDBConnectionString string = 'rediss://${memoryDBCluster.properties.ClusterEndpoint.Address}:${memoryDBCluster.properties.ClusterEndpoint.Port}' +output memoryDBHost string = memoryDBCluster.properties.ClusterEndpoint.Address +output memoryDBPort int = memoryDBCluster.properties.ClusterEndpoint.Port diff --git a/docs/content/getting-started/quickstarts/quickstart-aws/snippets/aws-memorydb.bicep b/docs/content/getting-started/quickstarts/quickstart-aws/snippets/aws-memorydb.bicep new file mode 100644 index 000000000..a6572f160 --- /dev/null +++ b/docs/content/getting-started/quickstarts/quickstart-aws/snippets/aws-memorydb.bicep @@ -0,0 +1,45 @@ +import aws as aws + +@description('Name of the EKS cluster used for app deployment') +param eksClusterName string + +// Reference the existing EKS cluster using the 'existing' keyword to provision the MemoryDB cluster in the same VPC and subnet as the EKS cluster +resource eksCluster 'AWS.EKS/Cluster@default' existing = { + alias: eksClusterName + properties: { + Name: eksClusterName + } +} + +@description('Name of the subnet group for the MemoryDB cluster') +param subnetGroupName string = 'demo-memorydb-subnet-group' + +// Create a subnetgroup with the VPC and subnet IDs from the EKS cluster. +resource subnetGroup 'AWS.MemoryDB/SubnetGroup@default' = { + alias:subnetGroupName + properties: { + SubnetGroupName: subnetGroupName + SubnetIds: eksCluster.properties.ResourcesVpcConfig.SubnetIds + } +} + +@description('Name of the MemoryDb cluster') +param memoryDBClusterName string = 'demo-memorydb-cluster' + +// Create a MemoryDB clsuster with subnetgroupName that was created before and the EKS cluster security group ID to enable the cluster connect to MemoryDB . +resource memoryDBCluster 'AWS.MemoryDB/Cluster@default' = { + alias: memoryDBClusterName + properties: { + ClusterName: memoryDBClusterName + NodeType: 'db.t4g.small' + ACLName: 'open-access' + SecurityGroupIds: [eksCluster.properties.ClusterSecurityGroupId] + SubnetGroupName: subnetGroup.name + NumReplicasPerShard: 0 + } +} + +// Use the output keyword to expose values to the parent module. This allows you to use the module in a nested fashion. +output memoryDBConnectionString string = 'rediss://${memoryDBCluster.properties.ClusterEndpoint.Address}:${memoryDBCluster.properties.ClusterEndpoint.Port}' +output memoryDBHost string = memoryDBCluster.properties.ClusterEndpoint.Address +output memoryDBPort int = memoryDBCluster.properties.ClusterEndpoint.Port diff --git a/docs/content/getting-started/quickstarts/quickstart-aws/todoapp-withdb.png b/docs/content/getting-started/quickstarts/quickstart-aws/todoapp-withdb.png new file mode 100644 index 000000000..9939ae4ae Binary files /dev/null and b/docs/content/getting-started/quickstarts/quickstart-aws/todoapp-withdb.png differ diff --git a/docs/content/getting-started/quickstarts/quickstart-container-wi/index.md b/docs/content/getting-started/quickstarts/quickstart-container-wi/index.md index eefd53eb1..4098613e2 100644 --- a/docs/content/getting-started/quickstarts/quickstart-container-wi/index.md +++ b/docs/content/getting-started/quickstarts/quickstart-container-wi/index.md @@ -33,7 +33,7 @@ rad init ## Step 2: Define a Radius environment -Create a file named `app.bicep` and define a Radius environment with [identity property]({{< ref "operations/environments" >}}) set. This configures your environment to use your Azure AD workload identity installation with your cluster's OIDC endpoint: +Create a file named `app.bicep` and define a Radius environment with [identity property]({{< ref "operations/environments/overview" >}}) set. This configures your environment to use your Azure AD workload identity installation with your cluster's OIDC endpoint: {{< rad file="snippets/container-wi.bicep" embed=true marker="//ENVIRONMENT">}} diff --git a/docs/content/getting-started/quickstarts/quickstart-environment-variables/index.md b/docs/content/getting-started/quickstarts/quickstart-environment-variables/index.md index ebeba1094..e1c19b3bc 100644 --- a/docs/content/getting-started/quickstarts/quickstart-environment-variables/index.md +++ b/docs/content/getting-started/quickstarts/quickstart-environment-variables/index.md @@ -17,7 +17,7 @@ This quickstart will teach you: ## Prerequisites - [Radius CLI]({{< ref "getting-started" >}}) -- [Radius environment]({{< ref "operations/environments" >}}) +- [Radius environment]({{< ref "operations/environments/overview" >}}) ## Step 1: Model an app and container diff --git a/docs/content/getting-started/quickstarts/quickstart-volumes/index.md b/docs/content/getting-started/quickstarts/quickstart-volumes/index.md index 265a5700f..d442808f5 100644 --- a/docs/content/getting-started/quickstarts/quickstart-volumes/index.md +++ b/docs/content/getting-started/quickstarts/quickstart-volumes/index.md @@ -16,7 +16,7 @@ This quickstart will provide an overview of how to: ## Prerequisites - [rad CLI]({{< ref getting-started >}}) -- [Radius environment]({{< ref "operations/environments" >}}) +- [Radius environment]({{< ref "operations/environments/overview" >}}) ## Step 1: Define an app and a container diff --git a/docs/content/getting-started/supported-languages/_index.md b/docs/content/getting-started/supported-languages/_index.md index 1ac7a041d..3dfac0fc6 100644 --- a/docs/content/getting-started/supported-languages/_index.md +++ b/docs/content/getting-started/supported-languages/_index.md @@ -7,11 +7,3 @@ weight: 900 categories: "How-To" tags: ["infrastructure-as-code"] --- - -Radius supports a variety of infrastructure-as-code (IaC) languages. - -{{% alert title="Other languages" color="info" %}} -Currently, Radius supports Bicep. Terraform support is underway as our next priority IaC language. -{{% /alert %}} - -## Languages diff --git a/docs/content/operations/custom-recipes/_index.md b/docs/content/operations/custom-recipes/index.md similarity index 100% rename from docs/content/operations/custom-recipes/_index.md rename to docs/content/operations/custom-recipes/index.md diff --git a/docs/content/operations/environments/_index.md b/docs/content/operations/environments/_index.md index c484ecea5..28681e981 100644 --- a/docs/content/operations/environments/_index.md +++ b/docs/content/operations/environments/_index.md @@ -4,152 +4,6 @@ title: "Radius environments" linkTitle: "Environments" description: "Learn about Radius environments and how to interact with them" weight: 200 -categories: "How-To" tags: ["environments"] --- -Radius environments are prepared "landing zones" for Radius applications. Applications deployed to an environment will inherit the container runtime, configuration, and other settings from the environment. Stay tuned for additional environment capabilities coming soon. - -## Configuration - -The following configuration options are available for environments: - -### Container runtime - -Radius environments can be configured with a container runtime, where Radius [containers]({{< ref container >}}) will be run, along with [gateways and routes]({{< ref networking >}}). - -A Kubernetes namespace is specified on the environment to tell Radius where to render application resources at deploy time. - -Diagram showing a Radius environment mapping to a Kubernetes cluster and namespace - -### Cloud Provider - -You can optionally configure cloud providers allow you to deploy and connect to cloud resources across various cloud platforms. For example, you can use the Radius Azure provider to run your application's services in your Kubernetes cluster, while deploying Azure resources to a specified Azure subscription and resource group. More information on setting up a cloud provider can be found in the [providers]({{< ref providers >}}) section. - -#### Supported cloud providers - -| Provider | Description | -|----------|-------------| -| [Microsoft Azure]({{< ref "providers#azure-provider" >}}) | Deploy and connect to Azure resources | -| [Amazon Web Services]({{< ref "providers#aws-provider" >}}) | Deploy and connect to AWS resources | - -### External identity provider - -You can optionally specify an external identity provider for your environment. This allows you to add to a Radius container an external identity such as an Azure user-assigned managed identity, and then specify role-based access control (RBAC) policies for that identity on Azure resources. - -Supported identity providers: - -- [Azure AD workload identity](https://azure.github.io/azure-workload-identity/docs/introduction.html) - -Visit the Azure direct connection quickstart for more information. (coming soon) - -## CLI commands - -The following commands let you interact with Radius environments: - -{{< tabs init list show delete switch >}} - -{{% codetab %}} -`rad init` initializes a new Kubernetes environment: - -```bash -rad init -``` -{{% /codetab %}} - -{{% codetab %}} -[rad env list]({{< ref rad_env_list >}}) lists all of the environments in your [workspace]({{< ref workspaces >}}): - -```bash -rad env list -``` -{{% /codetab %}} - -{{% codetab %}} -[rad env show]({{< ref rad_env_show >}}) prints information on the default or specified environment: - -```bash -rad env show -``` -{{% /codetab %}} - -{{% codetab %}} -[rad env delete]({{< ref rad_env_delete >}}) deletes the specified environment: - -```bash -rad env delete -e myenv -``` -{{% /codetab %}} - -{{% codetab %}} -[rad env switch]({{< ref rad_env_switch >}}) switches the default environment: - -```bash -rad env switch -e myenv -``` -{{% /codetab %}} - -{{< /tabs >}} - -## Schema - -Visit the [environment schema page]({{< ref environment-schema >}}) to learn more about environment properties and values. - -{{< button page="environment-schema" text="Schema" >}} - -## Example - -The following example shows an environment configured with Kubernetes as the target runtime. The `default` namespace designates where to render application resources. - -{{< rad file="snippets/environment.bicep" embed=true marker="//ENV" >}} - -## How-to: Initialize a new environment - -1. Begin by deploying a compatible [Kubernetes cluster]({{< ref "/operations/platforms/kubernetes" >}}) - - *Visit the [Kubernetes platform docs]({{< ref "/operations/platforms/kubernetes" >}}) for a list of supported clusters and specific cluster requirements.* - -1. Ensure your target kubectl context is set as the default: - ```bash - kubectl config current-context - ``` -1. Initialize a new environment with `rad init` command: - ```bash - rad init - ``` -1. Follow the prompts, specifying: - - **Namespace** - The Kubernetes namespace where your application containers and networking resources will be deployed (different than the Radius control-plane namespace, `radius-system`) - - **Azure provider** (optional) - Allows you to [deploy and manage Azure resources]({{< ref "providers#azure-provider" >}}) - - **AWS provider** (optional) - Allows you to [deploy and manage AWS resources]({{< ref "providers#aws-provider" >}}) - - **Environment name** - The name of the environment to create -1. Let the rad CLI run the following tasks: - 1. **Install Radius** - Radius installs the [control plane services]({{< ref architecture-concept >}}) in the `radius-system` namespace - 2. **Create the environment** - An environment resource is created in the Radius control plane. It maps to a Kubernetes namespace. - 3. **Add the Azure Cloud Provider** - The Azure cloud provider configuration is saved in the Radius control plane - 4. **Add the AWS Cloud Provider** - The AWS cloud provider configuration is saved in the Radius control plane - 5. **Create a workspace** - [Workspaces]({{< ref workspaces >}}) are local pointers to a cluster running Radius, and an environment. Workspaces are saved to the Radius config file (`~/.rad/config.yaml` on Linux and macOS, `%USERPROFILE%\.rad\config.yaml` on Windows) -2. Verify the initialization by running: - ```bash - kubectl get deployments -n radius-system - ``` - - You should see: - - ``` - NAME READY UP-TO-DATE AVAILABLE AGE - ucp 1/1 1 1 53s - appcore-rp 1/1 1 1 53s - bicep-de 1/1 1 1 53s - contour-contour 1/1 1 1 46s - dapr-dashboard 1/1 1 1 35s - dapr-sidecar-injector 1/1 1 1 35s - dapr-sentry 1/1 1 1 35s - dapr-operator 1/1 1 1 35s - ``` - - You can also use [`rad env list`]({{< ref rad_env_list.md >}}) to see if the created environment gets listed: - - ```bash - rad env list - ``` - diff --git a/docs/content/operations/environments/environments.png b/docs/content/operations/environments/overview/environments.png similarity index 100% rename from docs/content/operations/environments/environments.png rename to docs/content/operations/environments/overview/environments.png diff --git a/docs/content/operations/environments/overview/index.md b/docs/content/operations/environments/overview/index.md new file mode 100644 index 000000000..b488a477b --- /dev/null +++ b/docs/content/operations/environments/overview/index.md @@ -0,0 +1,155 @@ +--- +type: docs +title: "Overview: Radius environments" +linkTitle: "Overview" +description: "Learn about Radius environments and how to interact with them" +weight: 100 +categories: "Overview" +tags: ["environments"] +--- + +Radius environments are prepared "landing zones" for Radius applications. Applications deployed to an environment will inherit the container runtime, configuration, and other settings from the environment. Stay tuned for additional environment capabilities coming soon. + +## Configuration + +The following configuration options are available for environments: + +### Container runtime + +Radius environments can be configured with a container runtime, where Radius [containers]({{< ref container >}}) will be run, along with [gateways and routes]({{< ref networking >}}). + +A Kubernetes namespace is specified on the environment to tell Radius where to render application resources at deploy time. + +Diagram showing a Radius environment mapping to a Kubernetes cluster and namespace + +### Cloud Provider + +You can optionally configure cloud providers allow you to deploy and connect to cloud resources across various cloud platforms. For example, you can use the Radius Azure provider to run your application's services in your Kubernetes cluster, while deploying Azure resources to a specified Azure subscription and resource group. More information on setting up a cloud provider can be found in the [providers]({{< ref providers >}}) section. + +#### Supported cloud providers + +| Provider | Description | +|----------|-------------| +| [Microsoft Azure]({{< ref "providers#azure-provider" >}}) | Deploy and connect to Azure resources | +| [Amazon Web Services]({{< ref "providers#aws-provider" >}}) | Deploy and connect to AWS resources | + +### External identity provider + +You can optionally specify an external identity provider for your environment. This allows you to add to a Radius container an external identity such as an Azure user-assigned managed identity, and then specify role-based access control (RBAC) policies for that identity on Azure resources. + +Supported identity providers: + +- [Azure AD workload identity](https://azure.github.io/azure-workload-identity/docs/introduction.html) + +Visit the Azure direct connection quickstart for more information. (coming soon) + +## CLI commands + +The following commands let you interact with Radius environments: + +{{< tabs init list show delete switch >}} + +{{% codetab %}} +`rad init` initializes a new Kubernetes environment: + +```bash +rad init +``` +{{% /codetab %}} + +{{% codetab %}} +[rad env list]({{< ref rad_env_list >}}) lists all of the environments in your [workspace]({{< ref workspaces >}}): + +```bash +rad env list +``` +{{% /codetab %}} + +{{% codetab %}} +[rad env show]({{< ref rad_env_show >}}) prints information on the default or specified environment: + +```bash +rad env show +``` +{{% /codetab %}} + +{{% codetab %}} +[rad env delete]({{< ref rad_env_delete >}}) deletes the specified environment: + +```bash +rad env delete -e myenv +``` +{{% /codetab %}} + +{{% codetab %}} +[rad env switch]({{< ref rad_env_switch >}}) switches the default environment: + +```bash +rad env switch -e myenv +``` +{{% /codetab %}} + +{{< /tabs >}} + +## Schema + +Visit the [environment schema page]({{< ref environment-schema >}}) to learn more about environment properties and values. + +{{< button page="environment-schema" text="Schema" >}} + +## Example + +The following example shows an environment configured with Kubernetes as the target runtime. The `default` namespace designates where to render application resources. + +{{< rad file="snippets/environment.bicep" embed=true marker="//ENV" >}} + +## How-to: Initialize a new environment + +1. Begin by deploying a compatible [Kubernetes cluster]({{< ref "/operations/platforms/kubernetes" >}}) + + *Visit the [Kubernetes platform docs]({{< ref "/operations/platforms/kubernetes" >}}) for a list of supported clusters and specific cluster requirements.* + +1. Ensure your target kubectl context is set as the default: + ```bash + kubectl config current-context + ``` +1. Initialize a new environment with `rad init` command: + ```bash + rad init + ``` +1. Follow the prompts, specifying: + - **Namespace** - The Kubernetes namespace where your application containers and networking resources will be deployed (different than the Radius control-plane namespace, `radius-system`) + - **Azure provider** (optional) - Allows you to [deploy and manage Azure resources]({{< ref "providers#azure-provider" >}}) + - **AWS provider** (optional) - Allows you to [deploy and manage AWS resources]({{< ref "providers#aws-provider" >}}) + - **Environment name** - The name of the environment to create +1. Let the rad CLI run the following tasks: + 1. **Install Radius** - Radius installs the [control plane services]({{< ref architecture-concept >}}) in the `radius-system` namespace + 2. **Create the environment** - An environment resource is created in the Radius control plane. It maps to a Kubernetes namespace. + 3. **Add the Azure Cloud Provider** - The Azure cloud provider configuration is saved in the Radius control plane + 4. **Add the AWS Cloud Provider** - The AWS cloud provider configuration is saved in the Radius control plane + 5. **Create a workspace** - [Workspaces]({{< ref workspaces >}}) are local pointers to a cluster running Radius, and an environment. Workspaces are saved to the Radius config file (`~/.rad/config.yaml` on Linux and macOS, `%USERPROFILE%\.rad\config.yaml` on Windows) +2. Verify the initialization by running: + ```bash + kubectl get deployments -n radius-system + ``` + + You should see: + + ``` + NAME READY UP-TO-DATE AVAILABLE AGE + ucp 1/1 1 1 53s + appcore-rp 1/1 1 1 53s + bicep-de 1/1 1 1 53s + contour-contour 1/1 1 1 46s + dapr-dashboard 1/1 1 1 35s + dapr-sidecar-injector 1/1 1 1 35s + dapr-sentry 1/1 1 1 35s + dapr-operator 1/1 1 1 35s + ``` + + You can also use [`rad env list`]({{< ref rad_env_list.md >}}) to see if the created environment gets listed: + + ```bash + rad env list + ``` + diff --git a/docs/content/operations/environments/providers-overview.png b/docs/content/operations/environments/overview/providers-overview.png similarity index 100% rename from docs/content/operations/environments/providers-overview.png rename to docs/content/operations/environments/overview/providers-overview.png diff --git a/docs/content/operations/environments/snippets/environment.bicep b/docs/content/operations/environments/overview/snippets/environment.bicep similarity index 100% rename from docs/content/operations/environments/snippets/environment.bicep rename to docs/content/operations/environments/overview/snippets/environment.bicep diff --git a/docs/content/operations/environments/workspaces/_index.md b/docs/content/operations/environments/workspaces/index.md similarity index 98% rename from docs/content/operations/environments/workspaces/_index.md rename to docs/content/operations/environments/workspaces/index.md index 2606bf3c3..91306ee93 100644 --- a/docs/content/operations/environments/workspaces/_index.md +++ b/docs/content/operations/environments/workspaces/index.md @@ -1,10 +1,10 @@ --- type: docs -title: "Radius workspaces" +title: "Overview: Radius workspaces" linkTitle: "Workspaces" description: "Learn how to handle multiple Radius platforms and environments with workspaces" -weight: 100 -categories: "How-To" +weight: 200 +categories: "Overview" --- Workspaces allow you to manage multiple Radius platforms and environments using a local configuration file. You can easily define and switch between workspaces to deploy and manage applications across local, test, and production environments. diff --git a/docs/content/operations/providers/_index.md b/docs/content/operations/providers/index.md similarity index 98% rename from docs/content/operations/providers/_index.md rename to docs/content/operations/providers/index.md index 4cdf15942..a1f8325f0 100644 --- a/docs/content/operations/providers/_index.md +++ b/docs/content/operations/providers/index.md @@ -38,7 +38,7 @@ The Azure provider allows you to deploy and connect to Azure resources from a se #### Add a cloud provider when initializing an environment -1. Initialize a new [environment]({{< ref "operations/environments" >}}) with `rad init` +1. Initialize a new [environment]({{< ref "operations/environments/overview" >}}) with `rad init` 1. Select the Kubernetes cluster to install Radius into. Enter an environment name and base Kubernetes namespace to deploy the apps into. 1. Select "yes" to add a cloud provider and select Azure as the cloud provider 1. Specify your Azure subscription and resource group @@ -83,7 +83,7 @@ The AWS provider allows you to deploy and connect to AWS resources from a Radius #### Add a cloud provider when initializing an environment -1. Initialize a new [environment]({{< ref "operations/environments" >}}) with `rad init` +1. Initialize a new [environment]({{< ref "operations/environments/overview" >}}) with `rad init` 1. Select the Kubernetes cluster to install Radius into. Enter an environment name and base Kubernetes namespace to deploy the apps into. 1. Select "yes" to add a cloud provider and select AWS as the cloud provider diff --git a/docs/content/reference/resource-schema/core-schema/environment-schema/index.md b/docs/content/reference/resource-schema/core-schema/environment-schema/index.md index 045238f7e..e49a7e058 100644 --- a/docs/content/reference/resource-schema/core-schema/environment-schema/index.md +++ b/docs/content/reference/resource-schema/core-schema/environment-schema/index.md @@ -89,4 +89,4 @@ The [Kubernetes Metadata extension]({{< ref "/operations/platforms/kubernetes/ku ## Further reading -- [Radius environments]({{< ref "operations/environments" >}}) +- [Radius environments]({{< ref "operations/environments/overview" >}}) diff --git a/docs/content/reference/resource-schema/core-schema/volumes/volume-azure-keyvault/_index.md b/docs/content/reference/resource-schema/core-schema/volumes/volume-azure-keyvault/index.md similarity index 98% rename from docs/content/reference/resource-schema/core-schema/volumes/volume-azure-keyvault/_index.md rename to docs/content/reference/resource-schema/core-schema/volumes/volume-azure-keyvault/index.md index 801bf28c8..f07cc2812 100644 --- a/docs/content/reference/resource-schema/core-schema/volumes/volume-azure-keyvault/_index.md +++ b/docs/content/reference/resource-schema/core-schema/volumes/volume-azure-keyvault/index.md @@ -12,7 +12,7 @@ Radius supports mounting an Azure Key Vault as a persistent volume to the contai - [Azure Key Vault CSI Driver](https://azure.github.io/secrets-store-csi-driver-provider-azure/demos/standard-walkthrough/) installed on your cluster - [Azure AD Workload Identity](https://azure.github.io/azure-workload-identity/docs/installation.html) installed on your cluster -- `azure.com.workload` identity configured on your [environment]({{< ref "operations/environments" >}}) +- `azure.com.workload` identity configured on your [environment]({{< ref "operations/environments/overview" >}}) - Your Azure Key Vault access policy should be set to [Azure role-based access control](https://learn.microsoft.com/azure/key-vault/general/rbac-guide?tabs=azure-cli) ## Resource format diff --git a/docs/layouts/partials/page-meta-links.html b/docs/layouts/partials/page-meta-links.html index 06b57245d..2e117191d 100644 --- a/docs/layouts/partials/page-meta-links.html +++ b/docs/layouts/partials/page-meta-links.html @@ -19,7 +19,7 @@ {{ end }} {{ $editURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }} {{ $createURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }} - {{ $issuesURL := printf "%s/issues/new?title=%s" $gh_repo (safeURL $.Title )}} + {{ $issuesURL := printf "%s/issues/new/choose" $gh_repo }} {{ $newPageStub := resources.Get "stubs/new-page-template.md" }} {{ $newPageQS := querify "value" $newPageStub.Content "filename" "change-me.md" | safeURL }} {{ $newPageURL := printf "%s/new/%s?%s" $gh_repo $gh_repo_path $newPageQS }} @@ -27,7 +27,7 @@ Edit this page New docs issue {{ if $gh_project_repo }} - {{ $project_issueURL := printf "%s/issues/new" $gh_project_repo }} + {{ $project_issueURL := printf "%s/issues/new/choose" $gh_project_repo }} New project issue {{ end }} diff --git a/docs/layouts/partials/sidebar-tree.html b/docs/layouts/partials/sidebar-tree.html index 3b33f9059..1a63da336 100644 --- a/docs/layouts/partials/sidebar-tree.html +++ b/docs/layouts/partials/sidebar-tree.html @@ -5,14 +5,14 @@ {{ if not .Site.Params.ui.sidebar_search_disable -}} {{ else -}}
@@ -42,7 +42,7 @@ {{ $ulNr := .ulNr -}} {{ $ulShow := .ulShow -}} {{ $active := and (not $shouldDelayActive) (eq $s $p) -}} -{{ $activePath := and (not $shouldDelayActive) ($p.IsDescendant $s) -}} +{{ $activePath := and (not $shouldDelayActive) (or (eq $p $s) ($p.IsDescendant $s)) -}} {{ $show := cond (or (lt $ulNr $ulShow) $activePath (and (not $shouldDelayActive) (eq $s.Parent $p.Parent)) (and (not $shouldDelayActive) (eq $s.Parent $p)) (not $p.Site.Params.ui.sidebar_menu_compact) (and (not $shouldDelayActive) ($p.IsDescendant $s.Parent))) true false -}} {{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}} {{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}} @@ -53,9 +53,9 @@
  • {{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}} - + {{ else -}} - {{ with $s.Params.Icon}}{{ end }}{{ $s.LinkTitle }} + {{ with $s.Params.Icon}}{{ end }}{{ $s.LinkTitle }} {{- end }} {{- if $withChild }} {{- $ulNr := add $ulNr 1 }} diff --git a/docs/layouts/partials/taxonomy_terms_cloud.html b/docs/layouts/partials/taxonomy_terms_cloud.html new file mode 100644 index 000000000..8d120710d --- /dev/null +++ b/docs/layouts/partials/taxonomy_terms_cloud.html @@ -0,0 +1,18 @@ +{{ $context := .context }} +{{ $taxo := .taxo }} +{{ $title := .title }} +{{ if and (isset $context.Site.Taxonomies (lower $taxo)) ($context.Page.IsHome) }} + {{ $taxonomy := index $context.Site.Taxonomies (lower $taxo) }} + {{ if (gt (len $taxonomy) 0)}} +
    + {{ with $title }} +
    {{ . }}
    + {{ end }} + +
    + {{ end }} +{{ end }} \ No newline at end of file