Skip to content

Conversation

Reshrahim
Copy link
Contributor

This PR adds the following

  1. redis.yaml that defines the schema for the Redis resource type
  2. A k8s Bicep and Terraform Recipe

Tested the Bicep and Terraform Recipe with todolist demo app

Building app.bicep...
Deploying template 'app.bicep' into environment '/planes/radius/local/resourceGroups/local/providers/applications.core/environments/local' from workspace 'local'...

Deployment In Progress...

Completed            db              Radius.Data/redisCaches
Completed            todolist        Applications.Core/applications
.                    demo            Applications.Core/containers

Deployment Complete

Resources:
    todolist        Applications.Core/applications
    demo            Applications.Core/containers
    db              Radius.Data/redisCaches

Contribution stage : Alpha level

Fixes : #7 , #8

@Reshrahim Reshrahim requested review from a team as code owners August 11, 2025 19:54
@@ -0,0 +1,42 @@
name: Radius.Data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update based on Secrets, Containers, and PersistentVolumes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Please take a look. Thanks

Reshrahim and others added 8 commits September 8, 2025 10:03
Signed-off-by: Reshma Abdul Rahim <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
}
}

resource redis 'apps/Deployment@v1' = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once Container Recipes are available, this will be updated to use Radius.Compute/Containers

Comment on lines +9 to +15
param environment string
resource redisCache 'Radius.Data/redisCaches@2025-08-01-preview' = {
name: 'redisCache'
properties: {
environment: environment
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
param environment string
resource redisCache 'Radius.Data/redisCaches@2025-08-01-preview' = {
name: 'redisCache'
properties: {
environment: environment
}
}
extension radius
param environment string
resource myApplication 'Radius.Core/applications@2025-08-01-preview' = { ... }
resource redis 'Radius.Data/redisCaches@2025-08-01-preview' = {
name: 'redis'
properties: {
environment: environment
}
}

I've been making sure the examples were whole.

}
}

When `capacity` is not set, the value is assumed to be `S`(Small) in Recipes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the property description, not here.

Comment on lines +98 to +100
// This workaround is needed because the deployment engine omits Kubernetes resources from its output.
// This allows Kubernetes resources to be cleaned up when the resource is deleted.
// Once this gap is addressed, users won't need to do this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue to reference?

}
}

output "result" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is resources not required here as it is in the Bicep recipe? If so, be sure to include the same comment from the Bicep file.

Comment on lines +81 to +82
host = "${kubernetes_service.redis.metadata[0].name}.${kubernetes_service.redis.metadata[0].namespace}.svc.cluster.local"
port = local.port
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are five read-only properties. They should all be set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a rule for Recipes that all read-only properties must be set? This Recipe implementation is similar to a alpha stage contribution not covering all the scenarios(e.g configuring TLS) and hence some properties are not set.

'/planes/kubernetes/local/namespaces/${svc.metadata.namespace}/providers/core/Service/${svc.metadata.name}'
'/planes/kubernetes/local/namespaces/${redis.metadata.namespace}/providers/apps/Deployment/${redis.metadata.name}'
]
values: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are five read-only properties. They should all be set.

@@ -0,0 +1,85 @@
terraform {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output from tflint:

$ tflint               
1 issue(s) found:

Warning: terraform "required_version" attribute is required (terraform_required_version)

  on main.tf line 1:
   1: terraform {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.12.0/docs/rules/terraform_required_version.md

Co-authored-by: Zach Casper <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
Reshrahim pushed a commit that referenced this pull request Sep 26, 2025
## Description
Updated developer documentation to be aligned with the [Redis
PR](#13)

## Testing

1. `rad resource-type create -f mySqlDatabases.yaml`
2. `rad resource-type show Radius.Data/mySqlDatabases` and confirm
output is as expected
3. `rad bicep publish-extension -f mySqlDatabases.yaml --target
radiusResources.tgz` and confirm Intellisense is as expected
4. Copy examples from rad resource-type show into a Bicep file and
confirm they compile

---------

Signed-off-by: Zach Casper <[email protected]>
superbeeny pushed a commit to superbeeny/resource-types-contrib that referenced this pull request Oct 6, 2025
## Description
Updated developer documentation to be aligned with the [Redis
PR](radius-project#13)

## Testing

1. `rad resource-type create -f mySqlDatabases.yaml`
2. `rad resource-type show Radius.Data/mySqlDatabases` and confirm
output is as expected
3. `rad bicep publish-extension -f mySqlDatabases.yaml --target
radiusResources.tgz` and confirm Intellisense is as expected
4. Copy examples from rad resource-type show into a Bicep file and
confirm they compile

---------

Signed-off-by: Zach Casper <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Redis Resource Type and Kubernetes Redis Recipe - Bicep
2 participants