Skip to content

Commit 57b2e0c

Browse files
Merge pull request #272408 from ryanwinterms/dapr-install-update
update yaml to support dapr 1.12/1.13 in AIO
2 parents a1bffb7 + 8cb7e3c commit 57b2e0c

File tree

3 files changed

+42
-45
lines changed

3 files changed

+42
-45
lines changed

articles/iot-operations/develop/howto-deploy-dapr.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@ To install the Dapr runtime, use the following Helm command:
3333
```bash
3434
helm repo add dapr https://dapr.github.io/helm-charts/
3535
helm repo update
36-
helm upgrade --install dapr dapr/dapr --version=1.11 --namespace dapr-system --create-namespace --wait
36+
helm upgrade --install dapr dapr/dapr --version=1.13 --namespace dapr-system --create-namespace --wait
3737
```
3838

39-
> [!IMPORTANT]
40-
> **Dapr v1.12** is currently not supported.
41-
4239
## Register MQ pluggable components
4340

4441
To register MQ's pluggable pub/sub and state management components, create the component manifest yaml, and apply it to your cluster.
@@ -49,7 +46,8 @@ To create the yaml file, use the following component definitions:
4946
> | Component | Description |
5047
> |-|-|
5148
> | `metadata.name` | The component name is important and is how a Dapr application references the component. |
52-
> | `spec.type` | [The type of the component](https://docs.dapr.io/operations/components/pluggable-components-registration/#define-the-component), which must be declared exactly as shown. It tells Dapr what kind of component (`pubsub` or `state`) it is and which Unix socket to use. |
49+
> | `metadata.annotations` | Component annotations used by the Dapr sidecar injector
50+
> | `spec.type` | [The type of the component](https://docs.dapr.io/operations/components/pluggable-components-registration/#define-the-component), which must be declared exactly as shown. It tells Dapr what kind of component (`pubsub` or `state`) it is and which Unix socket to use. |
5351
> | `spec.metadata.url` | The URL tells the component where the local MQ endpoint is. Defaults to `8883` is MQ's default MQTT port with TLS enabled. |
5452
> | `spec.metadata.satTokenPath` | The Service Account Token is used to authenticate the Dapr components with the MQTT broker |
5553
> | `spec.metadata.tlsEnabled` | Define if TLS is used by the MQTT broker. Defaults to `true` |
@@ -65,6 +63,22 @@ To create the yaml file, use the following component definitions:
6563
metadata:
6664
name: aio-mq-pubsub
6765
namespace: azure-iot-operations
66+
annotations:
67+
dapr.io/component-container: >
68+
{
69+
"name": "aio-mq-components",
70+
"image": "ghcr.io/azure/iot-mq-dapr-components:latest",
71+
"volumeMounts": [
72+
{
73+
"name": "mqtt-client-token",
74+
"mountPath": "/var/run/secrets/tokens"
75+
},
76+
{
77+
"name": "aio-ca-trust-bundle",
78+
"mountPath": "/var/run/certs/aio-mq-ca-cert"
79+
}
80+
]
81+
}
6882
spec:
6983
type: pubsub.aio-mq-pubsub-pluggable # DO NOT CHANGE
7084
version: v1
@@ -77,15 +91,29 @@ To create the yaml file, use the following component definitions:
7791
value: true
7892
- name: caCertPath
7993
value: "/var/run/certs/aio-mq-ca-cert/ca.crt"
80-
- name: logLevel
81-
value: "Info"
8294
---
8395
# State Management component
8496
apiVersion: dapr.io/v1alpha1
8597
kind: Component
8698
metadata:
8799
name: aio-mq-statestore
88100
namespace: azure-iot-operations
101+
annotations:
102+
dapr.io/component-container: >
103+
{
104+
"name": "aio-mq-components",
105+
"image": "ghcr.io/azure/iot-mq-dapr-components:latest",
106+
"volumeMounts": [
107+
{
108+
"name": "mqtt-client-token",
109+
"mountPath": "/var/run/secrets/tokens"
110+
},
111+
{
112+
"name": "aio-ca-trust-bundle",
113+
"mountPath": "/var/run/certs/aio-mq-ca-cert"
114+
}
115+
]
116+
}
89117
spec:
90118
type: state.aio-mq-statestore-pluggable # DO NOT CHANGE
91119
version: v1
@@ -98,8 +126,6 @@ To create the yaml file, use the following component definitions:
98126
value: true
99127
- name: caCertPath
100128
value: "/var/run/certs/aio-mq-ca-cert/ca.crt"
101-
- name: logLevel
102-
value: "Info"
103129
```
104130
105131
1. Apply the component yaml to your cluster by running the following command:

articles/iot-operations/develop/howto-develop-dapr-apps.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ After you finish writing the Dapr application, build the container:
5050

5151
## Deploy a Dapr application
5252

53-
The following [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) definition defines the different volumes required to deploy the application along with the required containers.
53+
The following [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) definition contains the volumes required to deploy the application along with the required containers. This deployment utilizes the Dapr sidecar injector to automatically add the pluggable component pod.
5454

55-
To start, create a yaml file with the following definitions:
55+
The yaml contains both a ServiceAccount, used to generate SATs for authentication with IoT Mq and the Dapr application Deployment.
56+
57+
To create the yaml file, use the following definitions:
5658

5759
> | Component | Description |
5860
> |-|-|
59-
> | `volumes.dapr-unix-domain-socket` | A shared directory to host unix domain sockets used to communicate between the Dapr sidecar and the pluggable components |
6061
> | `volumes.mqtt-client-token` | The System Authentication Token used for authenticating the Dapr pluggable components with the IoT MQ broker |
6162
> | `volumes.aio-ca-trust-bundle` | The chain of trust to validate the MQTT broker TLS cert. This defaults to the test certificate deployed with Azure IoT Operations |
6263
> | `containers.mq-dapr-app` | The Dapr application container you want to deploy |
@@ -88,17 +89,14 @@ To start, create a yaml file with the following definitions:
8889
app: mq-dapr-app
8990
annotations:
9091
dapr.io/enabled: "true"
91-
dapr.io/unix-domain-socket-path: "/tmp/dapr-components-sockets"
92+
dapr.io/inject-pluggable-components: "true"
9293
dapr.io/app-id: "mq-dapr-app"
9394
dapr.io/app-port: "6001"
9495
dapr.io/app-protocol: "grpc"
9596
spec:
9697
serviceAccountName: dapr-client
9798
9899
volumes:
99-
- name: dapr-unix-domain-socket
100-
emptyDir: {}
101-
102100
# SAT token used to authenticate between Dapr and the MQTT broker
103101
- name: mqtt-client-token
104102
projected:
@@ -117,17 +115,6 @@ To start, create a yaml file with the following definitions:
117115
# Container for the Dapr application
118116
- name: mq-dapr-app
119117
image: <YOUR_DAPR_APPLICATION>
120-
121-
# Container for the pluggable component
122-
- name: aio-mq-components
123-
image: ghcr.io/azure/iot-mq-dapr-components:latest
124-
volumeMounts:
125-
- name: dapr-unix-domain-socket
126-
mountPath: /tmp/dapr-components-sockets
127-
- name: mqtt-client-token
128-
mountPath: /var/run/secrets/tokens
129-
- name: aio-ca-trust-bundle
130-
mountPath: /var/run/certs/aio-mq-ca-cert/
131118
```
132119

133120
2. Deploy the component by running the following command:

articles/iot-operations/develop/tutorial-event-driven-with-dapr.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ To start, create a yaml file that uses the following definitions:
4040

4141
| Component | Description |
4242
|-|-|
43-
| `volumes.dapr-unit-domain-socket` | The socket file used to communicate with the Dapr sidecar |
4443
| `volumes.mqtt-client-token` | The SAT used for authenticating the Dapr pluggable components with the MQ broker and State Store |
4544
| `volumes.aio-mq-ca-cert-chain` | The chain of trust to validate the MQTT broker TLS cert |
4645
| `containers.mq-event-driven` | The prebuilt Dapr application container. |
@@ -72,17 +71,14 @@ To start, create a yaml file that uses the following definitions:
7271
app: mq-event-driven-dapr
7372
annotations:
7473
dapr.io/enabled: "true"
75-
dapr.io/unix-domain-socket-path: "/tmp/dapr-components-sockets"
74+
dapr.io/inject-pluggable-components: "true"
7675
dapr.io/app-id: "mq-event-driven-dapr"
7776
dapr.io/app-port: "6001"
7877
dapr.io/app-protocol: "grpc"
7978
spec:
8079
serviceAccountName: dapr-client
8180

8281
volumes:
83-
- name: dapr-unix-domain-socket
84-
emptyDir: {}
85-
8682
# SAT token used to authenticate between Dapr and the MQTT broker
8783
- name: mqtt-client-token
8884
projected:
@@ -98,20 +94,8 @@ To start, create a yaml file that uses the following definitions:
9894
name: aio-ca-trust-bundle-test-only
9995

10096
containers:
101-
# Container for the dapr quickstart application
10297
- name: mq-event-driven-dapr
10398
image: ghcr.io/azure-samples/explore-iot-operations/mq-event-driven-dapr:latest
104-
105-
# Container for the pluggable component
106-
- name: aio-mq-components
107-
image: ghcr.io/azure/iot-mq-dapr-components:latest
108-
volumeMounts:
109-
- name: dapr-unix-domain-socket
110-
mountPath: /tmp/dapr-components-sockets
111-
- name: mqtt-client-token
112-
mountPath: /var/run/secrets/tokens
113-
- name: aio-ca-trust-bundle
114-
mountPath: /var/run/certs/aio-mq-ca-cert/
11599
```
116100
117101
1. Deploy the application by running the following command:
@@ -131,7 +115,7 @@ To start, create a yaml file that uses the following definitions:
131115
```output
132116
NAME READY STATUS RESTARTS AGE
133117
...
134-
mq-event-driven-dapr 4/4 Running 0 30s
118+
mq-event-driven-dapr 3/3 Running 0 30s
135119
```
136120

137121

0 commit comments

Comments
 (0)