Skip to content

Commit

Permalink
Remove httpRoutes from samples (#574)
Browse files Browse the repository at this point in the history
* sdf

* sdf

* wip

* wip

* wip

* version change + envoy changes

* update eshop dapr to work without httproutes

* rely on default http port

* remove ununsed params

* path edits

* test

* de

* sc

* qwef

* add healthprobes

* wip

* wip

* remove local files

* delete local files

* change to tcp probe for pods that dont support http

* nit

---------

Co-authored-by: Ryan Nowak <[email protected]>
  • Loading branch information
nithyatsu and rynowak authored Mar 12, 2024
1 parent bcb1294 commit 90b7f98
Show file tree
Hide file tree
Showing 27 changed files with 217 additions and 1,117 deletions.
49 changes: 5 additions & 44 deletions samples/eshop-dapr/infra/gateway.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,6 @@ import radius as radius
@description('The Radius application ID.')
param appId string

@description('The name of the Blazor client HTTP route.')
param blazorClientRouteName string

@description('The name of the Identity API HTTP route.')
param identityApiRouteName string

@description('The name of the Seq HTTP route.')
param seqRouteName string

@description('The name of the gateway HTTP route.')
param webshoppingGwRouteName string

@description('The name of the webstatus API HTTP route.')
param webstatusRouteName string

//-----------------------------------------------------------------------------
// Get references to existing resources
//-----------------------------------------------------------------------------

resource blazorClientRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = {
name: blazorClientRouteName
}

resource identityApiRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = {
name: identityApiRouteName
}

resource seqRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = {
name: seqRouteName
}

resource webshoppingGwRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = {
name: webshoppingGwRouteName
}

resource webstatusRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = {
name: webstatusRouteName
}

//-----------------------------------------------------------------------------
// Create the Radius gateway
//-----------------------------------------------------------------------------
Expand All @@ -54,29 +15,29 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' = {
// Identity API
{
path: '/identity/'
destination: identityApiRoute.id
destination: 'http://identity-api'
}
// Seq
{
path: '/log/' // Use trailing slash until redirects are supported
destination: seqRoute.id
destination: 'http://seq:5340'
replacePrefix: '/'
}
// Health
{
path: '/health'
destination: webstatusRoute.id
destination: 'http://webstatus'
}
// Webshopping API Gateway
{
path: '/api/'
destination: webshoppingGwRoute.id
destination: 'http://webshopping-gw'
replacePrefix: '/'
}
// Blazor Client
{
path: '/'
destination: blazorClientRoute.id
destination: 'http://blazor-client'
}
]
}
Expand Down
93 changes: 0 additions & 93 deletions samples/eshop-dapr/infra/http-routes.bicep

This file was deleted.

36 changes: 0 additions & 36 deletions samples/eshop-dapr/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,11 @@ module stateStore 'infra/dapr-state-store.bicep' = {
}
}

// HTTP Routes
module httpRoutes 'infra/http-routes.bicep' = {
name: '${deployment().name}-http-routes'
params: {
appId: eShopOnDapr.id
}
}

// Gateway
module gateway 'infra/gateway.bicep' = {
name: '${deployment().name}-gateway'
params: {
appId: eShopOnDapr.id
blazorClientRouteName: httpRoutes.outputs.blazorClientRouteName
identityApiRouteName: httpRoutes.outputs.identityApiRouteName
seqRouteName: httpRoutes.outputs.seqRouteName
webshoppingGwRouteName: httpRoutes.outputs.webshoppingGwRouteName
webstatusRouteName: httpRoutes.outputs.webstatusRouteName
}
}

Expand All @@ -129,43 +116,35 @@ module seq 'services/seq.bicep' = {
name: '${deployment().name}-seq'
params: {
appId: eShopOnDapr.id
seqRouteName: httpRoutes.outputs.seqRouteName
}
}

module blazorClient 'services/blazor-client.bicep' = {
name: '${deployment().name}-blazor-client'
params: {
appId: eShopOnDapr.id
blazorClientRouteName: httpRoutes.outputs.blazorClientRouteName
gatewayName: gateway.outputs.gatewayName
seqRouteName: httpRoutes.outputs.seqRouteName
}
}

module basketApi 'services/basket-api.bicep' = {
name: '${deployment().name}-basket-api'
params: {
appId: eShopOnDapr.id
basketApiRouteName: httpRoutes.outputs.basketApiRouteName
daprPubSubBrokerName: daprPubSub.outputs.daprPubSubBrokerName
daprStateStoreName: stateStore.outputs.daprStateStoreName
gatewayName: gateway.outputs.gatewayName
identityApiRouteName: httpRoutes.outputs.identityApiRouteName
seqRouteName: httpRoutes.outputs.seqRouteName
}
}

module catalogApi 'services/catalog-api.bicep' = {
name: '${deployment().name}-catalog-api'
params: {
appId: eShopOnDapr.id
catalogApiRouteName: httpRoutes.outputs.catalogApiRouteName
catalogDbName: sqlServer.outputs.catalogDbName
daprPubSubBrokerName: daprPubSub.outputs.daprPubSubBrokerName
daprSecretStoreName: secretStore.outputs.daprSecretStoreName
keyVaultName: secretStore.outputs.keyVaultName
seqRouteName: httpRoutes.outputs.seqRouteName
}
}

