From 90b7f98fa12a159a175274e922583f492352b304 Mon Sep 17 00:00:00 2001 From: Nithya Subramanian <98416062+nithyatsu@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:48:01 -0700 Subject: [PATCH] Remove httpRoutes from samples (#574) * 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 --- samples/eshop-dapr/infra/gateway.bicep | 49 +--- samples/eshop-dapr/infra/http-routes.bicep | 93 ------- samples/eshop-dapr/main.bicep | 36 --- samples/eshop-dapr/services/basket-api.bicep | 30 +-- .../eshop-dapr/services/blazor-client.bicep | 18 +- samples/eshop-dapr/services/catalog-api.bicep | 18 +- .../eshop-dapr/services/identity-api.bicep | 19 +- .../eshop-dapr/services/ordering-api.bicep | 30 +-- samples/eshop-dapr/services/payment-api.bicep | 19 +- samples/eshop-dapr/services/seq.bicep | 12 - .../eshop-dapr/services/webshopping-agg.bicep | 29 +-- .../eshop-dapr/services/webshopping-gw.bicep | 29 +-- samples/eshop-dapr/services/webstatus.bicep | 23 +- samples/eshop/eshop.bicep | 52 ---- samples/eshop/infra/networking.bicep | 234 +----------------- samples/eshop/services/basket.bicep | 40 +-- samples/eshop/services/catalog.bicep | 22 +- samples/eshop/services/identity.bicep | 86 ++----- samples/eshop/services/ordering.bicep | 82 ++---- samples/eshop/services/payment.bicep | 16 +- samples/eshop/services/seq.bicep | 16 +- samples/eshop/services/web.bicep | 89 +++---- samples/eshop/services/webhooks.bicep | 48 ++-- samples/eshop/services/webshopping.bicep | 128 +++------- samples/eshop/services/webstatus.bicep | 104 ++------ samples/eshop/src/envoy/README.md | 2 +- samples/eshop/src/envoy/envoy.yaml | 10 +- 27 files changed, 217 insertions(+), 1117 deletions(-) delete mode 100644 samples/eshop-dapr/infra/http-routes.bicep diff --git a/samples/eshop-dapr/infra/gateway.bicep b/samples/eshop-dapr/infra/gateway.bicep index da23cb97..81d44ca3 100644 --- a/samples/eshop-dapr/infra/gateway.bicep +++ b/samples/eshop-dapr/infra/gateway.bicep @@ -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 //----------------------------------------------------------------------------- @@ -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' } ] } diff --git a/samples/eshop-dapr/infra/http-routes.bicep b/samples/eshop-dapr/infra/http-routes.bicep deleted file mode 100644 index f853f41e..00000000 --- a/samples/eshop-dapr/infra/http-routes.bicep +++ /dev/null @@ -1,93 +0,0 @@ -import radius as radius - -@description('The Radius application ID.') -param appId string - -//----------------------------------------------------------------------------- -// Create the HTTP routes for the application -//----------------------------------------------------------------------------- - -resource basketApiRoute 'Applications.Core/httpRoutes@2023-10-01-preview' = { - name: 'basket-api-route' - properties: { - application: appId - } -} - -resource blazorClientRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'blazor-client-route' - properties: { - application: appId - } -} - -resource catalogApiRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'catalog-api-route' - properties: { - application: appId - } -} - -resource identityApiRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'identity-api-route' - properties: { - application: appId - } -} - -resource orderingApiRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'ordering-api-route' - properties: { - application: appId - } -} - -resource paymentApiRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'payment-api-route' - properties: { - application: appId - } -} - -resource seqRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'seq-route' - properties: { - application: appId - } -} - -resource webshoppingAggRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webshopping-agg-route' - properties: { - application: appId - } -} - -resource webshoppingGwRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'route-webshopping-gw' - properties: { - application: appId - } -} - -resource webstatusRoute 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webstatus-route' - properties: { - application: appId - } -} - -//----------------------------------------------------------------------------- -// Output -//----------------------------------------------------------------------------- - -output basketApiRouteName string = basketApiRoute.name -output blazorClientRouteName string = blazorClientRoute.name -output catalogApiRouteName string = catalogApiRoute.name -output identityApiRouteName string = identityApiRoute.name -output orderingApiRouteName string = orderingApiRoute.name -output paymentApiRouteName string = paymentApiRoute.name -output seqRouteName string = seqRoute.name -output webshoppingAggRouteName string = webshoppingAggRoute.name -output webshoppingGwRouteName string = webshoppingGwRoute.name -output webstatusRouteName string = webstatusRoute.name diff --git a/samples/eshop-dapr/main.bicep b/samples/eshop-dapr/main.bicep index 820893aa..fcd1e5ef 100644 --- a/samples/eshop-dapr/main.bicep +++ b/samples/eshop-dapr/main.bicep @@ -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 } } @@ -129,7 +116,6 @@ module seq 'services/seq.bicep' = { name: '${deployment().name}-seq' params: { appId: eShopOnDapr.id - seqRouteName: httpRoutes.outputs.seqRouteName } } @@ -137,9 +123,7 @@ 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 } } @@ -147,12 +131,9 @@ 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 } } @@ -160,12 +141,10 @@ 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 } } @@ -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 } } @@ -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 } } @@ -202,8 +176,6 @@ module paymentApi 'services/payment-api.bicep' = { params: { appId: eShopOnDapr.id daprPubSubBrokerName: daprPubSub.outputs.daprPubSubBrokerName - paymentApiRouteName: httpRoutes.outputs.paymentApiRouteName - seqRouteName: httpRoutes.outputs.seqRouteName } } @@ -211,10 +183,7 @@ 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 } } @@ -222,9 +191,6 @@ 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 } } @@ -232,7 +198,5 @@ module webstatus 'services/webstatus.bicep' = { name: '${deployment().name}-webstatus' params: { appId: eShopOnDapr.id - blazorClientApiRouteName: httpRoutes.outputs.blazorClientRouteName - webstatusRouteName: httpRoutes.outputs.webstatusRouteName } } diff --git a/samples/eshop-dapr/services/basket-api.bicep b/samples/eshop-dapr/services/basket-api.bicep index 1ea2ac60..6d496cdf 100644 --- a/samples/eshop-dapr/services/basket-api.bicep +++ b/samples/eshop-dapr/services/basket-api.bicep @@ -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 @@ -15,12 +12,6 @@ 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' @@ -28,10 +19,6 @@ 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 } @@ -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 //----------------------------------------------------------------------------- @@ -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 } } } @@ -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' } } } diff --git a/samples/eshop-dapr/services/blazor-client.bicep b/samples/eshop-dapr/services/blazor-client.bicep index 5960b868..56c06211 100644 --- a/samples/eshop-dapr/services/blazor-client.bicep +++ b/samples/eshop-dapr/services/blazor-client.bicep @@ -3,31 +3,18 @@ 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 Radius gateway.') param gatewayName string -@description('The name of the Seq HTTP route.') -param seqRouteName string //----------------------------------------------------------------------------- // Get references to existing resources //----------------------------------------------------------------------------- -resource blazorClientRoute 'Applications.Core/httproutes@2023-10-01-preview' existing = { - name: blazorClientRouteName -} - resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource seqRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: seqRouteName -} - //----------------------------------------------------------------------------- // Deploy Blazor client container //----------------------------------------------------------------------------- @@ -43,18 +30,17 @@ resource blazorClient 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' ApiGatewayUrlExternal: '${gateway.properties.url}/api/' IdentityUrlExternal: '${gateway.properties.url}/identity/' - SeqServerUrl: seqRoute.properties.url + SeqServerUrl: 'http://seq:5340' } ports: { http: { containerPort: 80 - provides: blazorClientRoute.id } } } connections: { seqRoute: { - source: seqRoute.id + source: 'http://seq:5340' } } } diff --git a/samples/eshop-dapr/services/catalog-api.bicep b/samples/eshop-dapr/services/catalog-api.bicep index 3eb1af01..853f90bd 100644 --- a/samples/eshop-dapr/services/catalog-api.bicep +++ b/samples/eshop-dapr/services/catalog-api.bicep @@ -3,9 +3,6 @@ import radius as radius @description('The Radius application ID.') param appId string -@description('The name of the Catalog API HTTP route.') -param catalogApiRouteName string - @description('The name of the Catalog database portable resource.') param catalogDbName string @@ -19,8 +16,6 @@ param daprSecretStoreName string @description('The name of the Key Vault to get secrets from.') param keyVaultName string -@description('The name of the Seq HTTP route.') -param seqRouteName string @description('The Dapr application ID.') var daprAppId = 'catalog-api' @@ -29,10 +24,6 @@ var daprAppId = 'catalog-api' // Get references to existing resources //----------------------------------------------------------------------------- -resource catalogApiRoute 'Applications.Core/httproutes@2023-10-01-preview' existing = { - name: catalogApiRouteName -} - resource catalogDb 'Applications.Datastores/sqlDatabases@2023-10-01-preview' existing = { name: catalogDbName } @@ -49,10 +40,6 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { name: keyVaultName } -resource seqRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: seqRouteName -} - //----------------------------------------------------------------------------- // Deploy Catalog API container //----------------------------------------------------------------------------- @@ -67,12 +54,11 @@ resource catalogApi 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' RetryMigrations: 'true' - SeqServerUrl: seqRoute.properties.url + SeqServerUrl: 'http://seq:5340' } ports: { http: { containerPort: 80 - provides: catalogApiRoute.id } } } @@ -104,7 +90,7 @@ resource catalogApi 'Applications.Core/containers@2023-10-01-preview' = { } } seqRoute: { - source: seqRoute.id + source: 'http://seq:5340' } } } diff --git a/samples/eshop-dapr/services/identity-api.bicep b/samples/eshop-dapr/services/identity-api.bicep index 8e67da7c..4f861d98 100644 --- a/samples/eshop-dapr/services/identity-api.bicep +++ b/samples/eshop-dapr/services/identity-api.bicep @@ -10,18 +10,12 @@ param daprSecretStoreName 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 Identity database portable resource.') param identityDbName string @description('The name of the Key Vault to get secrets from.') param keyVaultName string -@description('The name of the Seq HTTP route.') -param seqRouteName string - var daprAppId = 'identity-api' //----------------------------------------------------------------------------- @@ -36,10 +30,6 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource identityApiRoute 'Applications.Core/httproutes@2023-10-01-preview' existing = { - name: identityApiRouteName -} - resource identityDb 'Applications.Datastores/sqlDatabases@2023-10-01-preview' existing = { name: identityDbName } @@ -48,10 +38,6 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { name: keyVaultName } -resource seqRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: seqRouteName -} - //----------------------------------------------------------------------------- // Deploy Identity API container //----------------------------------------------------------------------------- @@ -69,12 +55,11 @@ resource identityApi 'Applications.Core/containers@2023-10-01-preview' = { BlazorClientUrlExternal: gateway.properties.url IssuerUrl: '${gateway.properties.url}/identity/' RetryMigrations: 'true' - SeqServerUrl: seqRoute.properties.url + SeqServerUrl: 'http://seq:5340' } ports: { http: { containerPort: 80 - provides: identityApiRoute.id } } } @@ -103,7 +88,7 @@ resource identityApi 'Applications.Core/containers@2023-10-01-preview' = { } } seqRoute: { - source: seqRoute.id + source: 'http://seq:5340' } } } diff --git a/samples/eshop-dapr/services/ordering-api.bicep b/samples/eshop-dapr/services/ordering-api.bicep index c4ca3526..c434cc9b 100644 --- a/samples/eshop-dapr/services/ordering-api.bicep +++ b/samples/eshop-dapr/services/ordering-api.bicep @@ -13,21 +13,12 @@ param daprSecretStoreName 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 Key Vault to get secrets from.') param keyVaultName string -@description('The name of the Ordering API HTTP route.') -param orderingApiRouteName string - @description('The name of the Ordering database portable resource.') param orderingDbName string -@description('The name of the Seq HTTP route.') -param seqRouteName string - @description('The Dapr application ID.') var daprAppId = 'ordering-api' @@ -47,14 +38,6 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource identityApiRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: identityApiRouteName -} - -resource orderingApiRoute 'Applications.Core/httproutes@2023-10-01-preview' existing = { - name: orderingApiRouteName -} - resource orderingDb 'Applications.Datastores/sqlDatabases@2023-10-01-preview' existing = { name: orderingDbName } @@ -63,10 +46,6 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { name: keyVaultName } -resource seqRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: seqRouteName -} - //----------------------------------------------------------------------------- // Deploy Ordering API container //----------------------------------------------------------------------------- @@ -80,16 +59,15 @@ resource orderingApi '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/' RetryMigrations: 'true' - SeqServerUrl: seqRoute.properties.url + SeqServerUrl: 'http://seq:5340' SendConfirmationEmail: 'false' } ports: { http: { containerPort: 80 - provides: orderingApiRoute.id } } } @@ -108,7 +86,7 @@ resource orderingApi 'Applications.Core/containers@2023-10-01-preview' = { source: daprSecretStore.id } identityApiRoute: { - source: identityApiRoute.id + source: 'http://identity-api' } // Temporary workaround to grant required role to workload identity. keyVault: { @@ -124,7 +102,7 @@ resource orderingApi 'Applications.Core/containers@2023-10-01-preview' = { source: orderingDb.id } seqRoute: { - source: seqRoute.id + source: 'http://seq:5340' } } } diff --git a/samples/eshop-dapr/services/payment-api.bicep b/samples/eshop-dapr/services/payment-api.bicep index b7cf58fc..52786bf9 100644 --- a/samples/eshop-dapr/services/payment-api.bicep +++ b/samples/eshop-dapr/services/payment-api.bicep @@ -3,12 +3,6 @@ import radius as radius @description('The Radius application ID.') param appId string -@description('The name of the Payment API HTTP route.') -param paymentApiRouteName string - -@description('The name of the Seq HTTP route.') -param seqRouteName string - @description('The Dapr application ID.') param daprPubSubBrokerName string @@ -23,14 +17,6 @@ resource daprPubSubBroker 'Applications.Dapr/pubSubBrokers@2023-10-01-preview' e name: daprPubSubBrokerName } -resource paymentApiRoute 'Applications.Core/httproutes@2023-10-01-preview' existing = { - name: paymentApiRouteName -} - -resource seqRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: seqRouteName -} - //----------------------------------------------------------------------------- // Deploy Payment API container //----------------------------------------------------------------------------- @@ -44,12 +30,11 @@ resource paymentApi 'Applications.Core/containers@2023-10-01-preview' = { env: { ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' - SeqServerUrl: seqRoute.properties.url + SeqServerUrl: 'http://seq:5340' } ports: { http: { containerPort: 80 - provides: paymentApiRoute.id } } } @@ -65,7 +50,7 @@ resource paymentApi 'Applications.Core/containers@2023-10-01-preview' = { source: daprPubSubBroker.id } seq: { - source: seqRoute.id + source: 'http://seq:5340' } } } diff --git a/samples/eshop-dapr/services/seq.bicep b/samples/eshop-dapr/services/seq.bicep index 4a4593e1..14d368f7 100644 --- a/samples/eshop-dapr/services/seq.bicep +++ b/samples/eshop-dapr/services/seq.bicep @@ -3,17 +3,6 @@ import radius as radius @description('The Radius application ID.') param appId string -@description('The name of the Seq HTTP route.') -param seqRouteName string - -//----------------------------------------------------------------------------- -// Get references to existing resources -//----------------------------------------------------------------------------- - -resource seqRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: seqRouteName -} - //----------------------------------------------------------------------------- // Deploy Seq container //----------------------------------------------------------------------------- @@ -30,7 +19,6 @@ resource seq 'Applications.Core/containers@2023-10-01-preview' = { ports: { http: { containerPort: 80 - provides: seqRoute.id } } } diff --git a/samples/eshop-dapr/services/webshopping-agg.bicep b/samples/eshop-dapr/services/webshopping-agg.bicep index 8481bf9c..52c3eba3 100644 --- a/samples/eshop-dapr/services/webshopping-agg.bicep +++ b/samples/eshop-dapr/services/webshopping-agg.bicep @@ -6,15 +6,6 @@ param appId 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 name of the aggregator HTTP route.') -param webshoppingAggRouteName string - @description('The Dapr application ID.') var daprAppId = 'webshoppingagg' @@ -26,17 +17,6 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -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 webshoppingAggRoute 'Applications.Core/httproutes@2023-10-01-preview' existing = { - name: webshoppingAggRouteName -} - //----------------------------------------------------------------------------- // Deploy Aggregator container //----------------------------------------------------------------------------- @@ -50,9 +30,9 @@ resource webshoppingAgg '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' BasketUrlHC: 'http://localhost:3500/v1.0/invoke/basket-api/method/hc' CatalogUrlHC: 'http://localhost:3500/v1.0/invoke/catalog-api/method/hc' IdentityUrlHC: 'http://localhost:3500/v1.0/invoke/identity-api/method/hc' @@ -60,7 +40,6 @@ resource webshoppingAgg 'Applications.Core/containers@2023-10-01-preview' = { ports: { http: { containerPort: 80 - provides: webshoppingAggRoute.id } } } @@ -73,10 +52,10 @@ resource webshoppingAgg 'Applications.Core/containers@2023-10-01-preview' = { ] connections: { identityApi: { - source: identityApiRoute.id + source: 'http://identity-api' } seq: { - source: seqRoute.id + source: 'http://seq' } } } diff --git a/samples/eshop-dapr/services/webshopping-gw.bicep b/samples/eshop-dapr/services/webshopping-gw.bicep index 242e508c..4ab88564 100644 --- a/samples/eshop-dapr/services/webshopping-gw.bicep +++ b/samples/eshop-dapr/services/webshopping-gw.bicep @@ -2,24 +2,8 @@ import radius as radius param appId string -param catalogApiRouteName string -param orderingApiRouteName string -param webshoppingGwRouteName string - var daprAppId = 'webshoppingapigw' -resource catalogApiRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: catalogApiRouteName -} - -resource orderingApiRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingApiRouteName -} - -resource webshoppingGwRoute 'Applications.Core/httproutes@2023-10-01-preview' existing = { - name: webshoppingGwRouteName -} - resource webshoppingGw 'Applications.Core/containers@2023-10-01-preview' = { name: 'webshopping-gw' properties: { @@ -27,15 +11,14 @@ resource webshoppingGw 'Applications.Core/containers@2023-10-01-preview' = { container: { image: 'ghcr.io/radius-project/samples/eshopdapr/webshoppingapigw:rad-latest' env: { - ENVOY_CATALOG_API_ADDRESS: catalogApiRoute.properties.hostname - ENVOY_CATALOG_API_PORT: '${catalogApiRoute.properties.port}' - ENVOY_ORDERING_API_ADDRESS: orderingApiRoute.properties.hostname - ENVOY_ORDERING_API_PORT: '${orderingApiRoute.properties.port}' + ENVOY_CATALOG_API_ADDRESS: 'catalog-api' + ENVOY_CATALOG_API_PORT: '80' + ENVOY_ORDERING_API_ADDRESS: 'ordering-api' + ENVOY_ORDERING_API_PORT: '80' } ports: { http: { containerPort: 80 - provides: webshoppingGwRoute.id } } } @@ -48,10 +31,10 @@ resource webshoppingGw 'Applications.Core/containers@2023-10-01-preview' = { ] connections: { catalogApi: { - source: catalogApiRoute.id + source: 'http://catalog-api' } orderingApi: { - source: orderingApiRoute.id + source: 'http://ordering-api' } } } diff --git a/samples/eshop-dapr/services/webstatus.bicep b/samples/eshop-dapr/services/webstatus.bicep index e86204fa..c4fe40d6 100644 --- a/samples/eshop-dapr/services/webstatus.bicep +++ b/samples/eshop-dapr/services/webstatus.bicep @@ -3,27 +3,9 @@ import radius as radius @description('The Radius application ID.') param appId string -@description('The name of the Blazor Client API HTTP route.') -param blazorClientApiRouteName string - -@description('The name of the webstatus API HTTP route.') -param webstatusRouteName string - @description('The Dapr application ID.') var daprAppId = 'webstatus' -//----------------------------------------------------------------------------- -// Get references to existing resources -//----------------------------------------------------------------------------- - -resource blazorClientApiRoute 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: blazorClientApiRouteName -} - -resource webstatusRoute 'Applications.Core/httproutes@2023-10-01-preview' existing = { - name: webstatusRouteName -} - //----------------------------------------------------------------------------- // Deploy webstatus container //----------------------------------------------------------------------------- @@ -39,7 +21,7 @@ resource webstatus 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/health' HealthChecksUI__HealthChecks__0__Name: 'Blazor UI Host' - HealthChecksUI__HealthChecks__0__Uri: '${blazorClientApiRoute.properties.url}/hc' + HealthChecksUI__HealthChecks__0__Uri: 'http://blazor-client:80/hc' HealthChecksUI__HealthChecks__1__Name: 'Identity API' HealthChecksUI__HealthChecks__1__Uri: 'http://localhost:3500/v1.0/invoke/identity-api/method/hc' HealthChecksUI__HealthChecks__2__Name: 'Basket API' @@ -56,7 +38,6 @@ resource webstatus 'Applications.Core/containers@2023-10-01-preview' = { ports: { http: { containerPort: 80 - provides: webstatusRoute.id } } } @@ -69,7 +50,7 @@ resource webstatus 'Applications.Core/containers@2023-10-01-preview' = { ] connections: { blazorClient: { - source: blazorClientApiRoute.id + source: 'http://blazor-client' } } } diff --git a/samples/eshop/eshop.bicep b/samples/eshop/eshop.bicep index 3492f7a4..c7a47427 100644 --- a/samples/eshop/eshop.bicep +++ b/samples/eshop/eshop.bicep @@ -61,9 +61,6 @@ module basket 'services/basket.bicep' = { imageRegistry: imageRegistry imageTag: imageTag gatewayName: networking.outputs.gateway - identityHttpName: networking.outputs.identityHttp - basketHttpName: networking.outputs.basketHttp - basketGrpcName: networking.outputs.basketGrpc redisBasketName: infra.outputs.redisBasket eventBusConnectionString: infra.outputs.eventBusConnectionString AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED @@ -76,8 +73,6 @@ module catalog 'services/catalog.bicep' = { application: eshopApplication.id imageRegistry: imageRegistry imageTag: imageTag - catalogGrpcName: networking.outputs.catalogGrpc - catalogHttpName: networking.outputs.catalogHttp gatewayName: networking.outputs.gateway sqlCatalogDbName: infra.outputs.sqlCatalogDb eventBusConnectionString: infra.outputs.eventBusConnectionString @@ -91,16 +86,9 @@ module identity 'services/identity.bicep' = { application: eshopApplication.id imageRegistry: imageRegistry imageTag: imageTag - basketHttpName: networking.outputs.basketHttp gatewayName: networking.outputs.gateway - identityHttpName: networking.outputs.identityHttp - orderingHttpName: networking.outputs.orderingHttp redisKeystoreName: infra.outputs.redisKeystore sqlIdentityDbName: infra.outputs.sqlIdentityDb - webhooksclientHttpName: networking.outputs.webhooksclientHttp - webhooksHttpName: networking.outputs.webhooksHttp - webmvcHttpName: networking.outputs.webmvcHttp - webshoppingaggHttpName: networking.outputs.webshoppingaggHttp } } @@ -110,14 +98,7 @@ module ordering 'services/ordering.bicep' = { application: eshopApplication.id imageRegistry: imageRegistry imageTag: imageTag - basketHttpName: networking.outputs.basketHttp - catalogHttpName: networking.outputs.catalogHttp gatewayName: networking.outputs.gateway - identityHttpName: networking.outputs.identityHttp - orderbgtasksHttpName: networking.outputs.orderbgtasksHttp - orderingGrpcName: networking.outputs.orderingGrpc - orderingHttpName: networking.outputs.orderingHttp - orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp redisKeystoreName: infra.outputs.redisKeystore sqlOrderingDbName: infra.outputs.sqlOrderingDb eventBusConnectionString: infra.outputs.eventBusConnectionString @@ -131,7 +112,6 @@ module payment 'services/payment.bicep' = { application: eshopApplication.id imageRegistry: imageRegistry imageTag: imageTag - paymentHttpName: networking.outputs.paymentHttp eventBusConnectionString: infra.outputs.eventBusConnectionString AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED } @@ -141,7 +121,6 @@ module seq 'services/seq.bicep' = { name: 'seq' params: { application: eshopApplication.id - seqHttpName: networking.outputs.seqHttp } } @@ -152,13 +131,7 @@ module web 'services/web.bicep' = { imageRegistry: imageRegistry imageTag: imageTag gatewayName: networking.outputs.gateway - identityHttpName: networking.outputs.identityHttp - orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp redisKeystoreName: infra.outputs.redisKeystore - webmvcHttpName: networking.outputs.webmvcHttp - webshoppingaggHttpName: networking.outputs.webshoppingaggHttp - webshoppingapigwHttpName: networking.outputs.webshoppingapigwHttp - webspaHttpName: networking.outputs.webspaHttp } } @@ -169,10 +142,7 @@ module webhooks 'services/webhooks.bicep' = { imageRegistry: imageRegistry imageTag: imageTag gatewayName: networking.outputs.gateway - identityHttpName: networking.outputs.identityHttp sqlWebhooksDbName: infra.outputs.sqlWebhooksDb - webhooksclientHttpName: networking.outputs.webhooksclientHttp - webhooksHttpName: networking.outputs.webhooksHttp eventBusConnectionString: infra.outputs.eventBusConnectionString AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED } @@ -184,18 +154,7 @@ module webshopping 'services/webshopping.bicep' = { application: eshopApplication.id imageRegistry: imageRegistry imageTag: imageTag - basketGrpcName: networking.outputs.basketGrpc - basketHttpName: networking.outputs.basketHttp - catalogGrpcName: networking.outputs.catalogGrpc - catalogHttpName: networking.outputs.catalogHttp gatewayName: networking.outputs.gateway - identityHttpName: networking.outputs.identityHttp - orderingGrpcName: networking.outputs.orderingGrpc - orderingHttpName: networking.outputs.basketHttp - paymentHttpName: networking.outputs.paymentHttp - webshoppingaggHttpName: networking.outputs.webshoppingaggHttp - webshoppingapigwHttp2Name: networking.outputs.webshoppingapigwHttp2 - webshoppingapigwHttpName: networking.outputs.webshoppingapigwHttp } } @@ -205,16 +164,5 @@ module webstatus 'services/webstatus.bicep' = { application: eshopApplication.id imageRegistry: imageRegistry imageTag: imageTag - basketHttpName: networking.outputs.basketHttp - catalogHttpName: networking.outputs.catalogHttp - identityHttpName: networking.outputs.identityHttp - orderbgtasksHttpName: networking.outputs.orderbgtasksHttp - orderingHttpName: networking.outputs.orderingHttp - orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp - paymentHttpName: networking.outputs.paymentHttp - webmvcHttpName: networking.outputs.webmvcHttp - webshoppingaggHttpName: networking.outputs.webshoppingaggHttp - webspaHttpName: networking.outputs.webspaHttp - webstatusHttpName: networking.outputs.webstatusHttp } } diff --git a/samples/eshop/infra/networking.bicep b/samples/eshop/infra/networking.bicep index 2330a23b..3082c82d 100644 --- a/samples/eshop/infra/networking.bicep +++ b/samples/eshop/infra/networking.bicep @@ -13,263 +13,49 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' = { routes: [ { path: '/identity-api' - destination: identityHttp.id + destination: 'http://identity-api:5105' } { path: '/ordering-api' - destination: orderingHttp.id + destination: 'http://ordering-api:5102' } { path: '/basket-api' - destination: basketHttp.id + destination: 'http://basket-api:5103' } { path: '/webhooks-api' - destination: webhooksHttp.id + destination: 'http://webhooks-api:5113' } { path: '/webshoppingagg' - destination: webshoppingaggHttp.id + destination: 'http://webshoppingagg:5121' } { path: '/webshoppingapigw' - destination: webshoppingapigwHttp.id + destination: 'http://webshoppingapigw:5202' } { path: '/webhooks-web' - destination: webhooksclientHttp.id + destination: 'http://webhooks-client:5114' } { path: '/webstatus' - destination: webstatusHttp.id + destination: 'http://webstatus:8107' } { path: '/' - destination: webspaHttp.id + destination: 'http://web-spa:5104' } { path: '/webmvc' - destination: webmvcHttp.id + destination: 'http://webmvc:5100' } ] } } - -// ROUTES ---------------------------------------------------------- - -resource basketHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'basket-http' - properties: { - application: application - port: 5103 - } -} - -resource basketGrpc 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'basket-grpc' - properties: { - application: application - port: 9103 - } -} - -resource catalogHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'catalog-http' - properties: { - application: application - port: 5101 - } -} - -resource catalogGrpc 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'catalog-grpc' - properties: { - application: application - port: 9101 - } -} - -resource identityHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'identity-http' - properties: { - application: application - port: 5105 - } -} - -resource orderingHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'ordering-http' - properties: { - application: application - port: 5102 - } -} - -resource orderingGrpc 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'ordering-grpc' - properties: { - application: application - port: 9102 - } -} - -resource orderingsignalrhubHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'orderingsignalrhub-http' - properties: { - application: application - port: 5112 - } -} - -resource orderbgtasksHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'orderbgtasks-http' - properties: { - application: application - port: 5111 - } -} - -resource paymentHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'payment-http' - properties: { - application: application - port: 5108 - } -} - -resource seqHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'seq-http' - properties: { - application: application - port: 5340 - } -} - -resource webspaHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webspa-http' - properties: { - application: application - port: 5104 - } -} - -resource webmvcHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webmvc-http' - properties: { - application: application - port: 5100 - } -} - -resource webhooksHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webhooks-http' - properties: { - application: application - port: 5113 - } -} - -resource webhooksclientHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webhooksclient-http' - properties: { - application: application - port: 5114 - hostname: '/webhooks-web' - } -} - -resource webshoppingaggHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webshoppingagg-http' - properties: { - application: application - port: 5121 - } -} - -resource webshoppingapigwHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webshoppingapigw-http' - properties: { - application: application - port: 5202 - } -} - -resource webshoppingapigwHttp2 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webshoppingapigw-http-2' - properties: { - application: application - port: 15202 - } -} - -resource webstatusHttp 'Applications.Core/httproutes@2023-10-01-preview' = { - name: 'webstatus-http' - properties: { - application: application - port: 8107 - } -} - // OUTPUTS -------------------------------------------------------------------- @description('Name of the Gateway') output gateway string = gateway.name - -@description('Name of the Basket HTTP route') -output basketHttp string = basketHttp.name - -@description('Name of the Basket gRPC route') -output basketGrpc string = basketGrpc.name - -@description('Name of the Catalog HTTP route') -output catalogHttp string = catalogHttp.name - -@description('Name of the Catalog gRPC route') -output catalogGrpc string = catalogGrpc.name - -@description('Name of the Identity HTTP route') -output identityHttp string = identityHttp.name - -@description('Name of the Ordering HTTP route') -output orderingHttp string = orderingHttp.name - -@description('Name of the Ordering gRPC route') -output orderingGrpc string = orderingGrpc.name - -@description('Name of the Ordering SignalR Hub HTTP route') -output orderingsignalrhubHttp string = orderingsignalrhubHttp.name - -@description('Name of the Ordering Background Tasks HTTP route') -output orderbgtasksHttp string = orderbgtasksHttp.name - -@description('Name of the Payment HTTP route') -output paymentHttp string = paymentHttp.name - -@description('Name of the SEQ HTTP route') -output seqHttp string = seqHttp.name - -@description('Name of the WebSPA HTTP route') -output webspaHttp string = webspaHttp.name - -@description('Name of the WebMVC HTTP route') -output webmvcHttp string = webmvcHttp.name - -@description('Name of the Webhooks HTTP route') -output webhooksHttp string = webhooksHttp.name - -@description('Name of the Webhooks Client HTTP route') -output webhooksclientHttp string = webhooksclientHttp.name - -@description('Name of the WebShopping Aggregator HTTP route') -output webshoppingaggHttp string = webshoppingaggHttp.name - -@description('Name of the WebShopping API Gateway HTTP route') -output webshoppingapigwHttp string = webshoppingapigwHttp.name - -@description('Name of the WebShopping API Gateway HTTP route') -output webshoppingapigwHttp2 string = webshoppingapigwHttp2.name - -@description('Name of the WebStatus HTTP route') -output webstatusHttp string = webstatusHttp.name - diff --git a/samples/eshop/services/basket.bicep b/samples/eshop/services/basket.bicep index 5e84e381..466eb296 100644 --- a/samples/eshop/services/basket.bicep +++ b/samples/eshop/services/basket.bicep @@ -14,15 +14,6 @@ param imageTag string @description('The name of the Radius Gateway') param gatewayName string -@description('The name of the Identity HTTP Route') -param identityHttpName string - -@description('The name of the Basket HTTP Route') -param basketHttpName string - -@description('The name of the Basket gRPC Route') -param basketGrpcName string - @description('The name of the Redis Basket portable resource') param redisBasketName string @@ -57,30 +48,37 @@ resource basket 'Applications.Core/containers@2023-10-01-preview' = { AzureServiceBusEnabled: AZURESERVICEBUSENABLED ConnectionString: redisBasket.connectionString() EventBusConnection: eventBusConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + identityUrl: 'http://identity-api:5105' + IdentityUrlExternal: '${gateway.properties.url}/identity-api' } ports: { http: { containerPort: 80 - provides: basketHttp.id + port: 5103 } grpc: { containerPort: 81 - provides: basketGrpc.id + port: 9103 } } + livenessProbe:{ + kind:'httpGet' + path:'/hc' + containerPort:80 + } } + connections: { redis: { source: redisBasket.id disableDefaultEnvVars: true } identity: { - source: identityHttp.id + source: 'http://identity-api:5105' disableDefaultEnvVars: true } } + } } @@ -90,19 +88,7 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource identityHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: identityHttpName -} - -resource basketHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: basketHttpName -} - -resource basketGrpc 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: basketGrpcName -} - -// Portable Resource ----------------------------------------- +// Portable Resource ------------------------------------------ resource redisBasket 'Applications.Datastores/redisCaches@2023-10-01-preview' existing = { name: redisBasketName diff --git a/samples/eshop/services/catalog.bicep b/samples/eshop/services/catalog.bicep index 6a5cefb7..0ea748cd 100644 --- a/samples/eshop/services/catalog.bicep +++ b/samples/eshop/services/catalog.bicep @@ -14,12 +14,6 @@ param imageTag string @description('Name of the Gateway') param gatewayName string -@description('The name of the Catalog HTTP Route') -param catalogHttpName string - -@description('The name of the Catalog gRPC Route') -param catalogGrpcName string - @description('The name of the Catalog SQL portable resource') param sqlCatalogDbName string @@ -63,13 +57,18 @@ resource catalog 'Applications.Core/containers@2023-10-01-preview' = { ports: { http: { containerPort: 80 - provides: catalogHttp.id + port: 5101 } grpc: { containerPort: 81 - provides: catalogGrpc.id + port: 9101 } } + livenessProbe:{ + kind:'httpGet' + path:'/hc' + containerPort:80 + } } connections: { sql: { @@ -85,13 +84,6 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource catalogHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: catalogHttpName -} - -resource catalogGrpc 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: catalogGrpcName -} // PORTABLE RESOURCES ----------------------------------------------------------- diff --git a/samples/eshop/services/identity.bicep b/samples/eshop/services/identity.bicep index ecf0bae4..845a15a9 100644 --- a/samples/eshop/services/identity.bicep +++ b/samples/eshop/services/identity.bicep @@ -14,27 +14,6 @@ param imageTag string @description('Name of the Gateway') param gatewayName string -@description('Name of the Identity HTTP Route') -param identityHttpName string - -@description('Name of the Basket HTTP Route') -param basketHttpName string - -@description('Name of the Ordering HTTP Route') -param orderingHttpName string - -@description('Name of the WebShoppingAgg HTTP Route') -param webshoppingaggHttpName string - -@description('Name of the Webhooks HTTP Route') -param webhooksHttpName string - -@description('Name of the WebhooksClient HTTP Route') -param webhooksclientHttpName string - -@description('Name of the WebMVC HTTP Route') -param webmvcHttpName string - @description('Name of the Identity SQL Database portable resource') param sqlIdentityDbName string @@ -59,20 +38,25 @@ resource identity 'Applications.Core/containers@2023-10-01-preview' = { DPConnectionString: redisKeystore.connectionString() EnableDevspaces: 'False' ConnectionString: sqlIdentityDb.connectionString() - MvcClient: '${gateway.properties.url}/${webmvcHttp.properties.hostname}' + MvcClient: '${gateway.properties.url}/webmvc' SpaClient: gateway.properties.url - BasketApiClient: '${gateway.properties.url}/${basketHttp.properties.hostname}' - OrderingApiClient: '${gateway.properties.url}/${orderingHttp.properties.hostname}' - WebShoppingAggClient: '${gateway.properties.url}/${webshoppingaggHttp.properties.hostname}' - WebhooksApiClient: '${gateway.properties.url}/${webhooksHttp.properties.hostname}' - WebhooksWebClient: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' + BasketApiClient: '${gateway.properties.url}/basket-api' + OrderingApiClient: '${gateway.properties.url}/ordering-api' + WebShoppingAggClient: '${gateway.properties.url}/webshoppingagg' + WebhooksApiClient: '${gateway.properties.url}/webhooks-api' + WebhooksWebClient: '${gateway.properties.url}/webhooks-client' } ports: { http: { containerPort: 80 - provides: identityHttp.id + port: 5105 } } + livenessProbe:{ + kind:'httpGet' + path:'/hc' + containerPort:80 + } } connections: { redis: { @@ -84,27 +68,27 @@ resource identity 'Applications.Core/containers@2023-10-01-preview' = { disableDefaultEnvVars: true } webmvc: { - source: webmvcHttp.id + source: 'http://webmvc:5100' disableDefaultEnvVars: true } basket: { - source: basketHttp.id + source: 'http://basket-api:5103' disableDefaultEnvVars: true } ordering: { - source: orderingHttp.id + source: 'http://ordering-api:5102' disableDefaultEnvVars: true } webshoppingagg: { - source: webshoppingaggHttp.id + source: 'http://webshoppingagg:5121' disableDefaultEnvVars: true } webhooks: { - source: webhooksHttp.id + source: 'http://webhooks-api:5113' disableDefaultEnvVars: true } - webhoolsclient: { - source: webhooksclientHttp.id + webhooksclient: { + source: 'http://webhooks-client:5114' disableDefaultEnvVars: true } } @@ -117,33 +101,6 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource identityHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: identityHttpName -} - -resource basketHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: basketHttpName -} - -resource orderingHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingHttpName -} - -resource webshoppingaggHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webshoppingaggHttpName -} - -resource webhooksHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webhooksHttpName -} - -resource webhooksclientHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webhooksclientHttpName -} - -resource webmvcHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webmvcHttpName -} // PORTABLE RESOURCES ----------------------------------------------------------- @@ -154,3 +111,8 @@ resource sqlIdentityDb 'Applications.Datastores/sqlDatabases@2023-10-01-preview' resource redisKeystore 'Applications.Datastores/redisCaches@2023-10-01-preview' existing = { name: redisKeystoreName } + + +// Output +@description('Name of the Identity container') +output container string = identity.name diff --git a/samples/eshop/services/ordering.bicep b/samples/eshop/services/ordering.bicep index e4483f7a..e6b6f6fc 100644 --- a/samples/eshop/services/ordering.bicep +++ b/samples/eshop/services/ordering.bicep @@ -14,27 +14,6 @@ param imageTag string @description('Name of the Gateway') param gatewayName string -@description('Name of the Identity HTTP Route') -param identityHttpName string - -@description('Name of the Basket HTTP Route') -param basketHttpName string - -@description('The name of the Catalog HTTP Route') -param catalogHttpName string - -@description('Name of the Ordering HTTP Route') -param orderingHttpName string - -@description('Name of the Ordering gRPC Route') -param orderingGrpcName string - -@description('Name of the Ordering SignalR Hub HTTP Route') -param orderingsignalrhubHttpName string - -@description('Name of the Ordering background tasks HTTP Route') -param orderbgtasksHttpName string - @description('Name of the Keystore Redis portable resource') param redisKeystoreName string @@ -76,17 +55,17 @@ resource ordering 'Applications.Core/containers@2023-10-01-preview' = { PORT: '80' ConnectionString: sqlOrderingDb.connectionString() EventBusConnection: eventBusConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + identityUrl: 'http://identity-api:5105' + IdentityUrlExternal: '${gateway.properties.url}/identity-api' } ports: { http: { containerPort: 80 - provides: orderingHttp.id + port: 5102 } grpc: { containerPort: 81 - provides: orderingGrpc.id + port: 9102 } } } @@ -96,7 +75,7 @@ resource ordering 'Applications.Core/containers@2023-10-01-preview' = { disableDefaultEnvVars: true } identity: { - source: identityHttp.id + source: 'http://identity-api:5105' disableDefaultEnvVars: true } } @@ -126,7 +105,7 @@ resource orderbgtasks 'Applications.Core/containers@2023-10-01-preview' = { ports: { http: { containerPort: 80 - provides: orderbgtasksHttp.id + port: 5111 } } } @@ -154,16 +133,21 @@ resource orderingsignalrhub 'Applications.Core/containers@2023-10-01-preview' = IsClusterEnv: 'True' AzureServiceBusEnabled: AZURESERVICEBUSENABLED EventBusConnection: eventBusConnectionString - SignalrStoreConnectionString: redisKeystore.connectionString() - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},abortConnect=False' + identityUrl: 'http://identity-api:5105' + IdentityUrlExternal: '${gateway.properties.url}/identity-api' } ports: { http: { containerPort: 80 - provides: orderingsignalrhubHttp.id + port: 5112 } } + livenessProbe:{ + kind:'httpGet' + path:'/hc' + containerPort:80 + } } connections: { redis: { @@ -171,19 +155,19 @@ resource orderingsignalrhub 'Applications.Core/containers@2023-10-01-preview' = disableDefaultEnvVars: true } identity: { - source: identityHttp.id + source: 'http://identity-api:5105' disableDefaultEnvVars: true } ordering: { - source: orderingHttp.id + source: 'http://ordering-api:5102' disableDefaultEnvVars: true } catalog: { - source: catalogHttp.id + source: 'http://catalog-api:5101' disableDefaultEnvVars: true } basket: { - source: basketHttp.id + source: 'http://basket-api:5103' disableDefaultEnvVars: true } } @@ -196,34 +180,6 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource identityHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: identityHttpName -} - -resource basketHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: basketHttpName -} - -resource catalogHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: catalogHttpName -} - -resource orderingHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingHttpName -} - -resource orderingGrpc 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingGrpcName -} - -resource orderingsignalrhubHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingsignalrhubHttpName -} - -resource orderbgtasksHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderbgtasksHttpName -} - // PORTABLE RESOURCES ----------------------------------------------------------- resource redisKeystore 'Applications.Datastores/redisCaches@2023-10-01-preview' existing = { diff --git a/samples/eshop/services/payment.bicep b/samples/eshop/services/payment.bicep index 7523a461..5b43ce95 100644 --- a/samples/eshop/services/payment.bicep +++ b/samples/eshop/services/payment.bicep @@ -11,9 +11,6 @@ param imageRegistry string @description('Container image tag to use for eshop images') param imageTag string -@description('Name of the Payment HTTP route') -param paymentHttpName string - @description('The connection string for the event bus') @secure() param eventBusConnectionString string @@ -44,15 +41,14 @@ resource payment 'Applications.Core/containers@2023-10-01-preview' = { ports: { http: { containerPort: 80 - provides: paymentHttp.id + port: 5108 } } + livenessProbe:{ + kind:'httpGet' + path:'/hc' + containerPort:80 + } } } } - -// NETWORKING ------------------------------------------------------ - -resource paymentHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: paymentHttpName -} diff --git a/samples/eshop/services/seq.bicep b/samples/eshop/services/seq.bicep index eda4f9d8..32090891 100644 --- a/samples/eshop/services/seq.bicep +++ b/samples/eshop/services/seq.bicep @@ -5,9 +5,6 @@ import radius as rad @description('Radius application ID') param application string -@description('Name of the SEQ Http Route') -param seqHttpName string - // CONTAINERS ------------------------------------------------------------ resource seq 'Applications.Core/containers@2023-10-01-preview' = { @@ -22,15 +19,18 @@ resource seq 'Applications.Core/containers@2023-10-01-preview' = { ports: { web: { containerPort: 80 - provides: seqHttp.id + port: 5340 } } + livenessProbe:{ + kind:'tcp' + containerPort:80 + } } } } -// NETWORKING --------------------------------------------------------------- -resource seqHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: seqHttpName -} +// Output +@description('Name of the SEQ container') +output container string = seq.name diff --git a/samples/eshop/services/web.bicep b/samples/eshop/services/web.bicep index 9717bb3a..58cd8cf2 100644 --- a/samples/eshop/services/web.bicep +++ b/samples/eshop/services/web.bicep @@ -14,24 +14,6 @@ param imageTag string @description('Name of the Gateway') param gatewayName string -@description('Ordering SignalR Hub Http Route name') -param orderingsignalrhubHttpName string - -@description('Identity Http Route name') -param identityHttpName string - -@description('Web MVC Http Route name') -param webmvcHttpName string - -@description('Web SPA Http Route name') -param webspaHttpName string - -@description('Web Shopping Aggregator Http Route name') -param webshoppingaggHttpName string - -@description('Web shopping API GW HTTP Route name') -param webshoppingapigwHttpName string - @description('Name of the Keystore Redis portable resource') param redisKeystoreName string @@ -54,16 +36,21 @@ resource webspa 'Applications.Core/containers@2023-10-01-preview' = { CallBackUrl: '${gateway.properties.url}/' DPConnectionString: redisKeystore.connectionString() IdentityUrl: '${gateway.properties.url}/identity-api' - IdentityUrlHC: '${identityHttp.properties.url}/hc' + IdentityUrlHC: 'http://identity-api:5105/hc' PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' - SignalrHubUrl: orderingsignalrhubHttp.properties.url + SignalrHubUrl: 'http://ordering-signalrhub:5112' } ports: { http: { containerPort: 80 - provides: webspaHttp.id + port: 5104 } } + livenessProbe:{ + kind:'httpGet' + path:'/hc' + containerPort:80 + } } connections: { redis: { @@ -71,26 +58,26 @@ resource webspa 'Applications.Core/containers@2023-10-01-preview' = { disableDefaultEnvVars: true } webshoppingagg: { - source: webshoppingaggHttp.id + source: 'http://webshoppingagg:5121' disableDefaultEnvVars: true } identity: { - source: identityHttp.id + source: 'http://identity-api:5105' disableDefaultEnvVars: true } webshoppingapigw: { - source: webshoppingapigwHttp.id + source: 'http://webshoppingapigw:5202' disableDefaultEnvVars: true } orderingsignalrhub: { - source: orderingsignalrhubHttp.id + source: 'http://ordering-signalrhub:5112' disableDefaultEnvVars: true } } } } -// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webmvc +// Based on adfasfhttps://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webmvc resource webmvc 'Applications.Core/containers@2023-10-01-preview' = { name: 'webmvc' properties: { @@ -106,17 +93,17 @@ resource webmvc 'Applications.Core/containers@2023-10-01-preview' = { UseLoadTest: 'False' ORCHESTRATOR_TYPE: 'K8S' IsClusterEnv: 'True' - ExternalPurchaseUrl: '${gateway.properties.url}/${webshoppingapigwHttp.properties.hostname}' + ExternalPurchaseUrl: '${gateway.properties.url}/webshoppingapigw' CallBackUrl: '${gateway.properties.url}/webmvc' IdentityUrl: '${gateway.properties.url}/identity-api' - IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: webshoppingapigwHttp.properties.url - SignalrHubUrl: orderingsignalrhubHttp.properties.url + IdentityUrlHC: 'http://identity-api:5105/hc' + PurchaseUrl: 'http://webshoppingapigw:5202' + SignalrHubUrl: 'http://ordering-signalrhub:5112' } ports: { http: { containerPort: 80 - provides: webmvcHttp.id + port: 5100 } } } @@ -126,19 +113,19 @@ resource webmvc 'Applications.Core/containers@2023-10-01-preview' = { disableDefaultEnvVars: true } webshoppingagg: { - source: webshoppingaggHttp.id + source: 'http://webshoppingagg:5121' disableDefaultEnvVars: true } identity: { - source: identityHttp.id + source: 'http://identity-api:5105' disableDefaultEnvVars: true } webshoppingapigw: { - source: webshoppingapigwHttp.id + source: 'http://webshoppingapigw:5202' disableDefaultEnvVars: true } orderingsignalrhub: { - source: orderingsignalrhubHttp.id + source: 'http://ordering-signalrhub:5112' disableDefaultEnvVars: true } } @@ -151,32 +138,16 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource orderingsignalrhubHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingsignalrhubHttpName -} - -resource identityHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: identityHttpName -} - -resource webmvcHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webmvcHttpName -} - -resource webspaHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webspaHttpName -} - -resource webshoppingaggHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webshoppingaggHttpName -} - -resource webshoppingapigwHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webshoppingapigwHttpName -} - // PORTABLE RESOURCES ------------------------------------------------------ resource redisKeystore 'Applications.Datastores/redisCaches@2023-10-01-preview' existing = { name: redisKeystoreName } + + +// Output +@description('Name of the Web spa container') +output spacontainer string = webspa.name + +@description('Name of the Web mvc container') +output mvccontainer string = webmvc.name diff --git a/samples/eshop/services/webhooks.bicep b/samples/eshop/services/webhooks.bicep index 6d3a894f..e91085e2 100644 --- a/samples/eshop/services/webhooks.bicep +++ b/samples/eshop/services/webhooks.bicep @@ -14,15 +14,6 @@ param imageTag string @description('Name of the Gateway') param gatewayName string -@description('Name of the Identity HTTP Route') -param identityHttpName string - -@description('Name of the Webhooks HTTP Route') -param webhooksHttpName string - -@description('Name of the WebhooksClient HTTP Route') -param webhooksclientHttpName string - @description('The name of the Webhooks SQL portable resource') param sqlWebhooksDbName string @@ -54,15 +45,20 @@ resource webhooks 'Applications.Core/containers@2023-10-01-preview' = { AzureServiceBusEnabled: AZURESERVICEBUSENABLED ConnectionString: sqlWebhooksDb.connectionString() EventBusConnection: eventBusConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + identityUrl: 'http://identity-api:5105' + IdentityUrlExternal: '${gateway.properties.url}/identity-api' } ports: { http: { containerPort: 80 - provides: webhooksHttp.id + port: 5113 } } + livenessProbe:{ + kind:'httpGet' + path:'/hc' + containerPort:80 + } } connections: { sql: { @@ -70,7 +66,7 @@ resource webhooks 'Applications.Core/containers@2023-10-01-preview' = { disableDefaultEnvVars: true } identity: { - source: identityHttp.id + source: 'http://identity-api:5105' disableDefaultEnvVars: true } } @@ -90,24 +86,24 @@ resource webhooksclient 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webhooks-web' Token: 'WebHooks-Demo-Web' - CallBackUrl: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' - SelfUrl: webhooksclientHttp.properties.url - WebhooksUrl: webhooksHttp.properties.url - IdentityUrl: '${gateway.properties.url}/${identityHttp.properties.hostname}' + CallBackUrl: '${gateway.properties.url}/webhooks-client' + SelfUrl: 'http://webhooks-client:5114' + WebhooksUrl: 'http://webhooks-api:5113' + IdentityUrl: '${gateway.properties.url}/identity-api' } ports: { http: { containerPort: 80 - provides: webhooksclientHttp.id + port: 5114 } } } connections: { webhooks: { - source: webhooksHttp.id + source: 'http://webhooks-api:5113' } identity: { - source: identityHttp.id + source: 'http://identity-api:5105' } } } @@ -119,18 +115,6 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } -resource identityHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: identityHttpName -} - -resource webhooksHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webhooksHttpName -} - -resource webhooksclientHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webhooksclientHttpName -} - // PORTABLE RESOURCES ----------------------------------------------------------- resource sqlWebhooksDb 'Applications.Datastores/sqlDatabases@2023-10-01-preview' existing = { diff --git a/samples/eshop/services/webshopping.bicep b/samples/eshop/services/webshopping.bicep index 143edd08..2686eb9a 100644 --- a/samples/eshop/services/webshopping.bicep +++ b/samples/eshop/services/webshopping.bicep @@ -14,39 +14,6 @@ param imageTag string @description('Name of the Gateway') param gatewayName string -@description('Basket Http Route name') -param basketHttpName string - -@description('Basket gRPC Route name') -param basketGrpcName string - -@description('Ordering Http Route name') -param orderingHttpName string - -@description('Ordering gRPC Route name') -param orderingGrpcName string - -@description('Identity Http Route name') -param identityHttpName string - -@description('Catalog Http Route name') -param catalogHttpName string - -@description('Catalog gRPC Route name') -param catalogGrpcName string - -@description('Payment Http Route name') -param paymentHttpName string - -@description('Web shopping API GW HTTP Route name') -param webshoppingapigwHttpName string - -@description('Web shopping API GW HTTP Route 2 name') -param webshoppingapigwHttp2Name string - -@description('Web Shopping Aggregator Http Route name') -param webshoppingaggHttpName string - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webshoppingagg resource webshoppingagg 'Applications.Core/containers@2023-10-01-preview' = { name: 'webshoppingagg' @@ -60,42 +27,47 @@ resource webshoppingagg 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' ORCHESTRATOR_TYPE: 'K8S' IsClusterEnv: 'True' - urls__basket: basketHttp.properties.url - urls__catalog: catalogHttp.properties.url - urls__orders: orderingHttp.properties.url - urls__identity: identityHttp.properties.url - urls__grpcBasket: basketGrpc.properties.url - urls__grpcCatalog: catalogGrpc.properties.url - urls__grpcOrdering: orderingGrpc.properties.url - CatalogUrlHC: '${catalogHttp.properties.url}/hc' - OrderingUrlHC: '${orderingHttp.properties.url}/hc' - IdentityUrlHC: '${identityHttp.properties.url}/hc' - BasketUrlHC: '${basketHttp.properties.url}/hc' - PaymentUrlHC: '${paymentHttp.properties.url}/hc' - IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + urls__basket: 'http://basket-api:5103' + urls__catalog: 'http://catalog-api:5101' + urls__orders: 'http://ordering-api:5102' + urls__identity: 'http://identity-api:5105' + urls__grpcBasket: 'grpc://basket-api:9103' + urls__grpcCatalog: 'grpc://catalog-api:9101' + urls__grpcOrdering: 'grpc://ordering-api:9102' + CatalogUrlHC: 'http://catalog-api:5101/hc' + OrderingUrlHC: 'http://ordering-api:5102/hc' + IdentityUrlHC: 'http://identity-api:5105/hc' + BasketUrlHC: 'http://basket-api:5103/hc' + PaymentUrlHC: 'http://payment-api:5108/hc' + IdentityUrlExternal: '${gateway.properties.url}/identity-api' } ports: { http: { containerPort: 80 - provides: webshoppingaggHttp.id + port: 5121 } } + livenessProbe:{ + kind:'httpGet' + path:'/hc' + containerPort:80 + } } connections: { identity: { - source: identityHttp.id + source: 'http://identity-api:5105' disableDefaultEnvVars: true } ordering: { - source: orderingHttp.id + source: 'http://ordering-api:5102' disableDefaultEnvVars: true } catalog: { - source: catalogHttp.id + source: 'http://catalog-api:5101' disableDefaultEnvVars: true } basket: { - source: basketHttp.id + source: 'http://basket-api:5103' disableDefaultEnvVars: true } } @@ -109,17 +81,21 @@ resource webshoppingapigw 'Applications.Core/containers@2023-10-01-preview' = { properties: { application: application container: { - image: '${imageRegistry}/envoy:latest' + image: '${imageRegistry}/eshop-envoy:0.1.0' ports: { http: { containerPort: 80 - provides: webshoppingapigwHttp.id + port: 5202 } http2: { containerPort: 8001 - provides: webshoppingapigwHttp2.id + port: 15202 } } + livenessProbe:{ + kind:'tcp' + containerPort:80 + } } } } @@ -129,47 +105,3 @@ resource webshoppingapigw 'Applications.Core/containers@2023-10-01-preview' = { resource gateway 'Applications.Core/gateways@2023-10-01-preview' existing = { name: gatewayName } - -resource basketGrpc 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: basketGrpcName -} - -resource catalogGrpc 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: catalogGrpcName -} - -resource orderingGrpc 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingGrpcName -} - -resource catalogHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: catalogHttpName -} - -resource basketHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: basketHttpName -} - -resource orderingHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingHttpName -} - -resource identityHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: identityHttpName -} - -resource paymentHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: paymentHttpName -} - -resource webshoppingaggHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webshoppingaggHttpName -} - -resource webshoppingapigwHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webshoppingapigwHttpName -} - -resource webshoppingapigwHttp2 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webshoppingapigwHttp2Name -} diff --git a/samples/eshop/services/webstatus.bicep b/samples/eshop/services/webstatus.bicep index 2b230f04..dd4a44eb 100644 --- a/samples/eshop/services/webstatus.bicep +++ b/samples/eshop/services/webstatus.bicep @@ -11,38 +11,6 @@ param imageRegistry string @description('Container image tag to use for eshop images') param imageTag string -@description('Basket Http Route name') -param basketHttpName string - -@description('Ordering Http Route name') -param orderingHttpName string - -@description('Ordering SignalR Hub Http Route name') -param orderingsignalrhubHttpName string - -@description('Ordering Background Tasks Http Route name') -param orderbgtasksHttpName string - -@description('Identity Http Route name') -param identityHttpName string - -@description('Catalog Http Route name') -param catalogHttpName string - -@description('Payment Http Route name') -param paymentHttpName string - -@description('Web MVC Http Route name') -param webmvcHttpName string - -@description('Web SPA Http Route name') -param webspaHttpName string - -@description('Web Shopping Aggregator Http Route name') -param webshoppingaggHttpName string - -@description('Web Status Http Route name') -param webstatusHttpName string // CONTAINAERS --------------------------------------------------------- @@ -57,79 +25,37 @@ resource webstatus 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' HealthChecksUI__HealthChecks__0__Name: 'WebMVC HTTP Check' - HealthChecksUI__HealthChecks__0__Uri: '${webmvcHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__0__Uri: 'http://webmvc:5100/hc' HealthChecksUI__HealthChecks__1__Name: 'WebSPA HTTP Check' - HealthChecksUI__HealthChecks__1__Uri: '${webspaHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__1__Uri: 'http://web-spa:5104/hc' HealthChecksUI__HealthChecks__2__Name: 'Web Shopping Aggregator GW HTTP Check' - HealthChecksUI__HealthChecks__2__Uri: '${webshoppingaggHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__2__Uri: 'http://webshoppingagg:5121/hc' HealthChecksUI__HealthChecks__4__Name: 'Ordering HTTP Check' - HealthChecksUI__HealthChecks__4__Uri: '${orderingHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__4__Uri: 'http://ordering-api:5102/hc' HealthChecksUI__HealthChecks__5__Name: 'Basket HTTP Check' - HealthChecksUI__HealthChecks__5__Uri: '${basketHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__5__Uri: 'http://basket-api:5103/hc' HealthChecksUI__HealthChecks__6__Name: 'Catalog HTTP Check' - HealthChecksUI__HealthChecks__6__Uri: '${catalogHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__6__Uri: 'http://catalog-api/hc' HealthChecksUI__HealthChecks__7__Name: 'Identity HTTP Check' - HealthChecksUI__HealthChecks__7__Uri: '${identityHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__7__Uri: 'http://identity-api:5105/hc' HealthChecksUI__HealthChecks__8__Name: 'Payments HTTP Check' - HealthChecksUI__HealthChecks__8__Uri: '${paymentHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__8__Uri: 'http://payment-api:5108/hc' HealthChecksUI__HealthChecks__9__Name: 'Ordering SignalRHub HTTP Check' - HealthChecksUI__HealthChecks__9__Uri: '${orderingsignalrhubHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__9__Uri: 'http://ordering-signalrhub:5112/hc' HealthChecksUI__HealthChecks__10__Name: 'Ordering HTTP Background Check' - HealthChecksUI__HealthChecks__10__Uri: '${orderbgtasksHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__10__Uri: 'http://ordering-backgroundtasks:5111/hc' ORCHESTRATOR_TYPE: 'K8S' } ports: { http: { containerPort: 80 - provides: webstatusHttp.id + port: 8107 } } + livenessProbe:{ + kind:'tcp' + containerPort:80 + } } } } - -// NETWORKING ---------------------------------------------- - -resource catalogHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: catalogHttpName -} - -resource basketHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: basketHttpName -} - -resource orderingHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingHttpName -} - -resource orderingsignalrhubHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderingsignalrhubHttpName -} - -resource orderbgtasksHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: orderbgtasksHttpName -} - -resource identityHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: identityHttpName -} - -resource paymentHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: paymentHttpName -} - -resource webmvcHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webmvcHttpName -} - -resource webspaHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webspaHttpName -} - -resource webshoppingaggHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webshoppingaggHttpName -} - -resource webstatusHttp 'Applications.Core/httpRoutes@2023-10-01-preview' existing = { - name: webstatusHttpName -} diff --git a/samples/eshop/src/envoy/README.md b/samples/eshop/src/envoy/README.md index 7e78fdaf..3864344f 100644 --- a/samples/eshop/src/envoy/README.md +++ b/samples/eshop/src/envoy/README.md @@ -10,5 +10,5 @@ To build the docker image, run `docker build . -t ghcr.io/radius-project/samples Where NUMBER is one greater than the latest version made. To view versions, see https://ms.portal.azure.com/#view/Microsoft_Azure_ContainerRegistries/RepositoryBlade/id/%2Fsubscriptions%2F66d1209e-1382-45d3-99bb-650e6bf63fc0%2FresourceGroups%2Fassets%2Fproviders%2FMicrosoft.ContainerRegistry%2Fregistries%2Fradius/repository/eshop-envoy. -To push the image, run `az acr login -n radius` and then `docker push ghcr.io/radius-project/samples/eshop-envoy:0.1.`. +To push the image, run `az acr login -n radius` and then `docker push ghcr.io/radius-project/samples/eshop/eshop-envoy:0.1.`. diff --git a/samples/eshop/src/envoy/envoy.yaml b/samples/eshop/src/envoy/envoy.yaml index 1eeec0b6..d3269925 100644 --- a/samples/eshop/src/envoy/envoy.yaml +++ b/samples/eshop/src/envoy/envoy.yaml @@ -106,7 +106,7 @@ static_resources: lb_policy: round_robin hosts: - socket_address: - address: webshoppingagg-http + address: webshoppingagg port_value: 5121 - name: catalog connect_timeout: 0.25s @@ -114,7 +114,7 @@ static_resources: lb_policy: round_robin hosts: - socket_address: - address: catalog-http + address: catalog-api port_value: 5101 - name: basket connect_timeout: 0.25s @@ -122,7 +122,7 @@ static_resources: lb_policy: round_robin hosts: - socket_address: - address: basket-http + address: basket-api port_value: 5103 - name: ordering connect_timeout: 0.25s @@ -130,7 +130,7 @@ static_resources: lb_policy: round_robin hosts: - socket_address: - address: ordering-http + address: ordering-api port_value: 5102 - name: signalr-hub connect_timeout: 0.25s @@ -138,6 +138,6 @@ static_resources: lb_policy: round_robin hosts: - socket_address: - address: orderingsignalrhub-http + address: ordering-signalrhub port_value: 5112 \ No newline at end of file