|
||
---|---|---|
.. | ||
dapr-components | ||
dapr-components.yaml | ||
dapr.yaml | ||
README.md | ||
redis.yaml |
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?
- Dapr Control Plane
- Dapr Statestore and PubSub components
- 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