Skip to content

Conversation

@sk593
Copy link
Contributor

@sk593 sk593 commented Oct 22, 2025

Description

Adding container recipes for the Radius.Compute/container type.

Related GitHub Issue:

Testing

Contributor Checklist

  • File names follow naming conventions and folder structure
  • Platform engineer documentation is in README.md
  • Developer documentation is the top-level description property
  • Example of defining the Resource Type is in the developer documentation
  • Example of using the Resource Type with a Container is in the developer documentation
  • Verified the output of rad resource-type show is correct
  • All properties in the Resource Type definition have clear descriptions
  • Enum properties have values defined in enum: []
  • Required properties are listed in required: [] for every object property (not just the top-level properties)
  • Properties about the deployed resource, such as connection strings, are defined as read-only properties and are marked as readOnly: true
  • Recipes include a results output variable with all read-only properties set
  • Environment-specific parameters, such as a vnet ID, are exposed for platform engineers to set in the Environment
  • Recipes use the Recipe context object when possible
  • Recipes are provided for at least one platform
  • Recipes handle secrets securely
  • Recipes are idempotent
  • Resource types and recipes were tested

@sk593 sk593 force-pushed the containers-recipe branch from 877d8b4 to 394ffad Compare October 22, 2025 21:47
'/planes/kubernetes/local/namespaces/${context.runtime.kubernetes.namespace}/providers/core/Secret/${secretName}'
]
values: {
secretName: secretName
Copy link
Contributor

Choose a reason for hiding this comment

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

Does secretName need to be added to the Secrets resource type definition as a read only property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was added here because the container needed the name of the secret in order to connect. This can be reverted for now until we add a secrets connection

locals {
resource_name = var.context.resource.name
namespace = var.context.runtime.kubernetes.namespace
application_name = var.context.application != null ? var.context.application.name : ""
Copy link
Contributor

Choose a reason for hiding this comment

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

application is a required property. Do you need to be checking for null here?

Comment on lines 26 to 32
# Connections - Extract secret connections from Radius.Security/secrets resources
connections = try(var.context.resource.connections, {})
secret_connections = {
for name, conn in local.connections : name => conn
if try(conn.status.computedValues.secretName, null) != null
}
secret_names = [for name, conn in local.secret_connections : conn.status.computedValues.secretName]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain this in more detail in the comments. I'm not able to parse what this is doing and why.

Comment on lines +45 to +49
labels = {
resource = local.resource_name
app = local.application_name
"radapp.io/application" = local.application_name
"app.kubernetes.io/name" = local.normalized_name
Copy link
Contributor

Choose a reason for hiding this comment

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

We agreed to these standardized labels:

radapp.io/resource
radapp.io/resource-type
radapp.io/application
radapp.io/environment
radapp.io/resource-group
radapp.io/recipe-pack

https://teams.microsoft.com/l/message/19:meeting_YTUzYjgyNjAtNTgzNi00NTgyLWFmMTgtZDEwMDU3ZWYwYWU1@thread.v2/1759186503365?context=%7B%22contextType%22%3A%22chat%22%7D

Comment on lines 314 to 337
dynamic "value_from" {
for_each = env.value.value_from != null ? [env.value.value_from] : []
content {
dynamic "secret_key_ref" {
for_each = try(value_from.value.secretKeyRef, null) != null ? [value_from.value.secretKeyRef] : []
content {
name = secret_key_ref.value.name
key = secret_key_ref.value.key
}
}
}
}
}
}

# Environment variables from connected secrets (Radius.Security/secrets)
dynamic "env_from" {
for_each = local.secret_names
content {
secret_ref {
name = env_from.value
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we're handling secrets correctly. This assumes secrets are only stored in Kubernetes. When the majority of secrets will be in Azure Key Vault or HashiCorp Vault.

Comment on lines +278 to +280
# Init containers
dynamic "init_container" {
for_each = local.init_container_specs
Copy link
Contributor

Choose a reason for hiding this comment

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

Is is possible to de-duplicate init and regular containers since they have the same schema? This would simplify the recipe significantly.

}
}
}
connections: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add connections to volumes, persistent volumes, and remove secrets until rework is done

@sk593 sk593 force-pushed the containers-recipe branch 4 times, most recently from 4cf163b to 90eb691 Compare October 27, 2025 22:13
@sk593 sk593 force-pushed the containers-recipe branch from 90eb691 to 0796afe Compare October 27, 2025 22:15
@sk593 sk593 marked this pull request as ready for review October 27, 2025 22:19
@sk593 sk593 requested review from a team as code owners October 27, 2025 22:19
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.

2 participants