Skip to content

Commit

Permalink
fix: various improvements for new rad version and presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
loekd committed Aug 28, 2024
1 parent 60728cb commit a0d34ca
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 9 deletions.
2 changes: 1 addition & 1 deletion 01-Bicep/scripts/script01.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ rad group show test -o json
rad run ./app_v1.bicep --group test --application demo01
$CTRL+C

rad app delete demo01 -g test -y
rad app delete demo01 --group test -y
7 changes: 4 additions & 3 deletions 01-Bicep/scripts/script02.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cd ..

rad run ./app_v2.bicep --group test --application demo01
rad deploy ./app_v2.bicep --group test --application demo01
rad resource expose --group test --application demo01 containers container01 --port 3000 --remote-port 3000
$CTRL+C

rad env show test -g test -o json
rad app delete demo01 -g test -y
rad env show test --group test -o json
rad app delete demo01 --group test -y
61 changes: 61 additions & 0 deletions 04-Full/app.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
extension radius

@description('Specifies the Environment Name.')
param environmentName string = 'test'

@description('The Radius Application Name.')
param applicationName string = 'demo04'

@description('Indicates whether to use HTTPS for the Gateway.')
param useHttps string

@description('The host name of the application.')
param hostName string

//Deploy shared resources like Jaeger and PubSub
module shared 'shared.bicep' = {
name: 'shared'
params: {
environmentName: environmentName
applicationName: applicationName
}
}
//deploy the frontend (Blazor WebAssembly app)
module frontend 'frontend.bicep' = {
name: 'frontend'
params: {
environmentName: environmentName
applicationName: applicationName
useHttps: useHttps
hostName: hostName
}
dependsOn: [
shared
dispatchApi
plantApi
]
}

//deploy the plant API
module plantApi 'plant.bicep' = {
name: 'plant'
params: {
environmentName: environmentName
applicationName: applicationName
}
dependsOn: [
shared
]
}

//deploy the dispatch API
module dispatchApi 'dispatch.bicep' = {
name: 'dispatch'
params: {
environmentName: environmentName
applicationName: applicationName
}
dependsOn: [
shared
]
}
3 changes: 3 additions & 0 deletions 04-Full/recipes/azure/otlp_recipe.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,18 @@ resource configMap 'core/ConfigMap@v1' = {
'otel-collector-config.yaml': concat('''
receivers:
zipkin:
endpoint: "0.0.0.0:9411"
extensions:
health_check:
path: "/health"
endpoint: "0.0.0.0:13133"
pprof:
endpoint: :1888
zpages:
endpoint: :55679
exporters:
debug:
verbosity: basic
azuremonitor:
connection_string: "InstrumentationKey=-45e5-8007-0e9b6c6a5c15;IngestionEndpoint=https://northeurope-2.in.applicationinsights.azure.com/;LiveEndpoint=https://northeurope.livediagnostics.monitor.azure.com/;ApplicationId=2f51e7eb-f120-4961-8fbd-52905eb88912"
processors:
Expand Down
3 changes: 1 addition & 2 deletions 04-Full/scripts/portforwards.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@REM #port forward to app
@REM #set correct k8s cluster
kubectl config use-context docker-desktop
wt kubectl port-forward services/frontend 80:80 -n test-demo04

@REM #port forward Jaeger
wt kubectl port-forward services/jaeger-3cat3stttmlle 16686:16686 -n test-demo04
Expand Down
4 changes: 2 additions & 2 deletions 04-Full/scripts/script01.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
cd ..

rad workspace switch local
rad deploy ./frontend.bicep -g test --parameters hostName=localhost --parameters useHttps=true
rad deploy ./app.bicep -g test --parameters hostName=localhost --parameters useHttps=true

wt $PWD\scripts\portforwards.bat

#curl -k https://localhost
#check api health
curl -k https://localhost/api/healthz

explorer http://localhost
explorer https://localhost/dispatch
explorer http://localhost:16686
explorer http://localhost:7007/resources/test/Applications.Core/applications/demo04/application

Expand Down
2 changes: 1 addition & 1 deletion 04-Full/scripts/script02.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rad workspace list
rad workspace switch cloud
rad group create prod

rad deploy ./frontend.bicep --parameters environmentName=prod --parameters hostName=demo.loekd.com
rad deploy ./app.bicep --parameters environmentName=prod --parameters hostName=demo.loekd.com --parameters useHttps=true

#check api health
curl https://demo.loekd.com/api/healthz
Expand Down

0 comments on commit a0d34ca

Please sign in to comment.