Skip to content

Commit 2ed3c19

Browse files
committed
update dapr quickstart
Signed-off-by: Ryan Winter <[email protected]>
1 parent 21dab6e commit 2ed3c19

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

tutorials/mq-event-driven-dapr/app.yaml

+19-14
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,26 @@ metadata:
1313
"image": "ghcr.io/azure/iot-operations-dapr-components:latest",
1414
"volumeMounts": [
1515
{ "name": "mqtt-client-token", "mountPath": "/var/run/secrets/tokens" },
16-
{ "name": "aio-ca-trust-bundle", "mountPath": "/var/run/certs/aio-mq-ca-cert" }
16+
{ "name": "aio-ca-trust-bundle", "mountPath": "/var/run/certs/aio-internal-ca-cert" }
17+
],
18+
"env": [
19+
{ "name": "pubSubLogLevel", "value": "Information" },
20+
{ "name": "stateStoreLogLevel", "value": "Information" },
21+
{ "name": "defaultLogLevel", "value": "Warning" }
1722
]
1823
}
1924
spec:
2025
type: pubsub.azure.iotoperations
2126
version: v1
2227
metadata:
2328
- name: hostname
24-
value: aio-mq-dmqtt-frontend
29+
value: aio-broker
2530
- name: tcpPort
26-
value: 8883
31+
value: 18883
2732
- name: useTls
2833
value: true
2934
- name: caFile
30-
value: /var/run/certs/aio-mq-ca-cert/ca.crt
35+
value: /var/run/certs/aio-internal-ca-cert/ca.crt
3136
- name: satAuthFile
3237
value: /var/run/secrets/tokens/mqtt-client-token
3338
---
@@ -41,23 +46,23 @@ spec:
4146
version: v1
4247
metadata:
4348
- name: hostname
44-
value: aio-mq-dmqtt-frontend
49+
value: aio-broker
4550
- name: tcpPort
46-
value: 8883
51+
value: 18883
4752
- name: useTls
4853
value: true
4954
- name: caFile
50-
value: /var/run/certs/aio-mq-ca-cert/ca.crt
55+
value: /var/run/certs/aio-internal-ca-cert/ca.crt
5156
- name: satAuthFile
52-
value: /var/run/secrets/tokens/mqtt-client-token
57+
value: /var/run/secrets/tokens/mqtt-client-token
5358
---
5459
apiVersion: v1
5560
kind: ServiceAccount
5661
metadata:
5762
name: dapr-client
5863
namespace: azure-iot-operations
5964
annotations:
60-
aio-mq-broker-auth/group: dapr-workload
65+
aio-broker-auth/group: dapr-workload
6166
---
6267
apiVersion: apps/v1
6368
kind: Deployment
@@ -86,15 +91,15 @@ spec:
8691
- name: mqtt-client-token
8792
projected:
8893
sources:
89-
- serviceAccountToken:
90-
path: mqtt-client-token
91-
audience: aio-mq
92-
expirationSeconds: 86400
94+
- serviceAccountToken:
95+
path: mqtt-client-token
96+
audience: aio-internal
97+
expirationSeconds: 86400
9398

9499
# Certificate chain for Dapr to validate the MQTT broker
95100
- name: aio-ca-trust-bundle
96101
configMap:
97-
name: aio-ca-trust-bundle-test-only
102+
name: azure-iot-operations-aio-ca-trust-bundle
98103

99104
containers:
100105
- name: mq-event-driven-dapr

tutorials/mq-event-driven-dapr/simulate-data.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ spec:
2828
sources:
2929
- serviceAccountToken:
3030
path: mqtt-client-token
31-
audience: aio-mq
31+
audience: aio-internal
3232
expirationSeconds: 86400
3333
- name: aio-ca-trust-bundle
3434
configMap:
35-
name: aio-ca-trust-bundle-test-only
35+
name: azure-iot-operations-aio-ca-trust-bundle
3636
containers:
3737
- name: mqtt-publisher
3838
image: alpine
3939
volumeMounts:
4040
- name: mqtt-client-token
4141
mountPath: /var/run/secrets/tokens
4242
- name: aio-ca-trust-bundle
43-
mountPath: /var/run/certs/aio-mq-ca-cert
43+
mountPath: /var/run/certs/aio-ca-cert
4444
command: ["sh", "-c"]
4545
args:
4646
- |
@@ -62,7 +62,7 @@ spec:
6262
\"vibration\": $(awk -v min=0.001 -v max=0.005 'BEGIN{srand(); print min+rand()*(max-min)}')
6363
}"
6464
65-
mosquitto_pub -V mqttv311 -i mqtt-publisher -q 1 -L mqtts://aio-mq-dmqtt-frontend/sensor/data -m "$DATA" -u K8S-SAT -P $(cat /var/run/secrets/tokens/mqtt-client-token) --cafile /var/run/certs/aio-mq-ca-cert/ca.crt
65+
mosquitto_pub -V mqttv311 -i mqtt-publisher -q 1 -L mqtts://aio-broker:18883/sensor/data -m "$DATA" -u K8S-SAT -P $(cat /var/run/secrets/tokens/mqtt-client-token) --cafile /var/run/certs/aio-ca-cert/ca.crt
6666
if [ $? -eq 0 ]; then
6767
MSG_COUNT=$((MSG_COUNT+1))
6868
else

0 commit comments

Comments
 (0)