Repository navigation
Expand file tree
/
Copy pathtypes.yaml
More file actions
655 lines (609 loc) · 26.2 KB
/
Copy pathtypes.yaml
File metadata and controls
655 lines (609 loc) · 26.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# types.yaml — All adaptive-apps Radius Resource Type definitions
#
# A single namespace is used for all custom resources:
# Radius.Resources → postgreSqlDatabases, mqttBrokers, workloadIdentities,
# aiModels, idProviders, governance, agentGuardrails
#
# Publish a single Bicep extension bundle from this file:
#
# rad bicep publish-extension \
# --file resource-types/types.yaml \
# --target types.tgz
#
# Register all three resource types in one command:
#
# rad resource-type create --from-file resource-types/types.yaml
namespace: Radius.Resources
types:
postgreSqlDatabases:
description: |
The Radius.Resources/postgreSqlDatabases Resource Type adds a PostgreSQL database to an application.
Start by adding a postgreSqlDatabases resource to your application definition Bicep file:
resource db 'Radius.Resources/postgreSqlDatabases@2025-08-01-preview' = {
name: 'db'
properties: {
environment: environment
application: app.id
size: 'S'
}
}
Then add a connection from a Container resource to the database resource.
resource myContainer 'Applications.Core/containers@2023-10-01-preview' = {
...
connections: {
db: {
source: db.id
}
}
}
When a connection is added, Radius injects the following environment variables into
the container (prefix `CONNECTION_DB_`):
- CONNECTION_DB_HOST
- CONNECTION_DB_PORT
- CONNECTION_DB_DATABASE
- CONNECTION_DB_USERNAME
You can also reference these properties directly in env var definitions:
- `db.properties.host`
- `db.properties.port`
- `db.properties.database`
- `db.properties.username`
- `db.properties.secrets.password`
apiVersions:
'2025-08-01-preview':
schema:
type: object
properties:
environment:
type: string
description: (Required) The Radius Environment ID. Typically set by the rad CLI.
application:
type: string
description: (Required) The Radius Application ID.
size:
type: string
enum:
- S
- M
- L
description: (Optional) The memory size tier for the PostgreSQL container. S=512Mi, M=1Gi, L=2Gi. Defaults to S if not provided.
host:
type: string
readOnly: true
description: (Read Only) The in-cluster hostname used to connect to the database (Kubernetes DNS format).
port:
type: integer
readOnly: true
description: (Read Only) The port used to connect to the database.
database:
type: string
readOnly: true
description: (Read Only) The name of the database.
username:
type: string
readOnly: true
description: (Read Only) The username used to connect to the database.
secrets:
type: object
readOnly: true
properties:
password:
type: string
readOnly: true
description: (Read Only) The password used to connect to the database.
required:
- password
required:
- environment
- application
mqttBrokers:
description: |
The Radius.Resources/mqttBrokers Resource Type adds an MQTT message broker to an application.
Eclipse Mosquitto is the default implementation for local Kubernetes environments.
Azure environments can bind this resource type to an Azure Event Grid MQTT recipe.
Start by adding a mqttBrokers resource to your application definition Bicep file:
resource mqtt 'Radius.Resources/mqttBrokers@2025-08-01-preview' = {
name: 'mqtt'
properties: {
environment: environment
application: app.id
}
}
Then connect a Container resource to the broker:
resource myContainer 'Applications.Core/containers@2023-10-01-preview' = {
...
connections: {
mqtt: {
source: mqtt.id
}
}
}
When connected, Radius can inject the following environment variables into containers
(prefix `CONNECTION_MQTT_`):
- CONNECTION_MQTT_HOST
- CONNECTION_MQTT_PORT
- CONNECTION_MQTT_WSPORT
You can also reference properties directly in env var definitions:
- `mqtt.properties.host`
- `mqtt.properties.port`
- `mqtt.properties.wsPort`
- `mqtt.properties.protocol`
- `mqtt.properties.wsProtocol`
- `mqtt.properties.authMethod`
- `mqtt.properties.tokenAudience`
apiVersions:
'2025-08-01-preview':
schema:
type: object
properties:
environment:
type: string
description: (Required) The Radius Environment ID. Typically set by the rad CLI.
application:
type: string
description: (Required) The Radius Application ID.
host:
type: string
readOnly: true
description: (Read Only) The in-cluster hostname used to connect to the MQTT broker (Kubernetes DNS format).
port:
type: integer
readOnly: true
description: (Read Only) The TCP port for MQTT connections (default 1883).
wsPort:
type: integer
readOnly: true
description: (Read Only) The WebSocket port for MQTT-over-WebSocket connections (default 9001). Used by browser clients.
protocol:
type: string
readOnly: true
description: '(Read Only) Transport protocol for TCP MQTT endpoint. Examples: mqtt, mqtts.'
wsProtocol:
type: string
readOnly: true
description: '(Read Only) WebSocket scheme for browser MQTT endpoint. Examples: ws, wss.'
authMethod:
type: string
readOnly: true
description: '(Read Only) Authentication method expected by broker. Examples: none, OAUTH2-JWT.'
tokenAudience:
type: string
readOnly: true
description: '(Read Only) Token audience expected by broker when JWT auth is required.'
resourceId:
type: string
readOnly: true
description: '(Read Only) Backing cloud resource ID for the broker when applicable (for example Azure Event Grid namespace resource ID).'
required:
- environment
- application
workloadIdentities:
description: |
The Radius.Resources/workloadIdentities Resource Type models workload identity
configuration for application components.
For Azure/AKS environments, provision the managed identity and federated
credential upfront using app-wi-setup.sh, then pass the resulting client ID
as an input to this resource.
Start by adding a workloadIdentities resource to your application definition:
resource wi 'Radius.Resources/workloadIdentities@2025-08-01-preview' = {
name: 'backend-identity'
properties: {
environment: environment
application: app.id
clientId: '<pre-provisioned managed identity client id>'
serviceAccountName: 'default'
}
}
Then connect your container resource and/or reference output properties directly.
apiVersions:
'2025-08-01-preview':
schema:
type: object
properties:
environment:
type: string
description: (Required) The Radius Environment ID. Typically set by the rad CLI.
application:
type: string
description: (Required) The Radius Application ID.
clientId:
type: string
description: (Optional) Client ID of a pre-provisioned user-assigned managed identity. Passed to the recipe and echoed back as an output.
serviceAccountName:
type: string
description: (Optional) Kubernetes service account name bound to this workload identity. Defaults to "default".
principalId:
type: string
readOnly: true
description: (Read Only) Managed identity principal ID.
tenantId:
type: string
readOnly: true
description: (Read Only) Tenant ID associated with the managed identity.
serviceAccountNamespace:
type: string
readOnly: true
description: (Read Only) Kubernetes namespace where the service account exists.
boundServiceAccountName:
type: string
readOnly: true
description: (Read Only) Kubernetes service account name bound for workload identity.
authMethod:
type: string
readOnly: true
description: '(Read Only) MQTT authentication method this identity is intended for. Example: OAUTH2-JWT.'
tokenAudience:
type: string
readOnly: true
description: '(Read Only) Token audience to request from Entra ID. Example: https://eventgrid.azure.net/.'
required:
- environment
- application
idProviders:
description: |
The Radius.Resources/idProviders Resource Type adds an OpenID Connect identity provider to an application.
Keycloak is the default implementation deployed by the Kubernetes Recipe.
apiVersions:
'2025-08-01-preview':
schema:
type: object
properties:
environment:
type: string
description: (Required) The Radius Environment ID. Typically set by the rad CLI.
application:
type: string
description: (Required) The Radius Application ID.
issuer:
type: string
readOnly: true
description: (Read Only) The OIDC issuer URL for the identity provider.
authEndpoint:
type: string
readOnly: true
description: (Read Only) The authorization endpoint URL for initiating OIDC auth flows.
tokenEndpoint:
type: string
readOnly: true
description: (Read Only) The token endpoint URL for exchanging auth codes and refreshing tokens.
userInfoEndpoint:
type: string
readOnly: true
description: (Read Only) The user info endpoint URL for retrieving authenticated user details.
required:
- environment
- application
aiModels:
description: |
The Radius.Resources/aiModels Resource Type provides an OpenAI-compatible AI inference
endpoint to an application. It is provider-agnostic: a Recipe fulfils the type
by provisioning the concrete backend infrastructure and returning a uniform set
of connection values so that the consuming container never needs to know which
AI backend is running.
Two recipes are provided in this repository:
kubernetes-kaito.bicep
Deploys an open-source LLM in-cluster via the Kaito operator on AKS.
Best for: local/dev Kubernetes environments with GPU nodes.
Outputs: provider="local", endpoint=http://<kaito-svc>:80/v1, apiKey=""
azure-openai.bicep
Creates an Azure OpenAI account and model deployment.
Best for: Azure environments where managed cloud AI is preferred.
Outputs: provider="openai", endpoint=https://<account>.openai.azure.com/, apiKey=<key>
The Recipe is registered per Radius Environment. Switch AI backends by
registering a different recipe for the same resource type in your environment:
rad recipe register default \
--environment <env> \
--resource-type Radius.Resources/aiModels \
--template-kind bicep \
--template-path br:<registry>/ai-agent-recipe:latest
Application model usage:
resource tradingAI 'Radius.Resources/aiModels@2025-08-01-preview' = {
name: 'trading-ai'
properties: {
environment: environment
application: app.id
model: 'gpt-4o' // optional hint consumed by the recipe
}
}
resource aiAgent 'Applications.Core/containers@2023-10-01-preview' = {
...
env: {
// Radius auto-injects CONNECTION_AI_PROVIDER, CONNECTION_AI_ENDPOINT,
// CONNECTION_AI_MODEL via the connection below. Only the secret
// must be wired explicitly.
CONNECTION_AI_SECRETS_APIKEY: { value: tradingAI.properties.secrets.apiKey }
}
connections: {
ai: { source: tradingAI.id }
}
}
Properties injected automatically via the connection (prefix CONNECTION_AI_):
- CONNECTION_AI_ENDPOINT
- CONNECTION_AI_PROVIDER
- CONNECTION_AI_MODEL
The ai-agent container reads the following environment variables:
CONNECTION_AI_PROVIDER — "openai" | "azure" | "local"
CONNECTION_AI_ENDPOINT — base URL for the inference API
CONNECTION_AI_MODEL — model / deployment name
CONNECTION_AI_SECRETS_APIKEY — API key (empty for local/Kaito)
apiVersions:
'2025-08-01-preview':
schema:
type: object
properties:
environment:
type: string
description: (Required) The Radius Environment ID. Typically set by the rad CLI.
application:
type: string
description: (Required) The Radius Application ID.
model:
type: string
description: >
(Optional) Model or deployment name to use. Recipes use this as a hint
when provisioning the inference backend and write the resolved value back.
Examples: gpt-4o, llama-3.1-8b-instruct, phi-3-mini.
Defaults to a recipe-specific value when omitted.
endpoint:
type: string
readOnly: true
description: >
(Read Only) OpenAI-compatible base URL for the inference API.
For local/Kaito: http://<service>.<namespace>.svc.cluster.local:80/v1
For Azure OpenAI: https://<account>.openai.azure.com/
provider:
type: string
readOnly: true
description: >
(Read Only) AI provider mode string understood by the ai-agent container.
"openai" — use OpenAI SDK with an API key (Azure OpenAI recipe)
"local" — use OpenAI SDK against a local endpoint, no key (Kaito recipe)
secrets:
type: object
readOnly: true
properties:
apiKey:
type: string
readOnly: true
description: >
(Read Only) API key for the inference endpoint.
Empty string for Kaito/local endpoints (no auth required).
Set to the Azure OpenAI account key by the azure-openai recipe.
required:
- environment
- application
governance:
description: |
The Radius.Resources/governance Resource Type adds a policy decision point
(PDP) to an application. It is provider-agnostic: a Recipe materializes the
type into a concrete enforcement mechanism such as Open Policy Agent (OPA),
service mesh AuthorizationPolicy generation, or a sidecar governance toolkit.
Recipes provided in this repository:
kubernetes-opa.bicep
Deploys an opa-envoy-plugin Deployment + Service into the application
namespace and exposes a gRPC decision endpoint suitable for use as an
Istio extensionProvider (envoyExtAuthzGrpc). Replaces the OPA workload
previously installed by the `ent` Helm portfolio.
The Recipe is registered per Radius Environment. Swap implementations by
registering a different recipe for the same resource type:
rad recipe register default \
--environment <env> \
--resource-type Radius.Resources/governance \
--template-kind bicep \
--template-path br:<registry>/governance-opa:latest
Application model usage:
resource gov 'Radius.Resources/governance@2025-08-01-preview' = {
name: 'gov'
properties: {
environment: environment
application: app.id
mode: 'enforce'
}
}
Output properties (consumed by mesh / sidecar integrations that wire the
PDP into the data plane — e.g. an Istio extensionProvider patch):
- provider — implementation kind (opa | agntcy-sidecar | istio-authz)
- decisionService — cluster-internal DNS hostname of the PDP
- decisionPort — gRPC ext_authz port
- decisionEndpoint — "<service>:<port>" string
- decisionPath — Rego decision path
- managementEndpoint — REST URL of the PDP management API
apiVersions:
'2025-08-01-preview':
schema:
type: object
properties:
environment:
type: string
description: (Required) The Radius Environment ID. Typically set by the rad CLI.
application:
type: string
description: (Required) The Radius Application ID.
mode:
type: string
enum:
- enforce
- audit
- dryrun
description: >
(Optional) Enforcement mode the recipe should configure. Recipes
may interpret this differently (e.g. OPA decision-log-only vs.
denying responses). Defaults to "enforce".
policy:
type: string
description: >
(Optional) Inline Rego policy bundle loaded by the PDP. When
empty, the recipe loads a default-allow policy so the data
plane remains functional out of the box.
decisionPath:
type: string
description: >
(Optional) Rego decision path consulted by the data plane.
Defaults to "/envoy/authz/allow" for the OPA recipe.
istioIntegration:
type: boolean
description: >
(Optional) When true, recipes that support it should also
register the PDP as an Istio mesh extensionProvider so
AuthorizationPolicy resources with `action: CUSTOM` can
delegate to it. The OPA recipe interprets this flag and
runs a one-shot Job to patch the Istio MeshConfig.
Defaults to false.
provider:
type: string
readOnly: true
description: >
(Read Only) Implementation provider materialized by the recipe.
Examples: "opa", "agntcy-sidecar", "istio-authz".
decisionService:
type: string
readOnly: true
description: (Read Only) Cluster-internal DNS hostname of the policy decision service.
decisionPort:
type: integer
readOnly: true
description: (Read Only) Port number for the enforcement (gRPC ext_authz) endpoint.
decisionEndpoint:
type: string
readOnly: true
description: (Read Only) Combined "service:port" string suitable for Istio extensionProvider configuration.
managementEndpoint:
type: string
readOnly: true
description: (Read Only) REST URL of the PDP management API (policy upload, data API).
istioProviderName:
type: string
readOnly: true
description: >
(Read Only) Name registered with the Istio MeshConfig as an
extensionProvider. Empty when the recipe does not perform
mesh integration. AuthorizationPolicy resources reference
this name via `provider.name` when `action: CUSTOM`.
required:
- environment
- application
agentGuardrails:
description: |
The Radius.Resources/agentGuardrails Resource Type provisions the
prerequisites for an in-pod *agent governance sidecar* — an
application-layer policy/safety proxy that the agent container talks to
over `localhost` (e.g. the Microsoft Agent Governance Toolkit "OpenClaw
sidecar" pattern). It is intentionally distinct from
Radius.Resources/governance, which models a service-mesh / external
authorization PDP at the network layer; the two can be enabled together.
Because a sidecar must live inside the agent's own pod, this Resource
Type does NOT deploy the sidecar container itself. Instead the recipe
stages the policy bundle ConfigMap (and, in the future, any secrets the
sidecar needs) and emits coordinates that the application Bicep uses to
compose a `runtimes.kubernetes.pod` patch on the agent
Applications.Core/containers resource.
Recipes provided in this repository:
kubernetes-agt-sidecar.bicep
Builds a ConfigMap holding the policy bundle the agent governance
toolkit (AGT) sidecar will mount at `/policies`. Outputs the
recommended sidecar image, port assignments, and ConfigMap name so
the application can render the sidecar PodSpec patch with
deterministic naming (no live dependency edge from the agent
container into this conditional resource — important to avoid the
`DeploymentResourceNoOperationJob` deployment-engine failure in
Radius v0.57.x).
Application model usage (see radius/app.bicep for the full pattern):
resource gr 'Radius.Resources/agentGuardrails@2025-08-01-preview' = {
name: 'ai-agent-guardrails'
properties: {
environment: environment
application: app.id
mode: 'enforce'
policies: '...inline YAML policy bundle...'
}
}
The agent container then receives the sidecar via:
runtimes: {
kubernetes: {
pod: {
containers: [ { name: 'agt-sidecar', image: '...', ... } ]
volumes: [ { name: 'agt-policies', configMap: { name: '...' } } ]
}
}
}
apiVersions:
'2025-08-01-preview':
schema:
type: object
properties:
environment:
type: string
description: (Required) The Radius Environment ID. Typically set by the rad CLI.
application:
type: string
description: (Required) The Radius Application ID.
mode:
type: string
enum:
- enforce
- audit
- dryrun
description: >
(Optional) Enforcement mode hint for the sidecar. Surfaced via
the `AGT_MODE` env var on the sidecar; recipes/sidecar code
may interpret it (e.g. "audit" = log but do not block).
Defaults to "enforce".
policies:
type: string
description: >
(Optional) Inline policy bundle written to
`/policies/policies.yaml` inside the sidecar. When empty, the
recipe writes a default-allow placeholder so the ConfigMap
exists and the agent pod can mount it. Format is sidecar-
specific; see the Agent Governance Toolkit docs.
image:
type: string
description: >
(Optional) Sidecar container image override. When empty, the
recipe records its own default (the Microsoft-published
`ghcr.io/microsoft/agentmesh/governance-sidecar` image from
the agent-governance-toolkit repository).
logLevel:
type: string
enum:
- DEBUG
- INFO
- WARN
- ERROR
description: >
(Optional) Log level for the sidecar. Defaults to "INFO".
Surfaced as the `LOG_LEVEL` env var.
provider:
type: string
readOnly: true
description: >
(Read Only) Implementation provider materialized by the
recipe. Example: "agt-openclaw-sidecar".
policiesConfigMapName:
type: string
readOnly: true
description: >
(Read Only) Name of the ConfigMap holding the policy bundle.
The application uses this when constructing the PodSpec
patch's `volumes` entry.
sidecarImage:
type: string
readOnly: true
description: >
(Read Only) Container image the recipe recommends for the
sidecar. Echoes the `image` input when set; otherwise the
recipe default.
proxyPort:
type: integer
readOnly: true
description: (Read Only) HTTP port the sidecar listens on for the governance proxy/API (default 8081).
metricsPort:
type: integer
readOnly: true
description: (Read Only) HTTP port the sidecar exposes metrics on (default 9091).
policiesMountPath:
type: string
readOnly: true
description: (Read Only) Path inside the sidecar where the policies ConfigMap should be mounted (default `/policies`).
required:
- environment
- application