componenet setups

This commit is contained in:
Aaron Crawfis 2020-10-16 16:17:26 -07:00
parent e1fc0f80df
commit 0539bc07fc
52 changed files with 555 additions and 188 deletions

View File

@ -5,6 +5,8 @@ linkTitle: "Azure Blob Storage"
description: "Detailed documentation on the Azure Blob Storage binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -29,15 +31,13 @@ spec:
- `container` is the name of the Blob Storage container to write to.
- `decodeBase64` optional configuration to decode base64 file content before saving to Blob Storage. (In case of saving a file with binary content). "true" is the only allowed positive value. Other positive variations like "True" are not acceptable.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* [create](#create-blob)
* [get](#get-blob)
## Create Blob
### Create Blob
To perform a get blob operation, invoke the Azure Blob Storage binding with a `POST` method and the following JSON body:
@ -50,7 +50,7 @@ To perform a get blob operation, invoke the Azure Blob Storage binding with a `P
}
```
Example:
#### Example:
```bash
@ -58,7 +58,7 @@ curl -d '{ "operation": "create", "data": { "field1": "value1" }}' \
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
```
### Response
#### Response
The response body will contain the following JSON:
@ -69,7 +69,7 @@ The response body will contain the following JSON:
```
## Get Blob
### Get Blob
To perform a get blob operation, invoke the Azure Blob Storage binding with a `POST` method and the following JSON body:
@ -82,14 +82,14 @@ To perform a get blob operation, invoke the Azure Blob Storage binding with a `P
}
```
Example:
#### Example:
```bash
curl -d '{ "operation": "get", "metadata": { "blobName": "myblob" }}' \
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
```
### Response
#### Response
The response body will contain the value stored in the blob object.
@ -113,4 +113,10 @@ Applications publishing to an Azure Blob Storage output binding should send a me
},
"operation": "create"
}
```
```
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Azure CosmosDB"
description: "Detailed documentation on the Azure CosmosDB binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -32,8 +34,16 @@ spec:
- `collection` is name of the collection inside the database.
- `partitionKey` is the name of the partitionKey to extract from the payload.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Cron"
description: "Detailed documentation on the cron binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -44,3 +46,9 @@ For ease of use, the Dapr cron binding also supports few shortcuts:
* `@every 15s` where `s` is seconds, `m` minutes, and `h` hours
* `@daily` or `@hourly` which runs at that period from the time the binding is initialized
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "AWS DynamoDB"
description: "Detailed documentation on the AWS DynamoDB binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -29,8 +31,16 @@ spec:
- `secretKey` is the AWS secret key.
- `table` is the DynamoDB table name.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -7,6 +7,8 @@ description: "Detailed documentation on the Azure Event Grid binding component"
See [this](https://docs.microsoft.com/en-us/azure/event-grid/) for Azure Event Grid documentation.
## Setup Dapr component
```yml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -30,11 +32,9 @@ spec:
value: [HandshakePort]
- name: scope
value: "[Scope]"
# Optional Input Binding Metadata
- name: eventSubscriptionName
value: "[EventSubscriptionName]"
# Required Output Binding Metadata
- name: accessKey
value: "[AccessKey]"
@ -42,38 +42,31 @@ spec:
value: "[TopicEndpoint]
```
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Input Binding Metadata
- `tenantId` is the Azure tenant id in which this Event Grid Event Subscription should be created
- `subscriptionId` is the Azure subscription id in which this Event Grid Event Subscription should be created
- `clientId` is the client id that should be used by the binding to create or update the Event Grid Event Subscription
- `clientSecret` is the client secret that should be used by the binding to create or update the Event Grid Event Subscription
- `subscriberEndpoint` is the https (required) endpoint in which Event Grid will handshake and send Cloud Events. If you aren't re-writing URLs on ingress, it should be in the form of: `https://[YOUR HOSTNAME]/api/events` If testing on your local machine, you can use something like [ngrok](https://ngrok.com) to create a public endpoint.
- `handshakePort` is the container port that the input binding will listen on for handshakes and events
- `scope` is the identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an Event Grid topic. For example:
- '/subscriptions/{subscriptionId}/' for a subscription
- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group
- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource
- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an Event Grid topic
> Values in braces {} should be replaced with actual values.
- `eventSubscriptionName` (Optional) is the name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
## Output Binding Supported Operations
* create
## Output Binding Metadata
- `accessKey` is the Access Key to be used for publishing an Event Grid Event to a custom topic
- `topicEndpoint` is the topic endpoint in which this output binding should publish events
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
## Output Binding Supported Operations
- create
## Additional information
@ -89,7 +82,7 @@ az role assignment create --assignee <clientId> --role "EventGrid EventSubscript
_Make sure to also to add quotes around the `[HandshakePort]` in your Event Grid binding component because Kubernetes expects string values from the config._
### Testing locally using ngrok and Dapr standalone mode
### Testing locally
- Install [ngrok](https://ngrok.com/download)
- Run locally using custom port `9000` for handshakes
@ -107,7 +100,7 @@ ngrok http -host-header=localhost 9000
dapr run --app-id dotnetwebapi --app-port 5000 --dapr-http-port 3500 dotnet run
```
### Testing from Kubernetes cluster
### Testing om Kubernetes
Azure Event Grid requires a valid HTTPS endpoint for custom webhooks. Self signed certificates won't do. In order to enable traffic from public internet to your app's Dapr sidecar you need an ingress controller enabled with Dapr. There's a good article on this topic: [Kubernetes NGINX ingress controller with Dapr](https://carlos.mendible.com/2020/04/05/kubernetes-nginx-ingress-controller-with-dapr/).
@ -221,7 +214,7 @@ kubectl apply -f dotnetwebapi.yaml
> **Note:** This manifest deploys everything to Kubernetes default namespace.
**Troubleshooting possible issues with Nginx controller**
#### Troubleshooting possible issues with Nginx controller
After initial deployment the "Daprized" Nginx controller can malfunction. To check logs and fix issue (if it exists) follow these steps.
@ -242,3 +235,9 @@ $ kubectl delete pod nginx-nginx-ingress-controller-649df94867-fp6mg
# Check the logs again - it should start returning 200
# .."OPTIONS /api/events HTTP/1.1" 200..
```
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -7,6 +7,8 @@ description: "Detailed documentation on the Azure Event Hubs binding component"
See [this](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-framework-getstarted-send) for instructions on how to set up an Event Hub.
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -37,8 +39,16 @@ spec:
- `storageContainerName` Is the name of the container in the Azure Storage account to persist checkpoints data on.
- `partitionID` (Optional) ID of the partition to send and receive events.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "GCP Storage Bucket"
description: "Detailed documentation on the GCP Storage Bucket binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -50,8 +52,16 @@ spec:
- `client_x509_cert_url` is the GCP credentials project x509 cert url.
- `private_key` is the GCP credentials private key.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "GCP Pub/Sub"
description: "Detailed documentation on the GCP Pub/Sub binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -53,8 +55,16 @@ spec:
- `client_x509_cert_url` is the GCP credentials project x509 cert url.
- `private_key` is the GCP credentials private key.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "HTTP"
description: "Detailed documentation on the HTTP binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -26,3 +28,9 @@ spec:
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "InfluxDB"
description: "Detailed documentation on the InfluxDB binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -29,8 +31,16 @@ spec:
- `org` is the InfluxDB organization.
- `bucket` bucket name to write to.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Kafka"
description: "Detailed documentation on the kafka binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -38,7 +40,9 @@ spec:
- `saslUsername` is the SASL username for authentication. Only used if `authRequired` is set to - `"true"`.
- `saslPassword` is the SASL password for authentication. Only used if `authRequired` is set to - `"true"`.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Specifying a partition key
@ -65,3 +69,9 @@ curl -X POST http://localhost:3500/v1.0/bindings/myKafka \
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -7,6 +7,8 @@ description: "Detailed documentation on the AWS Kinesis binding component"
See [this](https://aws.amazon.com/kinesis/data-streams/getting-started/) for instructions on how to set up an AWS Kinesis data streams
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -38,8 +40,16 @@ spec:
- `consumerName` is the AWS Kinesis Consumer Name.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Kubernetes Events"
description: "Detailed documentation on the Kubernetes Events binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -97,3 +99,9 @@ roleRef:
name: <ROLENAME> # same as the one above
apiGroup: ""
```
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "MQTT"
description: "Detailed documentation on the MQTT binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -23,8 +25,16 @@ spec:
- `url` is the MQTT broker url.
- `topic` is the topic to listen on or send events to.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "PostgrSQL"
description: "Detailed documentation on the PostgrSQL binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -18,7 +20,9 @@ spec:
value: <CONNECTION_STRING>
```
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
The PostgrSQL binding uses [pgx connection pool](https://github.com/jackc/pgx) internally so the `url` parameter can be any valid connection string, either in a `DSN` or `URL` format:
@ -36,17 +40,17 @@ postgres://dapr:secret@dapr.example.com:5432/dapr?sslmode=verify-ca
Both methods also support connection pool configuration variables:
* `pool_min_conns`: integer 0 or greater
* `pool_max_conns`: integer greater than 0
* `pool_max_conn_lifetime`: duration string
* `pool_max_conn_idle_time`: duration string
* `pool_health_check_period`: duration string
- `pool_min_conns`: integer 0 or greater
- `pool_max_conns`: integer greater than 0
- `pool_max_conn_lifetime`: duration string
- `pool_max_conn_idle_time`: duration string
- `pool_health_check_period`: duration string
## Output Binding Supported Operations
* `exec`
* `query`
* `close`
- `exec`
- `query`
- `close`
### exec
@ -127,4 +131,8 @@ Finally, the `close` operation can be used to explicitly close the DB connection
> Note, the PostgreSql binding itself doesn't prevent SQL injection, like with any database application, validate the input before executing query.
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "RabbitMQ"
description: "Detailed documentation on the RabbitMQ binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -35,7 +37,9 @@ spec:
- `ttlInSeconds` is an optional parameter to set the [default message time to live at RabbitMQ queue level](https://www.rabbitmq.com/ttl.html). If this parameter is omitted, messages won't expire, continuing to exist on the queue until processed.
- `prefetchCount` is an optional parameter to set the [Channel Prefetch Setting (QoS)](https://www.rabbitmq.com/confirms.html#channel-qos-prefetch). If this parameter is omiited, QoS would set value to 0 as no limit.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Specifying a time to live on message level
@ -64,3 +68,9 @@ curl -X POST http://localhost:3500/v1.0/bindings/myRabbitMQ \
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Redis"
description: "Detailed documentation on the Redis binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -26,8 +28,16 @@ spec:
- `redisPassword` is the Redis password.
- `enableTLS` - If the Redis instance supports TLS with public certificates it can be configured to enable or disable TLS.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,11 +5,13 @@ linkTitle: "RethinkDB"
description: "Detailed documentation on the RethinkDB binding component"
---
## Introduction
The RethinkDB state store supports transactions which means it can be used to support Dapr actors. Dapr persists only the actor's current state which doesn't allow the users to track how actor's state may have changed over time.
To enable users to track change of the state of actors, this binding leverages RethinkDB's built-in capability to monitor RethinkDB table and event on change with both the `old` and `new` state. This binding creates a subscription on the Dapr state table and streams these changes using the Dapr input binding interface.
## Create a binding
## Setup Dapr component
Create the following YAML file and save this to the `components` directory in your application directory.
(Use the `--components-path` flag with `dapr run` to point to your custom components dir)
@ -29,3 +31,9 @@ spec:
```
For example on how to combine this binding with Dapr Pub/Sub to stream state changes to a topic see [here](https://github.com/mchmarny/dapr-state-store-change-handler).
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "AWS S3"
description: "Detailed documentation on the AWS S3 binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -29,8 +31,16 @@ spec:
- `secretKey` is the AWS secret key.
- `table` is the name of the S3 bucket to write to.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Twilio SendGrid"
description: "Detailed documentation on the Twilio SendGrid binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -44,8 +46,17 @@ Example request payload
}
```
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Azure Service Bus Queues"
description: "Detailed documentation on the Azure Service Bus Queues binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -26,7 +28,10 @@ spec:
- `queueName` is the Service Bus queue name.
- `ttlInSeconds` is an optional parameter to set the default message [time to live](https://docs.microsoft.com/azure/service-bus-messaging/message-expiration). If this parameter is omitted, messages will expire after 14 days.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Specifying a time to live on message level
@ -55,3 +60,9 @@ curl -X POST http://localhost:3500/v1.0/bindings/myServiceBusQueue \
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Azure SignalR"
description: "Detailed documentation on the Azure SignalR binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -23,7 +25,10 @@ spec:
- The metadata `connectionString` contains the Azure SignalR connection string.
- The optional `hub` metadata value defines the hub in which the message will be send. The hub can be dynamically defined as a metadata value when publishing to an output binding (key is "hub").
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Additional information
@ -57,3 +62,9 @@ For more information on integration Azure SignalR into a solution check the [doc
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "AWS SNS"
description: "Detailed documentation on the AWS SNS binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -29,8 +31,16 @@ spec:
- `secretKey` is the AWS secret key.
- `topicArn` is the SNS topic name.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "AWS SQS"
description: "Detailed documentation on the AWS SQS binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -29,8 +31,17 @@ spec:
- `secretKey` is the AWS secret key.
- `queueName` is the SQS queue name.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Azure Storage Queues"
description: "Detailed documentation on the Azure Storage Queues binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -29,7 +31,10 @@ spec:
- `queue` is the name of the Azure Storage queue.
- `ttlInSeconds` is an optional parameter to set the default message time to live. If this parameter is omitted, messages will expire after 10 minutes.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Specifying a time to live on message level
@ -58,3 +63,9 @@ curl -X POST http://localhost:3500/v1.0/bindings/myStorageQueue \
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Twilio SMS"
description: "Detailed documentation on the Twilio SMS binding component"
---
## Setup Dapr component
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -29,8 +31,17 @@ spec:
- `accountSid` is the Twilio account SID.
- `authToken` is the Twilio auth token.
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Output Binding Supported Operations
* create
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -5,6 +5,8 @@ linkTitle: "Twitter"
description: "Detailed documentation on the Twitter binding component"
---
## Setup Dapr component
The Twitter binding supports both `input` and `output` binding configuration. First the common part:
```yaml
@ -26,6 +28,12 @@ spec:
value: "****" # twitter api access secret, required
```
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Input bindings
For input bindings, where the query matching Tweets are streamed to the user service, the above component has to also include a query:
```yaml
@ -33,6 +41,8 @@ For input bindings, where the query matching Tweets are streamed to the user ser
value: "dapr" # your search query, required
```
## Output bindings
For output binding invocation the user code has to invoke the binding:
```shell
@ -55,11 +65,17 @@ Where the payload is:
The metadata parameters are:
* `query` - any valid Twitter query (e.g. `dapr` or `dapr AND serverless`). See [Twitter docs](https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/standard-operators) for more details on advanced query formats
* `lang` - (optional, default: `en`) restricts result tweets to the given language using [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
* `result` - (optional, default: `recent`) specifies tweet query result type. Valid values include:
* `mixed` - both popular and real time results
* `recent` - most recent results
* `popular` - most popular results
- `query` - any valid Twitter query (e.g. `dapr` or `dapr AND serverless`). See [Twitter docs](https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/standard-operators) for more details on advanced query formats
- `lang` - (optional, default: `en`) restricts result tweets to the given language using [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
- `result` - (optional, default: `recent`) specifies tweet query result type. Valid values include:
- `mixed` - both popular and real time results
- `recent` - most recent results
- `popular` - most popular results
You can see the example of the JSON data that Twitter binding returns [here](https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets)
You can see the example of the JSON data that Twitter binding returns [here](https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets)
## Related links
- [Bindings building block]({{< ref bindings >}})
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
- [Bindings API reference]({{< ref bindings_api.md >}})

View File

@ -2,7 +2,7 @@
type: docs
title: "AWS Secrets Manager"
linkTitle: "AWS Secrets Manager"
type: docs
description: Detailed information on the decret store component
---
## Create an AWS Secrets Manager instance

View File

@ -2,6 +2,7 @@
type: docs
title: "Azure Key Vault secret store"
linkTitle: "Azure Key Vault"
description: Detailed information on the Azure Key Vault secret store component
---
{{% alert title="Note" color="primary" %}}

View File

@ -3,6 +3,7 @@ type: docs
title: "Local environment variables (for Development)"
linkTitle: "Local environment variables"
weight: 10
description: Detailed information on the local environment secret store component
---
This Dapr secret store component uses locally defined environment variable and does not use authentication.

View File

@ -3,6 +3,7 @@ type: docs
title: "Local file (for Development)"
linkTitle: "Local file"
weight: 20
description: Detailed information on the local file secret store component
---
This Dapr secret store component reads plain text JSON from a given file and does not use authentication.

View File

@ -2,6 +2,7 @@
type: docs
title: "GCP Secret Manager"
linkTitle: "GCP Secret Manager"
description: Detailed information on the GCP Secret Manager secret store component
---
This document shows how to enable GCP Secret Manager secret store using [Dapr Secrets Component](../../concepts/secrets/README.md) for self hosted and Kubernetes mode.

View File

@ -2,7 +2,7 @@
type: docs
title: "HashiCorp Vault"
linkTitle: "HashiCorp Vault"
type: docs
description: Detailed information on the HashiCorp Vault secret store component
---
## Setup Hashicorp Vault instance

View File

@ -3,6 +3,7 @@ type: docs
title: "Kubernetes Secrets"
linkTitle: "Kubernetes Secrets"
weight: 30
description: Detailed information on the Kubernetes secret store component
---
## Summary

View File

@ -2,11 +2,14 @@
type: docs
title: "Aerospike"
linkTitle: "Aerospike"
type: docs
description: Detailed information on the Aerospike state store component
---
## Locally
## Setup Aerospike
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run Aerospike locally using Docker:
```
@ -14,9 +17,9 @@ docker run -d --name aerospike -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3003:30
```
You can then interact with the server using `localhost:3000`.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install Aerospike on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/stable/aerospike):
```
@ -30,6 +33,9 @@ To interact with Aerospike, find the service with: `kubectl get svc aerospike -n
For example, if installing using the example above, the Aerospike host address would be:
`aerospike-my-aerospike.aerospike.svc.cluster.local:3000`
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -54,8 +60,9 @@ spec:
value: <REPLACE-WITH-SET> # Optional.
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md).
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration

View File

@ -2,7 +2,7 @@
type: docs
title: "Azure Blob Storage"
linkTitle: "Azure Blob Storage"
type: docs
description: Detailed information on the Azure Blob Store state store component
---
## Creating Azure Storage account
@ -12,10 +12,9 @@ type: docs
If you wish to create a container for Dapr to use, you can do so beforehand. However, Blob Storage state provider will create one for you automatically if it doesn't exist.
In order to setup Azure Blob Storage as a state store, you will need the following properties:
* **AccountName**: The storage account name. For example: **mystorageaccount**.
* **AccountKey**: Primary or secondary storage key.
* **ContainerName**: The name of the container to be used for Dapr state. The container will be created for you if it doesn't exist.
- **AccountName**: The storage account name. For example: **mystorageaccount**.
- **AccountKey**: Primary or secondary storage key.
- **ContainerName**: The name of the container to be used for Dapr state. The container will be created for you if it doesn't exist.
## Create a Dapr component
@ -40,7 +39,11 @@ spec:
value: <REPLACE-WITH-CONTAINER-NAME>
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md).
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
### Example
The following example uses the Kubernetes secret store to retrieve the secrets:

View File

@ -2,21 +2,20 @@
type: docs
title: "Azure Cosmos DB"
linkTitle: "Azure Cosmos DB"
type: docs
description: Detailed information on the Azure CosmosDB state store component
---
## Creating an Azure Cosmos DB account
## Create a Azure Cosmos DB account
[Follow the instructions](https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-manage-database-account) from the Azure documentation on how to create an Azure CosmosDB account. The database and collection must be created in CosmosDB before Dapr can use it.
**Note : The partition key for the collection must be named "/partitionKey". Note: this is case-sensitive.**
In order to setup CosmosDB as a state store, you need the following properties:
* **URL**: the CosmosDB url. for example: https://******.documents.azure.com:443/
* **Master Key**: The key to authenticate to the CosmosDB account
* **Database**: The name of the database
* **Collection**: The name of the collection
- **URL**: the CosmosDB url. for example: https://******.documents.azure.com:443/
- **Master Key**: The key to authenticate to the CosmosDB account
- **Database**: The name of the database
- **Collection**: The name of the collection
## Create a Dapr component
@ -43,7 +42,11 @@ spec:
value: <REPLACE-WITH-COLLECTION>
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
### Example
Here is an example of what the values could look like:

View File

@ -2,20 +2,19 @@
type: docs
title: "Azure Table Storage "
linkTitle: "Azure Table Storage "
type: docs
description: Detailed information on the Azure Table Storage state store component
---
## Creating Azure Storage account
## Create an Azure Storage account
[Follow the instructions](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal) from the Azure documentation on how to create an Azure Storage Account.
If you wish to create a table for Dapr to use, you can do so beforehand. However, Table Storage state provider will create one for you automatically if it doesn't exist.
In order to setup Azure Table Storage as a state store, you will need the following properties:
* **AccountName**: The storage account name. For example: **mystorageaccount**.
* **AccountKey**: Primary or secondary storage key.
* **TableName**: The name of the table to be used for Dapr state. The table will be created for you if it doesn't exist.
**AccountName**: The storage account name. For example: **mystorageaccount**.
**AccountKey**: Primary or secondary storage key.
- **TableName**: The name of the table to be used for Dapr state. The table will be created for you if it doesn't exist.
## Create a Dapr component
@ -40,7 +39,11 @@ spec:
value: <REPLACE-WITH-TABLE-NAME>
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md).
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
### Example
The following example uses the Kubernetes secret store to retrieve the secrets:

View File

@ -2,11 +2,14 @@
type: docs
title: "Cassandra"
linkTitle: "Cassandra"
type: docs
description: Detailed information on the Cassandra state store component
---
## Locally
## Create a Cassandra state store
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run Cassandra locally with the Datastax Docker image:
```
@ -14,9 +17,9 @@ docker run -e DS_LICENSE=accept --memory 4g --name my-dse -d datastax/dse-server
```
You can then interact with the server using `localhost:9042`.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install Cassandra on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/incubator/cassandra):
```
@ -30,6 +33,9 @@ To interact with Cassandra, find the service with: `kubectl get svc -n cassandra
For example, if installing using the example above, the Cassandra DNS would be:
`cassandra.cassandra.svc.cluster.local`
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -64,7 +70,11 @@ spec:
value: <REPLACE-WITH-REPLICATION-FACTOR> # Optional. default: "1"
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
### Example
The following example uses the Kubernetes secret store to retrieve the username and password:

View File

@ -2,14 +2,16 @@
type: docs
title: "Cloudstate"
linkTitle: "Cloudstate"
type: docs
description: Detailed information on the Cloudstate state store component
---
## Introduction
The Cloudstate-Dapr integration is unique in the sense that it enables developers to achieve high-throughput, low latency scenarios by leveraging Cloudstate running as a sidecar *next* to Dapr, keeping the state near the compute unit for optimal performance while providing replication between multiple instances that can be safely scaled up and down. This is due to Cloudstate forming an Akka cluster between its sidecars with replicated in-memory entities.
Dapr leverages Cloudstate's CRDT capabilities with last-write-wins semantics.
## Kubernetes
## Setup a Cloudstate state store
To install Cloudstate on your Kubernetes cluster, run the following commands:

View File

@ -2,11 +2,14 @@
type: docs
title: "HashiCorp Consul"
linkTitle: "HashiCorp Consul"
type: docs
description: Detailed information on the HashiCorp Consul state store component
---
## Locally
## Setup a HashiCorp Consul state store
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run Consul locally using Docker:
```
@ -14,9 +17,9 @@ docker run -d --name=dev-consul -e CONSUL_BIND_INTERFACE=eth0 consul
```
You can then interact with the server using `localhost:8500`.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install Consul on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/stable/consul):
```
@ -29,6 +32,9 @@ To interact with Consul, find the service with: `kubectl get svc consul`.
For example, if installing using the example above, the Consul host address would be:
`consul.default.svc.cluster.local:8500`
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -57,7 +63,11 @@ spec:
value: <REPLACE-WITH-TABLE> # Optional. default: ""
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
### Example
The following example uses the Kubernetes secret store to retrieve the acl token:

View File

@ -2,11 +2,14 @@
type: docs
title: "Couchbase"
linkTitle: "Couchbase"
type: docs
description: Detailed information on the Couchbase state store component
---
## Locally
## Create a Couchbase state store
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run Couchbase locally using Docker:
```
@ -14,9 +17,9 @@ docker run -d --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase
```
You can then interact with the server using `localhost:8091` and start the server setup.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install Couchbase on Kubernetes is by using the [Helm chart](https://github.com/couchbase-partners/helm-charts#deploying-for-development-quick-start):
```
@ -24,6 +27,9 @@ helm repo add couchbase https://couchbase-partners.github.io/helm-charts/
helm install couchbase/couchbase-operator
helm install couchbase/couchbase-cluster
```
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -50,8 +56,9 @@ spec:
value: <REPLACE-WITH-BUCKET> # Required.
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration

View File

@ -2,11 +2,14 @@
type: docs
title: "etcd"
linkTitle: "etcd"
type: docs
description: Detailed information on the etcd state store component
---
## Locally
## Setup an etcd state store
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run etcd locally using Docker:
```
@ -14,9 +17,9 @@ docker run -d --name etcd bitnami/etcd
```
You can then interact with the server using `localhost:2379`.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install etcd on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/incubator/etcd):
```
@ -30,6 +33,9 @@ To interact with etcd, find the service with: `kubectl get svc etcd-etcd`.
For example, if installing using the example above, the etcd host address would be:
`etcd-etcd.default.svc.cluster.local:2379`
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -54,8 +60,9 @@ spec:
value: <REPLACE-WITH-OPERATION-TIMEOUT> # Optional. default: "10S"
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration

View File

@ -2,18 +2,24 @@
type: docs
title: "GCP Firestore (Datastore mode)"
linkTitle: "GCP Firestore"
type: docs
description: Detailed information on the GCP Firestore state store component
---
## Locally
## Setup a GCP Firestone state store
{{< tabs "Self-Hosted" "Google Cloud" >}}
{{% codetab %}}
You can use the GCP Datastore emulator to run locally using the instructions [here](https://cloud.google.com/datastore/docs/tools/datastore-emulator).
You can then interact with the server using `localhost:8081`.
{{% /codetab %}}
## Google Cloud
{{% codetab %}}
Follow the instructions [here](https://cloud.google.com/datastore/docs/quickstart) to get started with setting up Firestore in Google Cloud.
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -54,8 +60,9 @@ spec:
value: <REPLACE-WITH-ENTITY-KIND> # Optional. default: "DaprState"
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration

View File

@ -2,11 +2,14 @@
type: docs
title: "Hazelcast"
linkTitle: "Hazelcast"
type: docs
description: Detailed information on the Hazelcast state store component
---
## Locally
## Setup a Hazelcast state store
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run Hazelcast locally using Docker:
```
@ -14,10 +17,13 @@ docker run -e JAVA_OPTS="-Dhazelcast.local.publicAddress=127.0.0.1:5701" -p 5701
```
You can then interact with the server using the `127.0.0.1:5701`.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install Hazelcast on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/stable/hazelcast).
{{% /codetab %}}
The easiest way to install Hazelcast on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/stable/hazelcast):
{{< /tabs >}}
## Create a Dapr component
@ -40,8 +46,9 @@ spec:
value: <REPLACE-WITH-MAP> # Required. Hazelcast map configuration.
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md).
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration

View File

@ -2,11 +2,14 @@
type: docs
title: "Memcached"
linkTitle: "Memcached"
type: docs
description: Detailed information on the Memcached state store component
---
## Locally
## Setup a Memcached state store
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run Memcached locally using Docker:
```
@ -14,9 +17,9 @@ docker run --name my-memcache -d memcached
```
You can then interact with the server using `localhost:11211`.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install Memcached on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/stable/memcached):
```
@ -29,6 +32,9 @@ To interact with Memcached, find the service with: `kubectl get svc memcached`.
For example, if installing using the example above, the Memcached host address would be:
`memcached.default.svc.cluster.local:11211`
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -53,8 +59,9 @@ spec:
value: <REPLACE-WITH-TIMEOUT> # Optional. default: "1000ms"
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration

View File

@ -2,11 +2,14 @@
type: docs
title: "MongoDB"
linkTitle: "MongoDB"
type: docs
description: Detailed information on the MongoDB state store component
---
## Locally
## Setup a MongoDB state store
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run MongoDB locally using Docker:
```
@ -14,9 +17,9 @@ docker run --name some-mongo -d mongo
```
You can then interact with the server using `localhost:27017`.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install MongoDB on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/stable/mongodb):
```
@ -33,6 +36,9 @@ For example, if installing using the example above, the MongoDB host address wou
Follow the on-screen instructions to get the root password for MongoDB.
The username will be `admin` by default.
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -67,7 +73,11 @@ spec:
value: <REPLACE-WITH-OPERATION-TIMEOUT> # Optional. default: "5s"
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md).
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
### Example
The following example uses the Kubernetes secret store to retrieve the username and password:

View File

@ -2,12 +2,11 @@
type: docs
title: "PostgreSQL"
linkTitle: "PostgreSQL"
type: docs
description: Detailed information on the PostgreSQL state store component
---
This article provides guidance on configuring a PostgreSQL state store.
## Create a PostgreSQL Store
Dapr can use any PostgreSQL instance. If you already have a running instance of PostgreSQL, move on to the [Create a Dapr component](#create-a-dapr-component) section.
1. Run an instance of PostgreSQL. You can run a local instance of PostgreSQL in Docker CE with the following command:
@ -46,7 +45,9 @@ spec:
- name: actorStateStore
value: "true"
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md).
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration

View File

@ -2,15 +2,21 @@
type: docs
title: "Redis"
linkTitle: "Redis"
type: docs
description: Detailed information on the Redis state store component
weight: 10
---
## Creating a Redis Store
## Create a Redis Store
Dapr can use any Redis instance - containerized, running on your local dev machine, or a managed cloud service. If you already have a Redis store, move on to the [Configuration](#configuration) section.
### Creating a Redis Cache in your Kubernetes Cluster using Helm
{{< tabs "Self-Hosted" "Kubernetes" "Azure" "AWS" "GCP" >}}
{{% codetab %}}
[Content for Tab1]
{{% /codetab %}}
{{% codetab %}}
We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Kubernetes cluster. This approach requires [Installing Helm](https://github.com/helm/helm#install).
1. Install Redis into your cluster. Note that we're explicitly setting an image tag to get a version greater than 5, which is what Dapr' pub/sub functionality requires. If you're intending on using Redis as just a state store (and not for pub/sub), you do not have to set the image version.
@ -37,9 +43,9 @@ We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Ku
- name: redisPassword
value: lhDOkwTlp0
```
### Creating an Azure Managed Redis Cache
{{% /codetab %}}
{{% codetab %}}
**Note**: this approach requires having an Azure Subscription.
1. Open [this link](https://ms.portal.azure.com/#create/Microsoft.Cache) to start the Azure Cache for Redis creation flow. Log in if necessary.
@ -51,27 +57,24 @@ We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Ku
5. Finally, we need to add our key and our host to a `redis.yaml` file that Dapr can apply to our cluster. If you're running a sample, you'll add the host and key to the provided `redis.yaml`. If you're creating a project from the ground up, you'll create a `redis.yaml` file as specified in [Configuration](#configuration). Set the `redisHost` key to `[HOST NAME FROM PREVIOUS STEP]:6379` and the `redisPassword` key to the key you copied in step 4. **Note:** In a production-grade application, follow [secret management](https://github.com/dapr/docs/blob/master/concepts/components/secrets.md) instructions to securely manage your secrets.
> **NOTE:** Dapr pub/sub uses [Redis Streams](https://redis.io/topics/streams-intro) that was introduced by Redis 5.0, which isn't currently available on Azure Managed Redis Cache. Consequently, you can use Azure Managed Redis Cache only for state persistence.
{{% /codetab %}}
{{% codetab %}}
[AWS Redis](https://aws.amazon.com/redis/)
{{% /codetab %}}
### Other ways to create a Redis Database
{{% codetab %}}
[GCP Cloud MemoryStore](https://cloud.google.com/memorystore/)
{{% /codetab %}}
- [AWS Redis](https://aws.amazon.com/redis/)
- [GCP Cloud MemoryStore](https://cloud.google.com/memorystore/)
{{< /tabs >}}
## Configuration
## Create a Dapr component
To setup Redis, you need to create a component for `state.redis`.
<br>
The following yaml file demonstrates how to define each.
### Configuring Redis for State Persistence and Retrieval
**TLS:** If the Redis instance supports TLS with public certificates it can be configured to enable or disable TLS `true` or `false`.
**Failover:** When set to `true` enables the failover feature. The redisHost should be the sentinel host address. See [Redis Sentinel Documentation](https://redis.io/topics/sentinel)
**Note:** yaml files below illustrate secret management in plain text. In a production-grade application, follow [secret management](../../concepts/secrets/README.md) instructions to securely manage your secrets.
Create a file called redis.yaml, and paste the following:
```yaml
@ -93,6 +96,10 @@ spec:
value: <bool> # Optional. Allowed: true, false.
```
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration
### Kubernetes

View File

@ -2,10 +2,10 @@
type: docs
title: "RethinkDB"
linkTitle: "RethinkDB"
type: docs
description: Detailed information on the RethinkDB state store component
---
## Locally
## Setup RethinkDB state store
You can run [RethinkDB](https://rethinkdb.com/) locally using Docker:
@ -19,7 +19,6 @@ To connect to the admin UI:
open "http://$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' rethinkdb):8080"
```
## Create a Dapr component
The next step is to create a Dapr component for RethinkDB.
@ -49,6 +48,10 @@ spec:
value: # Optional (whether or not store should keep archive table of all the state changes)
```
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
RethinkDB state store supports transactions so it can be used to persist Dapr Actor state. By default, the state will be stored in table name `daprstate` in the specified database.
Additionally, if the optional `archive` metadata is set to `true`, on each state change, the RethinkDB state store will also log state changes with timestamp in the `daprstate_archive` table. This allows for time series analyses of the state managed by Dapr.

View File

@ -2,10 +2,10 @@
type: docs
title: "SQL Server"
linkTitle: "SQL Server"
type: docs
description: Detailed information on the SQL Server state store component
---
## Creating an Azure SQL instance
## Create an Azure SQL instance
[Follow the instructions](https://docs.microsoft.com/azure/sql-database/sql-database-single-database-get-started?tabs=azure-portal) from the Azure documentation on how to create a SQL database. The database must be created before Dapr consumes it.
@ -13,10 +13,10 @@ type: docs
In order to setup SQL Server as a state store, you will need the following properties:
* **Connection String**: the SQL Server connection string. For example: server=localhost;user id=sa;password=your-password;port=1433;database=mydatabase;
* **Schema**: The database schema do use (default=dbo). Will be created if not exists
* **Table Name**: The database table name. Will be created if not exists
* **Indexed Properties**: Optional properties from json data which will be indexed and persisted as individual column
- **Connection String**: the SQL Server connection string. For example: server=localhost;user id=sa;password=your-password;port=1433;database=mydatabase;
- **Schema**: The database schema do use (default=dbo). Will be created if not exists
- **Table Name**: The database table name. Will be created if not exists
- **Indexed Properties**: Optional properties from json data which will be indexed and persisted as individual column
### Create a dedicated user
@ -27,7 +27,7 @@ When connecting with a dedicated user (not `sa`), these authorizations are requi
## Create a Dapr component
> currently this component does not support state management for actors
> Currently this component does not support state management for actors
The next step is to create a Dapr component for SQL Server.
@ -48,7 +48,11 @@ spec:
value: <REPLACE-WITH-TABLE-NAME>
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
### Example
The following example uses the Kubernetes secret store to retrieve the secrets:

View File

@ -2,11 +2,14 @@
type: docs
title: "Zookeeper"
linkTitle: "Zookeeper"
type: docs
description: Detailed information on the Zookeeper state store component
---
## Locally
## Setup a Zookeeper state store
{{< tabs "Self-Hosted" "Kubernetes" >}}
{{% codetab %}}
You can run Zookeeper locally using Docker:
```
@ -14,9 +17,9 @@ docker run --name some-zookeeper --restart always -d zookeeper
```
You can then interact with the server using `localhost:2181`.
{{% /codetab %}}
## Kubernetes
{{% codetab %}}
The easiest way to install Zookeeper on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/incubator/zookeeper):
```
@ -30,6 +33,9 @@ To interact with Zookeeper, find the service with: `kubectl get svc zookeeper`.
For example, if installing using the example above, the Zookeeper host address would be:
`zookeeper.default.svc.cluster.local:2181`
{{% /codetab %}}
{{< /tabs >}}
## Create a Dapr component
@ -58,8 +64,9 @@ spec:
value: <REPLACE-WITH-KEY-PREFIX-PATH> # Optional.
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
## Apply the configuration