Skip to content

Commit

Permalink
Merge branch 'edge' into jasonviviano/tf-overview
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonviviano authored Mar 25, 2024
2 parents 70a093e + e7965e0 commit 164d595
Show file tree
Hide file tree
Showing 11 changed files with 251 additions and 27 deletions.
6 changes: 6 additions & 0 deletions .github/config/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ lifecycles
linkTitle
linter
linux
lineNos
liveness
livenessProbe
localWorkspace
Expand Down Expand Up @@ -313,6 +314,7 @@ redoc
resourceGroup
replacePrefix
repo
repos
resourceGroupName
RecipeSpecified
resourceId
Expand Down Expand Up @@ -983,6 +985,7 @@ learnings
architected
customizable
Gitops
GitLab
OSS
SRE
SREs
Expand Down Expand Up @@ -1236,3 +1239,6 @@ GitAuthConfig
GitAuthConfigPat
SecretConfig
appgraph
EnvironmentVariables
TerraformConfigPropertiesProviders
ProviderConfigProperties
8 changes: 4 additions & 4 deletions docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baseURL = "https://docs.radapp.io/"
baseURL = "https://edge.docs.radapp.io/"
languageCode = "en-us"
title = "Radius Docs"
theme = "docsy"
Expand Down Expand Up @@ -67,17 +67,17 @@ tag = "tags"

[params]
copyright = "Radius"
version = "v0.31"
version = "edge"
tag_version = "latest"
chart_version = "0.31.0"
chart_version = "0.26.0"

# Algolia Search
algolia_docsearch = true

# GitHub Information
github_repo = "https://github.com/radius-project/docs"
github_subdir = "docs"
github_branch = "v0.31"
github_branch = "edge"
github_project_repo = "https://github.com/radius-project/radius"

# Versioning
Expand Down
81 changes: 81 additions & 0 deletions docs/content/guides/recipes/howto-private-registry/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
type: docs
title: "How-To: Pull Terraform modules from private git repositories"
linkTitle: "Private git repos"
description: "Learn how to setup your Radius environment to pull Terraform Recipe templates from a private git repository."
weight: 500
categories: "How-To"
tags: ["recipes", "terraform"]
---

This how-to guide will describe how to:

- Configure a Radius Environment to be able to pull Terraform Recipe templates from a private git repository.

### Prerequisites

Before you get started, you'll need to make sure you have the following tools and resources:

- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}})
- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [Radius initialized with `rad init`]({{< ref howto-environment >}})

## Step 1: Create a personal access token

Create a personal access token, this can be from [GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens), [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html), [Azure DevOps](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows), or any other Git platform.

The PAT should have access to read the files inside the specific private repository.

## Step 2: Define a secret store resource

