-
Notifications
You must be signed in to change notification settings - Fork 13
Add routes recipes #50
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
92aa70e to
de46894
Compare
.github/scripts/validate-common.sh
Outdated
| # Define common configuration | ||
| setup_config() { | ||
| resource_folders=("Security") | ||
| # Define specific resource types to test instead of entire folders |
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.
Updating the workflow to allow testing to be added for individual resources instead of a namespace
Compute/routes/recipes/kubernetes/bicep/kubernetes-routes.bicep
Outdated
Show resolved
Hide resolved
26f04ab to
801d78a
Compare
| } | ||
| } | ||
|
|
||
| resource myContainer 'Radius.Compute/containers@2025-08-01-preview' = { |
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.
I added this application template as an example of how the routes resource can be deployed. I'm not sure that we'd want this to be a test scenario for the repo since it's more of an integration/E2E test and it'd require the Gateway CRD to be installed on the test cluster (I set up the CRDs and necessary RBAC to deploy this when manually testing to verify that it'd work)
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.
I'm open to suggestions on if this should be included in this repo's test framework
| namespace: context.runtime.kubernetes.namespace | ||
| } | ||
| ] | ||
| hostnames: length(hostnames) > 0 ? hostnames : ['localhost'] |
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.
Rather than defaulting to localhost, I think this should be not specified if it is not provided. From the docs:
If no hostname is specified, traffic is routed based on HTTPRoute rules and filters (optional).
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
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.
I noticed this was not updated in the Terraform Recipe, only Bicep.
| backendRefs: [ | ||
| { | ||
| name: '${toLower(last(split(rule.destinationContainer.resourceId, '/')))}-${rule.destinationContainer.containerName}' | ||
| port: 80 |
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 needs reference rule.destinationContainer.containerPortName. We cannot assume a port number.
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.
Discussed offline. We'll update the containerPortName variable to expect an integer so it can be passed as an accessible input variable
c60f4df to
20f2eb0
Compare
|
But it's not required in the recipe. Pls check if we need to update schema to align with recipe. |
|
@zachcasper , @sk593 perhaps this was discussed already but should include gRPC as another route_kind in the yaml and update the recipe for it? |
20f2eb0 to
00cacb0
Compare
I don't think this was discussed but we can add gRPC. thoughts @zachcasper ? |
|
Will this support WebSocket connections, including HTTPS-to-WSS protocol switching, especially in the context of route-based promotion capabilities? |
00cacb0 to
ec78cda
Compare
I'm not too familiar with HTTPs-to-WSS but I believe it should. Routes support HTTP/HTTPS so the setup for a WebSocket connection would need to be defined in the Recipe. @zachcasper do you have any additional input on this? |
I don't think it needs to be required by the Recipe. But the resource should be tied to an application |
|
|
||
| // Assume Gateway already exists - use a default gateway name | ||
| // Platform engineers should configure this via recipe parameters or environment | ||
| var gatewayName = 'default-gateway' |
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.
What gateway controllers use default-gateway such that we should assume a default? I looked at NGINX and the default name is the release name. The Cilium gateway name is cilium.
I'm afraid users will get an error that says "default-gateway gateway not found" instead of "gatewayName parameter not 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.
The recipe was being tested using the Kubernetes Gateway API. We can update this to use a parameter instead of a default name
|
|
||
| # Assume Gateway already exists - use a default gateway name | ||
| # Platform engineers should configure this via recipe parameters or environment | ||
| gateway_name = "default-gateway" |
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.
See previous comment about 'default-gateway'.
| namespace = var.context.runtime.kubernetes.namespace | ||
| } | ||
| ] | ||
| hostnames = length(local.hostnames) > 0 ? local.hostnames : ["localhost"] |
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.
I previously made this comment in the Bicep recipe:
Rather than defaulting to localhost, I think this should be not specified if it is not provided. From the docs:
If no hostname is specified, traffic is routed based on HTTPRoute rules and filters (optional).
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.
Ah, looks like this was updated in the Bicep recipe but not Terraform. Will update
What would it mean to require |
That sounds right to me. Should be HTTP route type. |
gRPC can easily be added in the future. We've covered the majority of cases here. |
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
2f5ef09 to
fb57293
Compare
Signed-off-by: sk593 <shruthikumar@microsoft.com>
648770a to
01d5129
Compare
01d5129 to
59ab01d
Compare
This PR adds Recipes for the Routes resource type. Since Routes need a container for the connection to work, this PR also adds a simple container Recipe