stacks/dapr-integration
salaboy 7801f7300d
Initial Dapr integration (#26)
Signed-off-by: salaboy <Salaboy@gmail.com>
2024-08-09 12:55:41 -07:00
..
dapr-components Initial Dapr integration (#26) 2024-08-09 12:55:41 -07:00
dapr-components.yaml Initial Dapr integration (#26) 2024-08-09 12:55:41 -07:00
dapr.yaml Initial Dapr integration (#26) 2024-08-09 12:55:41 -07:00
README.md Initial Dapr integration (#26) 2024-08-09 12:55:41 -07:00
redis.yaml Initial Dapr integration (#26) 2024-08-09 12:55:41 -07:00

Dapr Integrations

idpBuilder is extensible to launch custom Dapr patterns using package extensions.

Please use the following command to deploy Dapr using idpbuilder:

idpbuilder create \
  --use-path-routing \
  --p https://github.com/cnoe-io/stacks//dapr-integrations

Notice that you can add Dapr to the reference implementation:

idpbuilder create \
  --use-path-routing \
  --p https://github.com/cnoe-io/stacks//ref-implementation
  --p https://github.com/cnoe-io/stacks//dapr-integrations

What is installed?

  1. Dapr Control Plane
  2. Dapr Statestore and PubSub components
  3. Redis instance to support Statestore and Pubsub components

Once installed, you can enable your workloads (Deployments) to use the Dapr APIs by using the Dapr annotations:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nodeapp
  labels:
    app: node
spec:
  replicas: 1
  selector:
    matchLabels:
      app: node
  template:
    metadata:
      labels:
        app: node
      annotations:
        dapr.io/enabled: "true"
        dapr.io/app-id: "nodeapp"
        dapr.io/app-port: "3000"
        dapr.io/enable-api-logging: "true"
    spec:
      containers:
      - name: node
        image: ghcr.io/dapr/samples/hello-k8s-node:latest
        env:
        - name: APP_PORT
          value: "3000"
        ports:
        - containerPort: 3000
        imagePullPolicy: Always

This example creates a Dapr-enabled Kubernetes Deployment (setting the dapr.io/* annotations). This application can now use the Dapr APIs to interact with the Statestore and PubSub components provided by the default installation. Applications can be written in any programming language, check the Dapr SDKs here.

For more information, check the Hello Kubernetes Dapr tutorial here