Configure a [Radius Secret Store]({{< ref "/guides/author-apps/secrets/overview" >}}) with the personal access token or username + password you previously created, which has access to your private git repository. Define the namespace for the cluster that will contain your [Kubernetes Secret](https://kubernetes.io/docs/concepts/configuration/secret/) with the `resource` property.

> While this example shows a Radius-managed secret store where Radius creates the underlying secrets infrastructure, you can also bring your own existing secrets. Refer to the [secrets documentation]({{< ref "/guides/author-apps/secrets/overview" >}}) for more information.
Create a Bicep file `env.bicep`, import Radius, and define your resource:

{{< rad file="snippets/env.bicep" embed=true marker="//SECRETSTORE" >}}

> The property `pat` is required and refers to your personal access token or password, while `username` is optional and refers to a username, if your git platform requires one.
## Step 3: Configure Terraform Recipe git authentication

`recipeConfig` allows you to configure how Recipes should be setup and run. One available option is to specify git credentials for pulling Terraform Recipes from git sources. For more information refer to the [Radius Environment schema]({{< ref environment-schema >}}) page.

In your `env.bicep` file add an Environment resource, along with Recipe configuration which leverages the previously defined secret store for git authentication.

{{< rad file="snippets/env.bicep" embed=true marker="//ENV" >}}

## Step 4: Add a Terraform Recipe

Update your Environment with a Terraform Recipe, pointing to your private git repository. Note that your `templatePath` should contain a `git::` prefix, per the [Terraform module documentation](https://developer.hashicorp.com/terraform/language/modules/sources#generic-git-repository).

{{< rad file="snippets/env-complete.bicep" embed=true marker="//ENV" markdownConfig="{linenos=table,hl_lines=[\"22-30\"],linenostart=30,lineNos=false}" >}}

## Step 5: Deploy your Radius Environment

Deploy your new Radius Environment:

```
rad deploy ./env.bicep -p pat=******
```

## Done

Your Radius Environment is now ready to utilize your Radius Recipes stored inside your private registry. For more information on Radius Recipes visit the [Recipes overview page]({{< ref "/guides/recipes/overview" >}}).

## Cleanup

You can delete a Radius Environment by running the following command:

```
rad env delete my-env
```

## Further reading

- [Recipes overview]({{< ref "/guides/recipes/overview" >}})
- [Radius Environments]({{< ref "/guides/deploy-apps/environments/overview" >}})
- [`rad recipe CLI reference`]({{< ref rad_recipe >}})
- [`rad env CLI reference`]({{< ref rad_env >}})
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//SECRETSTORE
import radius as radius

@description('Required value, refers to the personal access token or password of the git platform')
@secure()
param pat string

resource secretStoreGit 'Applications.Core/secretStores@2023-10-01-preview' = {
name: 'my-git-secret-store'
properties: {
resource: 'my-secret-namespace/github'
type: 'generic'
data: {
pat: {
value: pat
}
}
}
}
//SECRETSTORE

//ENV
resource env 'Applications.Core/environments@2023-10-01-preview' = {
name: 'my-env'
properties: {
compute: {
kind: 'kubernetes'
namespace: 'my-namespace'
}
recipeConfig: {
terraform: {
authentication: {
git: {
pat: {
// The hostname of your git platform, such as 'dev.azure.com' or 'github.com'
'github.com':{
secret: secretStoreGit.id
}
}
}
}
}
}
recipes: {
'Applications.Datastores/redisCaches': {
default: {
templateKind: 'terraform'
// Git template path
templatePath:'git::https://github.com/my-org/my-repo'
}
}
}
}
}
//ENV
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//SECRETSTORE
import radius as radius

@description('Required value, refers to the personal access token or password of the git platform')
@secure()
param pat string

resource secretStoreGit 'Applications.Core/secretStores@2023-10-01-preview' = {
name: 'my-git-secret-store'
properties: {
resource: 'my-secret-namespace/github'
type: 'generic'
data: {
pat: {
value: pat
}
}
}
}
//SECRETSTORE

//ENV
resource env 'Applications.Core/environments@2023-10-01-preview' = {
name: 'my-env'
properties: {
compute: {
kind: 'kubernetes'
namespace: 'my-namespace'
}
recipeConfig: {
terraform: {
authentication: {
git: {
pat: {
// The hostname of your git platform, such as 'dev.azure.com' or 'github.com'
'github.com':{
secret: secretStoreGit.id
}
}
}
}
}
}
}
}
//ENV
2 changes: 1 addition & 1 deletion docs/content/reference/cli/rad_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Manage Radius Applications
### SEE ALSO

* [rad]({{< ref rad.md >}}) - Radius CLI
* [rad application connections]({{< ref rad_application_connections.md >}}) - Shows the connections for an application.
* [rad application delete]({{< ref rad_application_delete.md >}}) - Delete Radius Application
* [rad application graph]({{< ref rad_application_graph.md >}}) - Shows the application graph for an application.
* [rad application list]({{< ref rad_application_list.md >}}) - List Radius Applications
* [rad application show]({{< ref rad_application_show.md >}}) - Show Radius Application details
* [rad application status]({{< ref rad_application_status.md >}}) - Show Radius Application status
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
type: docs
title: "rad application connections CLI reference"
linkTitle: "rad application connections"
slug: rad_application_connections
url: /reference/cli/rad_application_connections/
description: "Details on the rad application connections Radius CLI command"
title: "rad application graph CLI reference"
linkTitle: "rad application graph"
slug: rad_application_graph
url: /reference/cli/rad_application_graph/
description: "Details on the rad application graph Radius CLI command"
---
## rad application connections
## rad application graph

Shows the connections for an application.
Shows the application graph for an application.

### Synopsis

Shows the connections for an application
Shows the application graph for an application.

```
rad application connections [flags]
rad application graph [flags]
```

### Examples

```
# Show connections for current application
rad app connections
# Show graph for current application
rad app graph
# Show connections for specified application
rad app connections my-application
# Show graph for specified application
rad app graph my-application
```

### Options
Expand All @@ -35,7 +35,7 @@ rad app connections my-application
-a, --application string The application name
-e, --environment string The environment name
-g, --group string The resource group name
-h, --help help for connections
-h, --help help for graph
-w, --workspace string The workspace name
```

Expand Down
4 changes: 4 additions & 0 deletions docs/content/reference/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ output values object = {
}
```

### Terraform private registries

Currently users cannot run `rad recipe show` on Radius Recipes registered inside of private git registries and will experience an error in the CLI.

## Bicep & Deployment Engine

### Currently using a forked version of Bicep
Expand Down
Loading

0 comments on commit 164d595

Please sign in to comment.