Expand All @@ -174,11 +153,9 @@ module identityApi 'services/identity-api.bicep' = {
params: {
appId: eShopOnDapr.id
daprSecretStoreName: secretStore.outputs.daprSecretStoreName
identityApiRouteName: httpRoutes.outputs.identityApiRouteName
identityDbName: sqlServer.outputs.identityDbName
gatewayName: gateway.outputs.gatewayName
keyVaultName: secretStore.outputs.keyVaultName
seqRouteName: httpRoutes.outputs.seqRouteName
}
}

Expand All @@ -188,12 +165,9 @@ module orderingApi 'services/ordering-api.bicep' = {
appId: eShopOnDapr.id
daprPubSubBrokerName: daprPubSub.outputs.daprPubSubBrokerName
daprSecretStoreName: secretStore.outputs.daprSecretStoreName
identityApiRouteName: httpRoutes.outputs.identityApiRouteName
gatewayName: gateway.outputs.gatewayName
keyVaultName: secretStore.outputs.keyVaultName
orderingApiRouteName: httpRoutes.outputs.orderingApiRouteName
orderingDbName: sqlServer.outputs.orderingDbName
seqRouteName: httpRoutes.outputs.seqRouteName
}
}

Expand All @@ -202,37 +176,27 @@ module paymentApi 'services/payment-api.bicep' = {
params: {
appId: eShopOnDapr.id
daprPubSubBrokerName: daprPubSub.outputs.daprPubSubBrokerName
paymentApiRouteName: httpRoutes.outputs.paymentApiRouteName
seqRouteName: httpRoutes.outputs.seqRouteName
}
}

module webshoppingAgg 'services/webshopping-agg.bicep' = {
name: '${deployment().name}-ws-agg'
params: {
appId: eShopOnDapr.id
identityApiRouteName: httpRoutes.outputs.identityApiRouteName
gatewayName: gateway.outputs.gatewayName
seqRouteName: httpRoutes.outputs.seqRouteName
webshoppingAggRouteName: httpRoutes.outputs.webshoppingAggRouteName
}
}

module webshoppingGw 'services/webshopping-gw.bicep' = {
name: '${deployment().name}-ws-gw'
params: {
appId: eShopOnDapr.id
catalogApiRouteName: httpRoutes.outputs.catalogApiRouteName
orderingApiRouteName: httpRoutes.outputs.orderingApiRouteName
webshoppingGwRouteName: httpRoutes.outputs.webshoppingGwRouteName
}
}

module webstatus 'services/webstatus.bicep' = {
name: '${deployment().name}-webstatus'
params: {
appId: eShopOnDapr.id
blazorClientApiRouteName: httpRoutes.outputs.blazorClientRouteName
webstatusRouteName: httpRoutes.outputs.webstatusRouteName
}
}
30 changes: 4 additions & 26 deletions samples/eshop-dapr/services/basket-api.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import radius as radius
@description('The Radius application ID.')
param appId string

@description('The name of the basket API HTTP route.')
param basketApiRouteName string

@description('The name of the Dapr pub/sub component.')
param daprPubSubBrokerName string

Expand All @@ -15,23 +12,13 @@ param daprStateStoreName string
@description('The name of the Radius gateway.')
param gatewayName string

@description('The name of the Identity API HTTP route.')
param identityApiRouteName string

@description('The name of the Seq HTTP route.')
param seqRouteName string

@description('The Dapr application ID.')
var daprAppId = 'basket-api'

//-----------------------------------------------------------------------------
// Get references to existing resources
//-----------------------------------------------------------------------------

resource basketApiRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = {
name: basketApiRouteName
}

resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = {
name: gatewayName
}
Expand All @@ -44,14 +31,6 @@ resource daprStateStore 'Applications.Dapr/stateStores@2023-10-01-preview' exist
name: daprStateStoreName
}

resource identityApiRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = {
name: identityApiRouteName
}

resource seqRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = {
name: seqRouteName
}

//-----------------------------------------------------------------------------
// Deploy Basket API container
//-----------------------------------------------------------------------------
Expand All @@ -65,14 +44,13 @@ resource basketApi 'Applications.Core/containers@2023-10-01-preview' = {
env: {
ASPNETCORE_ENVIRONMENT: 'Development'
ASPNETCORE_URLS: 'http://0.0.0.0:80'
IdentityUrl: identityApiRoute.properties.url
IdentityUrl: 'http://identity-api:80'
IdentityUrlExternal: '${gateway.properties.url}/identity/'
SeqServerUrl: seqRoute.properties.url
SeqServerUrl: 'http://seq:5340'
}
ports: {
http: {
containerPort: 80
provides: basketApiRoute.id
}
}
}
Expand All @@ -91,10 +69,10 @@ resource basketApi 'Applications.Core/containers@2023-10-01-preview' = {
source: daprStateStore.id
}
identityApiRoute: {
source: identityApiRoute.id
source: 'http://identity-api'
}
seqRoute: {
source: seqRoute.id
source: 'http://seq:5340'
}
}
}
Expand Down
Loading

0 comments on commit 90b7f98

Please sign in to comment.