-
Notifications
You must be signed in to change notification settings - Fork 11
Add redis resource type and Kubernetes Recipe in Bicep and Tf #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Reshma Abdul Rahim <[email protected]>
data/redis/redis.yaml
Outdated
@@ -0,0 +1,42 @@ | |||
name: Radius.Data |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
} | ||
} | ||
|
||
resource redis 'apps/Deployment@v1' = { |
There was a problem hiding this comment.
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
param environment string | ||
resource redisCache 'Radius.Data/redisCaches@2025-08-01-preview' = { | ||
name: 'redisCache' | ||
properties: { | ||
environment: environment | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
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.
// 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. |
There was a problem hiding this comment.
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" { |
There was a problem hiding this comment.
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.
host = "${kubernetes_service.redis.metadata[0].name}.${kubernetes_service.redis.metadata[0].namespace}.svc.cluster.local" | ||
port = local.port |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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]>
## 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]>
## 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]>
This PR adds the following
redis.yaml
that defines the schema for the Redis resource typeTested the Bicep and Terraform Recipe with todolist demo app
Contribution stage : Alpha level
Fixes : #7 , #8