mirror of https://github.com/dapr/docs.git
Merge branch 'v1.6' into kafka_pubsub_metadata_as_headers_1408
This commit is contained in:
commit
f96e7fcb04
|
@ -55,9 +55,7 @@ with DaprClient() as d:
|
|||
pubsub_name='pubsub',
|
||||
topic='TOPIC_A',
|
||||
data=json.dumps(req_data),
|
||||
metadata=(
|
||||
('ttlInSeconds', '120')
|
||||
)
|
||||
publish_metadata={'ttlInSeconds': '120'}
|
||||
)
|
||||
# Print the request
|
||||
print(req_data, flush=True)
|
||||
|
|
|
@ -90,7 +90,7 @@ spec:
|
|||
Run the sidecar and the Go server:
|
||||
|
||||
```bash
|
||||
dapr run --app-id server --app-protocol grpc --app-port 50051 --config config.yaml -- go run main.go
|
||||
dapr run --app-id server --app-port 50051 --config config.yaml -- go run main.go
|
||||
```
|
||||
|
||||
Using the Dapr CLI, we're assigning a unique id to the app, `server`, using the `--app-id` flag.
|
||||
|
|
|
@ -17,8 +17,13 @@ The state query API provides a way of querying the key/value data stored in stat
|
|||
Even though the state store is a key/value store, the `value` might be a JSON document with its own hierarchy, keys, and values.
|
||||
The query API allows you to use those keys and values to retrive corresponding documents.
|
||||
|
||||
This query API does not support querying of actor state stored in a state store. For that you need to use the query API for the specific database.
|
||||
See [querying actor state]({{< ref "state-management-overview.md#querying-actor-state" >}}).
|
||||
### Limitations
|
||||
The state query API has the following limitations:
|
||||
|
||||
- The API does not support querying of actor state stored in a state store. For that you need to use the query API for the specific database. See [querying actor state]({{< ref "state-management-overview.md#querying-actor-state" >}}).
|
||||
- The API does not work with Dapr [encrypted state stores]({{<ref howto-encrypt-state>}}) capability. Since the encryption is done by the Dapr runtime and stored as encrypted data, then this effectively prevents server side querying.
|
||||
|
||||
|
||||
|
||||
You can find additional information in the [related links]({{< ref "#related-links" >}}) section.
|
||||
|
||||
|
|
|
@ -74,4 +74,4 @@ After the components-contrib change has been accepted, submit another pull reque
|
|||
|
||||
* [Component schema]({{< ref component-schema.md >}})
|
||||
* [Configuration overview]({{< ref configuration-overview.md >}})
|
||||
* [Middleware quickstart](https://github.com/dapr/quickstarts/tree/master/middleware)
|
||||
* [Middleware sample](https://github.com/dapr/samples/tree/master/middleware-oauth-google)
|
||||
|
|
|
@ -22,7 +22,6 @@ The [Dapr Quickstarts](https://github.com/dapr/quickstarts/tree/v1.5.0) are a co
|
|||
| [Distributed Calculator](https://github.com/dapr/quickstarts/tree/v1.5.0/distributed-calculator) | Demonstrates a distributed calculator application that uses Dapr services to power a React web app. Highlights polyglot (multi-language) programming, service invocation and state management. |
|
||||
| [Pub/Sub](https://github.com/dapr/quickstarts/tree/v1.5.0/pub-sub) | Demonstrates how to use Dapr to enable pub-sub applications. Uses Redis as a pub-sub component. |
|
||||
| [Bindings](https://github.com/dapr/quickstarts/tree/v1.5.0/bindings) | Demonstrates how to use Dapr to create input and output bindings to other components. Uses bindings to Kafka. |
|
||||
| [Middleware](https://github.com/dapr/quickstarts/tree/v1.5.0/middleware) | Demonstrates use of Dapr middleware to enable OAuth 2.0 authorization. |
|
||||
| [Observability](https://github.com/dapr/quickstarts/tree/v1.5.0/observability) | Demonstrates Dapr tracing capabilities. Uses Zipkin as a tracing component. |
|
||||
| [Secret Store](https://github.com/dapr/quickstarts/tree/v1.5.0/secretstore) | Demonstrates the use of Dapr Secrets API to access secret stores. |
|
||||
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Set up a KiND cluster"
|
||||
linkTitle: "KiND"
|
||||
weight: 1100
|
||||
description: >
|
||||
How to set up Dapr on a KiND cluster.
|
||||
---
|
||||
|
||||
# Set up a KiND cluster
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Docker](https://docs.docker.com/install/)
|
||||
- [kubectl](https://kubernetes.io/docs/tasks/tools/)
|
||||
|
||||
> Note: For Windows, enable Virtualization in BIOS and [install Hyper-V](https://docs.microsoft.com/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v)
|
||||
|
||||
## Install and configure KiND
|
||||
|
||||
Make sure you follow one of the [Installation](https://kind.sigs.k8s.io/docs/user/quick-start) options for KiND.
|
||||
|
||||
In case you are using Docker Desktop, double-check that you have performed the recommended [settings](https://kind.sigs.k8s.io/docs/user/quick-start#settings-for-docker-desktop) (4 CPUs and 8 GiB of RAM available to Docker Engine).
|
||||
|
||||
## Configure and create the KiND cluster
|
||||
|
||||
1. Create a file named `kind-cluster-config.yaml`, and paste the following:
|
||||
```yaml
|
||||
kind: Cluster
|
||||
apiVersion: kind.x-k8s.io/v1alpha4
|
||||
nodes:
|
||||
- role: control-plane
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: InitConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
node-labels: "ingress-ready=true"
|
||||
extraPortMappings:
|
||||
- containerPort: 80
|
||||
hostPort: 8081
|
||||
protocol: TCP
|
||||
- containerPort: 443
|
||||
hostPort: 8443
|
||||
protocol: TCP
|
||||
- role: worker
|
||||
- role: worker
|
||||
```
|
||||
|
||||
This is going to request KiND to spin up a kubernetes cluster comprised of a control plane and two worker nodes. It also allows for future setup of ingresses and exposes container ports to the host machine.
|
||||
|
||||
2. Run the `kind create cluster` providing the cluster configuration file:
|
||||
|
||||
```bash
|
||||
kind create cluster --config kind-cluster-config.yaml
|
||||
```
|
||||
|
||||
Wait until the cluster is created, the output should look like this:
|
||||
|
||||
```md
|
||||
Creating cluster "kind" ...
|
||||
✓ Ensuring node image (kindest/node:v1.21.1) 🖼
|
||||
✓ Preparing nodes 📦 📦 📦
|
||||
✓ Writing configuration 📜
|
||||
✓ Starting control-plane 🕹️
|
||||
✓ Installing CNI 🔌
|
||||
✓ Installing StorageClass 💾
|
||||
✓ Joining worker nodes 🚜
|
||||
Set kubectl context to "kind-kind"
|
||||
You can now use your cluster with:
|
||||
|
||||
kubectl cluster-info --context kind-kind
|
||||
|
||||
Thanks for using kind! 😊
|
||||
```
|
||||
|
||||
## Dapr
|
||||
|
||||
1. Initialize Dapr:
|
||||
```bash
|
||||
dapr init --kubernetes
|
||||
```
|
||||
|
||||
Once Dapr finishes initializing its core components are ready to be used on the cluster.
|
||||
|
||||
To verify the status of these components run:
|
||||
```bash
|
||||
dapr status -k
|
||||
```
|
||||
the output should look like this:
|
||||
|
||||
```md
|
||||
NAME NAMESPACE HEALTHY STATUS REPLICAS VERSION AGE CREATED
|
||||
dapr-sentry dapr-system True Running 1 1.5.1 53s 2021-12-10 09:27.17
|
||||
dapr-operator dapr-system True Running 1 1.5.1 53s 2021-12-10 09:27.17
|
||||
dapr-sidecar-injector dapr-system True Running 1 1.5.1 53s 2021-12-10 09:27.17
|
||||
dapr-dashboard dapr-system True Running 1 0.9.0 53s 2021-12-10 09:27.17
|
||||
dapr-placement-server dapr-system True Running 1 1.5.1 52s 2021-12-10 09:27.18
|
||||
```
|
||||
|
||||
2. Forward a port to [Dapr dashboard](https://docs.dapr.io/reference/cli/dapr-dashboard/):
|
||||
|
||||
```bash
|
||||
dapr dashboard -k -p 9999
|
||||
```
|
||||
|
||||
So that you can validate that the setup finished successfully by navigating to `http://localhost:9999`.
|
||||
|
||||
## Next steps
|
||||
- [Try out a Dapr quickstart]({{< ref quickstarts.md >}})
|
||||
|
|
@ -87,8 +87,9 @@ helm search repo dapr --devel --versions
|
|||
# create a values file to store variables
|
||||
touch values.yml
|
||||
cat << EOF >> values.yml
|
||||
global.ha.enabled: true
|
||||
|
||||
global:
|
||||
ha:
|
||||
enabled: true
|
||||
EOF
|
||||
|
||||
# run install/upgrade
|
||||
|
|
|
@ -95,9 +95,14 @@ After announcing a future breaking change, the change will happen in 2 releases
|
|||
## Upgrade on Hosting platforms
|
||||
Dapr can support multiple hosting platforms for production. With the 1.0 release the two supported platforms are Kubernetes and physical machines. For Kubernetes upgrades see [Production guidelines on Kubernetes]({{< ref kubernetes-production.md >}})
|
||||
|
||||
### Supported Kubernetes versions
|
||||
### Supported versions of dependencies
|
||||
Below is a list of software that the latest version of Dapr (v{{% dapr-latest-version long="true" %}}) has been tested against.
|
||||
|
||||
Dapr follows [Kubernetes Version Skew Policy](https://kubernetes.io/releases/version-skew-policy).
|
||||
| Dependency | Supported Version |
|
||||
|-----------------------|----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Kubernetes | Dapr support for Kubernetes is aligned with [Kubernetes Version Skew Policy](https://kubernetes.io/releases/version-skew-policy/) |
|
||||
| [Open Telemetry collector (OTEL)](https://github.com/open-telemetry/opentelemetry-collector/releases)| v0.4.0|
|
||||
| [Prometheus](https://prometheus.io/download/) | v2.28 |
|
||||
|
||||
## Related links
|
||||
* Read the [Versioning policy]({{< ref support-versioning.md >}})
|
||||
|
|
|
@ -64,6 +64,32 @@ In order to further diagnose any issue, check the logs of the Dapr sidecar injec
|
|||
|
||||
*Note: If you installed Dapr to a different namespace, replace dapr-system above with the desired namespace*
|
||||
|
||||
If you are deploying Dapr on Amazon EKS and using an overlay network such as Calico, you will need to set `hostNetwork` parameter to true, this is a limitation of EKS with such CNIs.
|
||||
|
||||
You can set this parameter using Helm `values.yaml` file:
|
||||
|
||||
```
|
||||
helm upgrade --install dapr dapr/dapr \
|
||||
--namespace dapr-system \
|
||||
--create-namespace \
|
||||
--values values.yaml
|
||||
```
|
||||
|
||||
`values.yaml`
|
||||
```yaml
|
||||
dapr_sidecar_injector:
|
||||
hostNetwork: true
|
||||
```
|
||||
|
||||
or using command line:
|
||||
|
||||
```
|
||||
helm upgrade --install dapr dapr/dapr \
|
||||
--namespace dapr-system \
|
||||
--create-namespace \
|
||||
--set dapr_sidecar_injector.hostNetwork=true
|
||||
```
|
||||
|
||||
## My pod is in CrashLoopBackoff or another failed state due to the daprd sidecar
|
||||
|
||||
If the Dapr sidecar (`daprd`) is taking too long to initialize, this might be surfaced as a failing health check by Kubernetes.
|
||||
|
|
|
@ -74,7 +74,7 @@ spec:
|
|||
## Related links
|
||||
|
||||
- [Configure API authorization with OAuth]({{< ref oauth >}})
|
||||
- [Middleware OAuth quickstart](https://github.com/dapr/quickstarts/tree/master/middleware)
|
||||
- [Middleware OAuth sample (interactive)](https://github.com/dapr/samples/tree/master/middleware-oauth-google)
|
||||
- [Middleware]({{< ref middleware.md >}})
|
||||
- [Configuration concept]({{< ref configuration-concept.md >}})
|
||||
- [Configuration overview]({{< ref configuration-overview.md >}})
|
||||
|
|
|
@ -24,7 +24,7 @@ Table captions:
|
|||
|-------------------------------------------------------|--------| -----| ------------- |
|
||||
| [Apache Kafka]({{< ref setup-apache-kafka.md >}}) | Stable | v1 | 1.5 |
|
||||
| [Hazelcast]({{< ref setup-hazelcast.md >}}) | Alpha | v1 | 1.0 |
|
||||
| [MQTT]({{< ref setup-mqtt.md >}}) | Alpha | v1 | 1.0 |
|
||||
| [MQTT]({{< ref setup-mqtt.md >}}) | Beta | v1 | 1.6 |
|
||||
| [NATS Streaming]({{< ref setup-nats-streaming.md >}}) | Beta | v1 | 1.0 |
|
||||
| [In Memory]({{< ref setup-inmemory.md >}}) | Alpha | v1 | 1.4 |
|
||||
| [JetStream]({{< ref setup-jetstream.md >}}) | Alpha | v1 | 1.4 |
|
||||
|
@ -35,8 +35,8 @@ Table captions:
|
|||
### Amazon Web Services (AWS)
|
||||
|
||||
| Name | Status | Component version | Since |
|
||||
|---------------------------------------------------|--------| ---- |---------------|
|
||||
| [AWS SNS/SQS]({{< ref setup-aws-snssqs.md >}}) | Alpha | v1 | 1.0 |
|
||||
|---------------------------------------------------|--------| ---- | --------------|
|
||||
| [AWS SNS/SQS]({{< ref setup-aws-snssqs.md >}}) | Beta | v1 | 1.6 |
|
||||
|
||||
### Google Cloud Platform (GCP)
|
||||
|
||||
|
|
|
@ -26,16 +26,35 @@ spec:
|
|||
value: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
|
||||
- name: region
|
||||
value: "us-east-1"
|
||||
- name: sessionToken
|
||||
value: "TOKEN"
|
||||
- name: messageVisibilityTimeout
|
||||
value: 10
|
||||
- name: messageRetryLimit
|
||||
value: 10
|
||||
- name: messageWaitTimeSeconds
|
||||
value: 1
|
||||
- name: messageMaxNumber
|
||||
value: 10
|
||||
# - name: endpoint # Optional.
|
||||
# value: "http://localhost:4566"
|
||||
# - name: sessionToken # Optional (mandatory if using AssignedRole, i.e. temporary accessKey and secretKey)
|
||||
# value: "TOKEN"
|
||||
# - name: messageVisibilityTimeout # Optional
|
||||
# value: 10
|
||||
# - name: messageRetryLimit # Optional
|
||||
# value: 10
|
||||
# - name: messageReceiveLimit # Optional
|
||||
# value: 10
|
||||
# - name: sqsDeadLettersQueueName # Optional
|
||||
# - value: "myapp-dlq"
|
||||
# - name: messageWaitTimeSeconds # Optional
|
||||
# value: 1
|
||||
# - name: messageMaxNumber # Optional
|
||||
# value: 10
|
||||
# - name: fifo # Optional
|
||||
# value: "true"
|
||||
# - name: fifoMessageGroupID # Optional
|
||||
# value: "app1-mgi"
|
||||
# - name: disableEntityManagement # Optional
|
||||
# value: "false"
|
||||
# - name: disableDeleteOnRetryLimit # Optional
|
||||
# value: "false"
|
||||
# - name: assetsManagementTimeoutSeconds # Optional
|
||||
# value: 5
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
{{% alert title="Warning" color="warning" %}}
|
||||
|
@ -46,22 +65,42 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
|||
|
||||
| Field | Required | Details | Example |
|
||||
|--------------------|:--------:|---------|---------|
|
||||
| accessKey | Y | ID of the AWS account with appropriate permissions to SNS and SQS. Can be `secretKeyRef` to use a secret reference | `"AKIAIOSFODNN7EXAMPLE"`
|
||||
| secretKey | Y | Secret for the AWS user. Can be `secretKeyRef` to use a secret reference |`"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"`
|
||||
| region | Y | The AWS region to the instance. See this page for valid regions: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html. Ensure that SNS and SQS are available in that region.| `"us-east-1"`
|
||||
| endpoint | N |AWS endpoint for the component to use. Only used for local development. The `endpoint` is unncessary when running against production AWS | `"http://localhost:4566"`
|
||||
| sessionToken | N |AWS session token to use. A session token is only required if you are using temporary security credentials | `"TOKEN"`
|
||||
| messageVisibilityTimeout | N |Amount of time in seconds that a message is hidden from receive requests after it is sent to a subscriber. Default: `10` | `10`
|
||||
| messageRetryLimit | N |Number of times to resend a message after processing of that message fails before removing that message from the queue. Default: `10` | `10`
|
||||
| messageWaitTimeSeconds | N |amount of time to await receipt of a message before making another request. Default: `1` | `1`
|
||||
| messageMaxNumber | N |maximum number of messages to receive from the queue at a time. Default: `10`, Maximum: `10` | `10`
|
||||
| accessKey | Y | ID of the AWS account/role with appropriate permissions to SNS and SQS (see below) | `"AKIAIOSFODNN7EXAMPLE"`
|
||||
| secretKey | Y | Secret for the AWS user/role. If using an `AssumeRole` access, you will also need to provide a `sessionToken` |`"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"`
|
||||
| region | Y | The AWS region where the SNS/SQS assets are located or be created in. See [this page](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/?p=ugi&l=na) for valid regions. Ensure that SNS and SQS are available in that region | `"us-east-1"`
|
||||
| endpoint | N | AWS endpoint for the component to use. Only used for local development with, for example, [localstack](https://github.com/localstack/localstack). The `endpoint` is unncessary when running against production AWS | `"http://localhost:4566"`
|
||||
| sessionToken | N | AWS session token to use. A session token is only required if you are using temporary security credentials | `"TOKEN"`
|
||||
| messageReceiveLimit | N | Number of times a message is received, after processing of that message fails, that once reached, results in removing of that message from the queue. If `sqsDeadLettersQueueName` is specified, `messageReceiveLimit` is the number of times a message is received, after processing of that message fails, that once reached, results in moving of the message to the SQS dead-letters queue. Default: `10` | `10`
|
||||
| sqsDeadLettersQueueName | N | Name of the dead letters queue for this application | `"myapp-dlq"`
|
||||
| messageVisibilityTimeout | N | Amount of time in seconds that a message is hidden from receive requests after it is sent to a subscriber. Default: `10` | `10`
|
||||
| messageRetryLimit | N | Number of times to resend a message after processing of that message fails before removing that message from the queue. Default: `10` | `10`
|
||||
| messageWaitTimeSeconds | N | The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than `messageWaitTimeSeconds`. If no messages are available and the wait time expires, the call returns successfully with an empty list of messages. Default: `1` | `1`
|
||||
| messageMaxNumber | N | Maximum number of messages to receive from the queue at a time. Default: `10`, Maximum: `10` | `10`
|
||||
| fifo | N | Use SQS FIFO queue to provide message ordering and deduplication. Default: `"false"`. See further details about [SQS FIFO](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) | `"true"`, `"false"`
|
||||
| fifoMessageGroupID | N | If `fifo` is enabled, instructs Dapr to use a custom [Message Group ID](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) for the pubsub deployment. This is not mandatory as Dapr creates a custom Message Group ID for each producer, thus ensuring ordering of messages per a Dapr producer. Default: `""` | `"app1-mgi"`
|
||||
| disableEntityManagement | N | When set to true, SNS topics, SQS queues and the SQS subscriptions to SNS do not get created automatically. Default: `"false"` | `"true"`, `"false"`
|
||||
| disableDeleteOnRetryLimit | N | When set to true, after retrying and failing of `messageRetryLimit` times processing a message, reset the message visibility timeout so that other consumers can try processing, instead of deleting the message from SQS (the default behvior). Default: `"false"` | `"true"`, `"false"`
|
||||
| assetsManagementTimeoutSeconds | N | Amount of time in seconds, for an AWS asset management operation, before it times out and cancelled. Asset management operations are any operations performed on STS, SNS and SQS, except message publish and consume operations that implement the default Dapr component retry behavior. The value can be set to any non-negative float/integer. Default: `5` | `0.5`, `10`
|
||||
|
||||
|
||||
* Dapr created SNS topic and SQS queue names conform with [AWS specifications](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-queues.html). By default, Dapr creates an SQS queue name based on the consumer `app-id`, therefore Dapr might perform name standardization to meet with AWS specifications.
|
||||
* Using SQS FIFO (`fifo` metadata field set to `"true"`), per AWS specifications, provides message ordering and deduplication, but incurs a lower SQS processing throughput, among other caveats
|
||||
* Be aware that specifying `fifoMessageGroupID` limits the number of concurrent consumers of the FIFO queue used to only one but guarantees global ordering of messages published by the app's Dapr sidecars. See [this](https://aws.amazon.com/blogs/compute/solving-complex-ordering-challenges-with-amazon-sqs-fifo-queues/) post to better understand the topic of Message Group IDs and FIFO queues.
|
||||
|
||||
|
||||
|
||||
## Create an SNS/SQS instance
|
||||
|
||||
{{< tabs "Self-Hosted" "Kubernetes" "AWS" >}}
|
||||
|
||||
{{% codetab %}}
|
||||
For local development the [localstack project](https://github.com/localstack/localstack) is used to integrate AWS SNS/SQS. Follow the instructions [here](https://github.com/localstack/localstack#installing) to install the localstack CLI.
|
||||
For local development the [localstack project](https://github.com/localstack/localstack) is used to integrate AWS SNS/SQS. Follow the instructions [here](https://github.com/localstack/localstack#running) to run localstack.
|
||||
|
||||
To run localstack locally from the command line using Docker, apply the following cmd:
|
||||
```shell
|
||||
docker run --rm -it -p 4566:4566 -p 4571:4571 -e SERVICES="sts,sns,sqs" -e AWS_DEFAULT_REGION="us-east-1" localstack/localstack
|
||||
```
|
||||
|
||||
|
||||
In order to use localstack with your pubsub binding, you need to provide the `endpoint` configuration
|
||||
in the component metadata. The `endpoint` is unncessary when running against production AWS.
|
||||
|
@ -77,9 +116,13 @@ spec:
|
|||
type: pubsub.snssqs
|
||||
version: v1
|
||||
metadata:
|
||||
- name: accessKey
|
||||
value: "anyString"
|
||||
- name: secretKey
|
||||
value: "anyString"
|
||||
- name: endpoint
|
||||
value: http://localhost:4566
|
||||
# Use us-east-1 for localstack
|
||||
# Use us-east-1 or any other region if provided to localstack as defined by "AWS_DEFAULT_REGION" envvar
|
||||
- name: region
|
||||
value: us-east-1
|
||||
```
|
||||
|
@ -133,8 +176,71 @@ spec:
|
|||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
In order to run in AWS, you should create an IAM user with permissions to the SNS and SQS services.
|
||||
In order to run in AWS, you should create or assign an IAM user with permissions to the SNS and SQS services having a Policy such as:
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "YOUR_POLICY_NAME",
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"sqs:CreateQueue",
|
||||
"sqs:DeleteMessage",
|
||||
"sqs:ReceiveMessage",
|
||||
"sqs:ChangeMessageVisibility",
|
||||
"sqs:GetQueueUrl",
|
||||
"sqs:GetQueueAttributes",
|
||||
"sqs:SetQueueAttributes",
|
||||
"sns:CreateTopic",
|
||||
"sns:ListSubscriptionsByTopic",
|
||||
"sns:Publish",
|
||||
"sns:Subscribe",
|
||||
"sns:ListSubscriptionsByTopic",
|
||||
"sns:GetTopicAttributes"
|
||||
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:sns:AWS_REGION:AWS_ACCOUNT_ID:*",
|
||||
"arn:aws:sqs:AWS_REGION:AWS_ACCOUNT_ID:*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Use the `AWS account ID` and `AWS account secret` and plug them into the `accessKey` and `secretKey` in the component metadata using Kubernetes secrets and `secretKeyRef`.
|
||||
|
||||
|
||||
Alternatively, if you want to provision the SNS and SQS assets using your own tool of choice (e.g. Terraform), while preventing Dapr from doing so dynamically, you need to enable `disableEntityManagement` and assign your Dapr-using application with an IAM Role having a Policy such as:
|
||||
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "YOUR_POLICY_NAME",
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"sqs:DeleteMessage",
|
||||
"sqs:ReceiveMessage",
|
||||
"sqs:ChangeMessageVisibility",
|
||||
"sqs:GetQueueUrl",
|
||||
"sqs:GetQueueAttributes",
|
||||
"sns:Publish",
|
||||
"sns:ListSubscriptionsByTopic",
|
||||
"sns:GetTopicAttributes"
|
||||
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:sns:AWS_REGION:AWS_ACCOUNT_ID:APP_TOPIC_NAME",
|
||||
"arn:aws:sqs:AWS_REGION:AWS_ACCOUNT_ID:APP_ID"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
If you are running your applications on an EKS cluster with dynamic assets creation (the default Dapr behavior)
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
|
|
@ -24,14 +24,35 @@ spec:
|
|||
value: "localhost:6650"
|
||||
- name: enableTLS
|
||||
value: "false"
|
||||
```
|
||||
- name: tenant
|
||||
value: "public"
|
||||
- name: namespace
|
||||
value: "default"
|
||||
- name: persistent
|
||||
value: "true"
|
||||
- name: backOffPolicy
|
||||
value: "constant"
|
||||
- name: backOffMaxRetries
|
||||
value: "-1"
|
||||
|
||||
```
|
||||
## Spec metadata fields
|
||||
|
||||
| Field | Required | Details | Example |
|
||||
|--------------------|:--------:|---------|---------|
|
||||
| host | Y | Address of the Pulsar broker. Default is `"localhost:6650"` | `"localhost:6650"`|
|
||||
| enableTLS | N | Enable TLS. Default: `"false"` | `"true"`, `"false"`|
|
||||
| host | Y | Address of the Pulsar broker. Default is `"localhost:6650"` | `"localhost:6650"`
|
||||
| enableTLS | N | Enable TLS. Default: `"false"` | `"true"`, `"false"`
|
||||
| tenant | N | The topic tenant within the instance. Tenants are essential to multi-tenancy in Pulsar, and spread across clusters. Default: `"public"` | `"public"`
|
||||
| namespace | N | The administrative unit of the topic, which acts as a grouping mechanism for related topics. Default: `"default"` | `"default"`
|
||||
| persistent | N | Pulsar supports two kind of topics: [persistent](https://pulsar.apache.org/docs/en/concepts-architecture-overview#persistent-storage) and [non-persistent](https://pulsar.apache.org/docs/en/concepts-messaging/#non-persistent-topics). With persistent topics, all messages are durably persisted on disks (if the broker is not standalone, messages are durably persisted on multiple disks), whereas data for non-persistent topics is not persisted to storage disks. Note: the default retry behavior is to retry until it succeeds, so when you use a non-persistent theme, you can reduce or prohibit retries by defining `backOffMaxRetries` to `0`. Default: `"true"` | `"true"`, `"false"`
|
||||
| backOffPolicy | N | Retry policy, `"constant"` is a backoff policy that always returns the same backoff delay. `"exponential"` is a backoff policy that increases the backoff period for each retry attempt using a randomization function that grows exponentially. Defaults to `"constant"`. | `constant`、`exponential` |
|
||||
| backOffDuration | N | The fixed interval only takes effect when the `backOffPolicy` is `"constant"`. There are two valid formats, one is the fraction with a unit suffix format, and the other is the pure digital format that is processed as milliseconds. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". Defaults to `"5s"`. | `"5s"`、`"5000"` |
|
||||
| backOffInitialInterval | N | The backoff initial interval on retry. Only takes effect when the `backOffPolicy` is `"exponential"`. There are two valid formats, one is the fraction with a unit suffix format, and the other is the pure digital format that is processed as milliseconds. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". Defaults to `"500"` | `"50"` |
|
||||
| backOffMaxInterval | N | The backoff initial interval on retry. Only takes effect when the `backOffPolicy` is `"exponential"`. There are two valid formats, one is the fraction with a unit suffix format, and the other is the pure digital format that is processed as milliseconds. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". Defaults to `"60s"` | `"60000"` |
|
||||
| backOffMaxRetries | N | The maximum number of retries to process the message before returning an error. Defaults to `"0"` which means the component will not retry processing the message. `"-1"` will retry indefinitely until the message is processed or the application is shutdown. Any positive number is treated as the maximum retry count. | `"3"` |
|
||||
| backOffRandomizationFactor | N | Randomization factor, between 1 and 0, including 0 but not 1. Randomized interval = RetryInterval * (1 ± backOffRandomizationFactor). Defaults to `"0.5"`. | `"0.5"` |
|
||||
| backOffMultiplier | N | Backoff multiplier for the policy. Increments the interval by multiplying it with the multiplier. Defaults to `"1.5"` | `"1.5"` |
|
||||
| backOffMaxElapsedTime | N | After MaxElapsedTime the ExponentialBackOff returns Stop. There are two valid formats, one is the fraction with a unit suffix format, and the other is the pure digital format that is processed as milliseconds. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". Defaults to `"15m"` | `"15m"` |
|
||||
|
||||
|
||||
### Delay queue
|
||||
|
|
|
@ -46,3 +46,9 @@ Table captions:
|
|||
| Name | Status | Component version | Since |
|
||||
|---------------------------------------------------------------------------------------|--------| ---- |--------------|
|
||||
| [Azure Key Vault]({{< ref azure-keyvault.md >}}) | Stable | v1 | 1.0 |
|
||||
|
||||
### Alibaba Cloud
|
||||
|
||||
| Name | Status | Component version | Since |
|
||||
|---------------------------------------------------------------------------------------|--------| ---- |--------------|
|
||||
| [AlibabaCloud OOS Parameter Store]({{< ref alicloud-oos-parameter-store.md >}}) | Alpha | v1 | 1.6 |
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
type: docs
|
||||
title: "AlibabaCloud OOS Parameter Store"
|
||||
linkTitle: "AlibabaCloud OOS Parameter Store"
|
||||
description: Detailed information on the AlibabaCloud OOS Parameter Store - secret store component
|
||||
aliases:
|
||||
- "/operations/components/setup-secret-store/supported-secret-stores/alibabacloud-oos-parameter-store/"
|
||||
---
|
||||
|
||||
## Component format
|
||||
|
||||
To setup AlibabaCloud OOS Parameter Store secret store create a component of type `secretstores.alicloud.parameterstore`. See [this guide]({{< ref "setup-secret-store.md#apply-the-configuration" >}}) on how to create and apply a secretstore configuration. See this guide on [referencing secrets]({{< ref component-secrets.md >}}) to retrieve and use the secret with Dapr components.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: alibabacloudparameterstore
|
||||
namespace: default
|
||||
spec:
|
||||
type: secretstores.alicloud.parameterstore
|
||||
version: v1
|
||||
metadata:
|
||||
- name: regionId
|
||||
value: "[alicloud_region_id]"
|
||||
- name: accessKeyId
|
||||
value: "[alicloud_access_key_id]"
|
||||
- name: accessKeySecret
|
||||
value: "[alicloud_access_key_secret]"
|
||||
- name: securityToken
|
||||
value: "[alicloud_security_token]"
|
||||
```
|
||||
|
||||
{{% alert title="Warning" color="warning" %}}
|
||||
The above example uses secrets as plain strings. It is recommended to use a local secret store such as [Kubernetes secret store]({{< ref kubernetes-secret-store.md >}}) or a [local file]({{< ref file-secret-store.md >}}) to bootstrap secure key storage.
|
||||
{{% /alert %}}
|
||||
|
||||
## Spec metadata fields
|
||||
|
||||
| Field | Required | Details | Example |
|
||||
|--------------------|:--------:|-------------------------------------------------------------------------|---------------------|
|
||||
| regionId | Y | The specific region the AlibabaCloud OOS Parameter Store instance is deployed in | `"cn-hangzhou"` |
|
||||
| accessKeyId | Y | The AlibabaCloud Access Key ID to access this resource | `"accessKeyId"` |
|
||||
| accessKeySecret | Y | The AlibabaCloud Access Key Secret to access this resource | `"accessKeySecret"` |
|
||||
| securityToken | N | The AlibabaCloud Security Token to use | `"securityToken"` |
|
||||
|
||||
## Create an AlibabaCloud OOS Parameter Store instance
|
||||
|
||||
Setup AlibabaCloud OOS Parameter Store using the AlibabaCloud documentation: https://www.alibabacloud.com/help/en/doc-detail/186828.html.
|
||||
|
||||
## Related links
|
||||
|
||||
- [Secrets building block]({{< ref secrets >}})
|
||||
- [How-To: Retrieve a secret]({{< ref "howto-secrets.md" >}})
|
||||
- [How-To: Reference secrets in Dapr components]({{< ref component-secrets.md >}})
|
||||
- [Secrets API reference]({{< ref secrets_api.md >}})
|
|
@ -60,3 +60,9 @@ The following stores are supported, at various levels, by the Dapr state managem
|
|||
| [Azure CosmosDB]({{< ref setup-azure-cosmosdb.md >}}) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | Stable | v1 | 1.0 |
|
||||
| [Azure SQL Server]({{< ref setup-sqlserver.md >}}) | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | Stable | v1 | 1.5 |
|
||||
| [Azure Table Storage]({{< ref setup-azure-tablestorage.md >}}) | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
|
||||
### Oracle Cloud Infrastructure (OCI)
|
||||
|
||||
| Name |CRUD|Transactional|ETag| [TTL]({{< ref state-store-ttl.md >}}) | [Actors]({{< ref howto-actors.md >}}) | [Query]({{< ref howto-state-query-api.md >}}) | Status | Component version | Since |
|
||||
|------------------------------------------------------------------|----|-------------|----|----|----|----|-------|----|-----|
|
||||
| [OCI Object Storage]({{< ref setup-oci-objectstorage.md >}}) | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | Alpha | v1 | 1.6 |
|
||||
|
|
|
@ -0,0 +1,193 @@
|
|||
---
|
||||
type: docs
|
||||
title: "OCI Object Storage "
|
||||
linkTitle: "OCI Object Storage "
|
||||
description: Detailed information on the OCI Object Storage state store component
|
||||
aliases:
|
||||
- "/operations/components/setup-state-store/supported-state-stores/setup-oci-objectstorage/"
|
||||
---
|
||||
|
||||
## Component format
|
||||
|
||||
To setup OCI Object Storage state store create a component of type `state.oci.objectstorage`. See [this guide]({{< ref "howto-get-save-state.md#step-1-setup-a-state-store" >}}) on how to create and apply a state store configuration.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: <NAME>
|
||||
namespace: <NAMESPACE>
|
||||
spec:
|
||||
type: state.oci.objectstorage
|
||||
version: v1
|
||||
metadata:
|
||||
- name: instancePrincipalAuthentication
|
||||
value: <"true" or "false"> # Optional. default: "false"
|
||||
- name: configFileAuthentication
|
||||
value: <"true" or "false"> # Optional. default: "false" . Not used when instancePrincipalAuthentication == "true"
|
||||
- name: configFilePath
|
||||
value: <REPLACE-WITH-FULL-QUALIFIED-PATH-OF-CONFIG-FILE> # Optional. default: the operating system specific default location for the OCI config file; on Linux: "~/.oci/config" . Only used when configFileAuthentication == "true"
|
||||
- name: configFileProfile
|
||||
value: <REPLACE-WITH-NAME-OF-PROFILE-IN-CONFIG-FILE> # Optional. default: "DEFAULT" . Only used when configFileAuthentication == "true"
|
||||
- name: tenancyOCID
|
||||
value: <REPLACE-WITH-TENANCY-OCID> # Not used when configFileAuthentication == "true" or instancePrincipalAuthentication == "true"
|
||||
- name: userOCID
|
||||
value: <REPLACE-WITH-USER-OCID> # Not used when configFileAuthentication == "true" or instancePrincipalAuthentication == "true"
|
||||
- name: fingerPrint
|
||||
value: <REPLACE-WITH-FINGERPRINT> # Not used when configFileAuthentication == "true" or instancePrincipalAuthentication == "true"
|
||||
- name: privateKey # Not used when configFileAuthentication == "true" or instancePrincipalAuthentication == "true"
|
||||
value: |
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
REPLACE-WIH-PRIVATE-KEY-AS-IN-PEM-FILE
|
||||
-----END RSA PRIVATE KEY-----
|
||||
- name: region
|
||||
value: <REPLACE-WITH-OCI-REGION> # Not used when configFileAuthentication == "true" or instancePrincipalAuthentication == "true"
|
||||
- name: bucketName
|
||||
value: <REPLACE-WITH-BUCKET-NAME>
|
||||
- name: compartmentOCID
|
||||
value: <REPLACE-WITH-COMPARTMENT-OCID>
|
||||
|
||||
```
|
||||
|
||||
{{% 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 %}}
|
||||
|
||||
## Spec metadata fields
|
||||
|
||||
| Field | Required | Details | Example |
|
||||
|--------------------|:--------:|---------|---------|
|
||||
| instancePrincipalAuthentication | N | Boolean to indicate whether instance principal based authentication is used. Default: `"false"` | `"true"` or `"false"` .
|
||||
| configFileAuthentication | N | Boolean to indicate whether identity credential details are provided through a configuration file. Default: `"false"` Not required nor used when instancePrincipalAuthentication is true. | `"true"` or `"false"` .
|
||||
| configFilePath | N | Full path name to the OCI configuration file. Default: the default location on your operating system for the OCI confile file, for example `"~/.oci/config"` on Linux. Not used when instancePrincipalAuthentication is true. | `"/home/apps/configuration-files/myOCIConfig.txt"`.
|
||||
| configFileProfile | N | Name of profile in configuration file to use. Default: `"DEFAULT"` Not used when instancePrincipalAuthentication is true. | `"DEFAULT"` or `"PRODUCTION"` .
|
||||
| tenancyOCID | Y | The OCI tenancy identifier. Not required nor used when instancePrincipalAuthentication is true. | `"ocid1.tenancy.oc1..aaaaaaaag7c7sljhsdjhsdyuwe723"`.
|
||||
| userOCID | Y | The OCID for an OCI account (this account requires permissions to access OCI Object Storage). Not required nor used when instancePrincipalAuthentication is true.| `"ocid1.user.oc1..aaaaaaaaby4oyyyuqwy7623yuwe76"`
|
||||
| fingerPrint | Y | Fingerprint of the public key. Not required nor used when instancePrincipalAuthentication is true. | `"02:91:6c:49:e2:94:21:15:a7:6b:0e:a7:34:e1:3d:1b"`
|
||||
| privateKey | Y | Private key of the RSA key pair. Not required nor used when instancePrincipalAuthentication is true. | `"MIIEoyuweHAFGFG2727as+7BTwQRAIW4V"`
|
||||
| region | Y | OCI Region. Not required nor used when instancePrincipalAuthentication is true. | `"us-ashburn-1"`
|
||||
| bucketName | Y | Name of the bucket written to and read from (and if necessary created) | `"application-state-store-bucket"`
|
||||
| compartmentOCID | Y | The OCID for the compartment that contains the bucket | `"ocid1.compartment.oc1..aaaaaaaacsssekayyuq7asjh78"`
|
||||
|
||||
## Setup OCI Object Storage
|
||||
The OCI Object Storage state store needs to interact with Oracle Cloud Infrastructure. The state store supports two different approaches to authentication. One is based on an identity (a user or service account) and the other is instance principal authentication leveraging the permissions granted to the compute instance running the application workload. Note: Resource Principal Authentication - used for resources that are not instances such as serverless functions - is not currently supported.
|
||||
|
||||
Dapr-applications running on Oracle Cloud Infrastructure - in a compute instance or as a container on Kubernetes - can leverage instance principal authentication. See the [OCI documentation on calling OCI Services from instances](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm) for more background. In short: The instance needs to be member of a Dynamic Group and this Dynamic Group needs to get permissions for interacting with the Object Storage service through IAM policies. In case of such instance principal authentication, specify property instancePrincipalAuthentication as `"true"`. You do not need to configure the properties tenancyOCID, userOCID, region, fingerPrint and privateKey - these will be ignored if you define values for them.
|
||||
|
||||
Identity based authentication interacts with OCI through an OCI account that has permissions to create, read and delete objects through OCI Object Storage in the indicated bucket and that is allowed to create a bucket in the specified compartment if the bucket is not created beforehand. The OCI documentation [describes how to create an OCI Account](https://docs.oracle.com/en-us/iaas/Content/GSG/Tasks/addingusers.htm#Adding_Users). The interaction by the state store is performed using the public key's fingerprint and a private key from an RSA Key Pair generated for the OCI account. The [instructions for generating the key pair and getting hold of the required information](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm) are available in the OCI documentation.
|
||||
|
||||
Details for the identity and identity's credentials to be used for interaction with OCI can be provided directly in the Dapr component properties file - using the properties tenancyOCID, userOCID, fingerPrint, privateKey and region - or can be provided from a configuration file as is common for many OCI related tools (such as CLI and Terraform) and SDKs. In the latter case, a default configuration file can be assumed (such as ~/.oci/config on Linux) or the exact file name and path can be provided through property configFilePath. A configuration file can contain multiple profiles; the desired profile can be specified through property configFileProfile. If no value is provided, DEFAULT is used as the name for the profile to be used. Note: if the indicated profile is not found, then the DEFAULT profile (if it exists) is used instead. The OCI SDK documentation gives [details about the definition of the configuration file](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm).
|
||||
|
||||
If you wish to create the bucket for Dapr to use, you can do so beforehand. However, Object Storage state provider will create one - in the specified compartment - for you automatically if it doesn't exist.
|
||||
|
||||
In order to setup OCI Object Storage as a state store, you need the following properties:
|
||||
- **instancePrincipalAuthentication**: The flag that indicates if instance principal based authentication should be used.
|
||||
- **configFileAuthentication**: The flag that indicates if the OCI identity credential details are provided through a configuration file. Not used when **instancePrincipalAuthentication** is true.
|
||||
- **configFilePath**: Full path name to the OCI configuration file. Not used when **instancePrincipalAuthentication** is true or **configFileAuthentication** is not true.
|
||||
- **configFileProfile**: Name of profile in configuration file to use. Default: `"DEFAULT"` Not required nor used when instancePrincipalAuthentication is true or **configFileAuthentication** is not true. When the specified profile is not found in the configuration file, the DEFAULT profile is used when it exists
|
||||
- **tenancyOCID**: The identifier for the OCI cloud tenancy in which the state is to be stored. Not used when **instancePrincipalAuthentication** is true or **configFileAuthentication** is true.
|
||||
- **userOCID**: The identifier for the account used by the state store component to connect to OCI; this must be an account with appropriate permissions on the OCI Object Storage service in the specified compartment and bucket. Not used when **instancePrincipalAuthentication** is true or **configFileAuthentication** is true.
|
||||
- **fingerPrint**: The fingerprint for the public key in the RSA key pair generated for the account indicated by **userOCID**. Not used when **instancePrincipalAuthentication** is true or **configFileAuthentication** is true.
|
||||
- **privateKey**: The private key in the RSA key pair generated for the account indicated by **userOCID**. Not used when **instancePrincipalAuthentication** is true or **configFileAuthentication** is true.
|
||||
- **region**: The OCI region - for example **us-ashburn-1**, **eu-amsterdam-1**, **ap-mumbai-1**. Not used when **instancePrincipalAuthentication** is true
|
||||
- **bucketName**: The name of the bucket on OCI Object Storage in which state will be created. This bucket can exist already when the state store is initialized or it will be created during initialization of the state store. Note that the name of buckets is unique within a namespace
|
||||
- **compartmentOCID**: The identifier of the compartment within the tenancy in which the bucket exists or will be created.
|
||||
|
||||
|
||||
## What Happens at Runtime?
|
||||
|
||||
Every state entry is represented by an object in OCI Object Storage. The OCI Object Storage state store uses the `key` property provided in the requests to the Dapr API to determine the name of the object. The `value` is stored as the (literal) content of the object. Each object is assigned a unique ETag value - whenever it is created or updated (aka overwritten); this is native behavior of OCI Object Storage. The state store assigns a meta data tag to every object it writes; the tag is __category__ and its value is __dapr-state-store__. This allows the objects created as state for Daprized applications to be identified.
|
||||
|
||||
For example, the following operation
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3500/v1.0/state \
|
||||
-H "Content-Type: application/json"
|
||||
-d '[
|
||||
{
|
||||
"key": "nihilus",
|
||||
"value": "darth"
|
||||
}
|
||||
]'
|
||||
```
|
||||
|
||||
creates the following object:
|
||||
|
||||
| Bucket | Directory | Object Name | Object Content | Meta Tags |
|
||||
| ------------ | ------- | ----- | ----- | ---- |
|
||||
| as specified with **bucketName** in components.yaml | - (root) | nihilus | darth | category: dapr-state-store
|
||||
|
||||
|
||||
Dapr uses a fixed key scheme with *composite keys* to partition state across applications. For general states, the key format is:
|
||||
`App-ID||state key`
|
||||
The OCI Object Storage state store maps the first key segment (for App-ID) to a directory within a bucket, using the [Prefixes and Hierarchy used for simulating a directory structure as described in the OCI Object Storage documentation](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/managingobjects.htm#nameprefix).
|
||||
|
||||
The following operation therefore (notice the composite key)
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3500/v1.0/state \
|
||||
-H "Content-Type: application/json"
|
||||
-d '[
|
||||
{
|
||||
"key": "myApplication||nihilus",
|
||||
"value": "darth"
|
||||
}
|
||||
]'
|
||||
```
|
||||
|
||||
will create the following object:
|
||||
|
||||
| Bucket | Directory | Object Name | Object Content | Meta Tags |
|
||||
| ------------ | ------- | ----- | ----- | ---- |
|
||||
| as specified with **bucketName** in components.yaml | myApplication | nihilus | darth | category: dapr-state-store
|
||||
|
||||
|
||||
You will be able to inspect all state stored through the OCI Object Storage state store by inspecting the contents of the bucket through the console, the APIs, CLI or SDKs. By going directly to the bucket, you can prepare state that will be available as state to your application at runtime.
|
||||
|
||||
## Time To Live and State Expiration
|
||||
The OCI Object Storage state store supports Dapr's Time To Live logic that ensure that state cannot be retrieved after it has expired. See [this How To on Setting State Time To Live]({{< ref "state-store-ttl.md" >}}) for details.
|
||||
|
||||
OCI Object Storage does not have native support for a Time To Live setting. The implementation in this component uses a meta data tag put on each object for which a TTL has been specified. The tag is called **expiry-time-from-ttl** and it contains a string in ISO date time format with the UTC based expiry time. When state is retrieved through a call to Get, this component checks if it has the **expiry-time-from-ttl** set and if so it checks whether it is in the past. In that case, no state is returned.
|
||||
|
||||
The following operation therefore (notice the composite key)
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3500/v1.0/state \
|
||||
-H "Content-Type: application/json"
|
||||
-d '[
|
||||
{
|
||||
"key": "temporary",
|
||||
"value": "ephemeral",
|
||||
"metadata": {"ttlInSeconds": "120"}}
|
||||
}
|
||||
]'
|
||||
```
|
||||
|
||||
creates the following object:
|
||||
|
||||
| Bucket | Directory | Object Name | Object Content | Meta Tags |
|
||||
| ------------ | ------- | ----- | ----- | ---- |
|
||||
| as specified with **bucketName** in components.yaml | - | nihilus | darth | category: dapr-state-store , expiry-time-from-ttl: 2022-01-06T08:34:32
|
||||
|
||||
The exact value of the expiry-time-from-ttl depends of course on the time at which the state was created and will be 120 seconds later than that moment.
|
||||
|
||||
|
||||
Note that expired state is not removed from the state store by this component. An application operator may decide to run a periodic job that does a form of garbage collection in order to explicitly remove all state that has an **expiry-time-from-ttl** label with a timestamp in the past.
|
||||
|
||||
## Concurrency
|
||||
|
||||
OCI Object Storage state concurrency is achieved by using `ETag`s. Each object in OCI Object Storage is assigned a unique ETag when it is created or updated (aka replaced). When the `Set` and `Delete` requests for this state store specify the FirstWrite concurrency policy, then the request need to provide the actual ETag value for the state to be written or removed for the request to be successful.
|
||||
|
||||
## Consistency
|
||||
|
||||
OCI Object Storage state does not support Transactions.
|
||||
|
||||
## Query
|
||||
|
||||
OCI Object Storage state does not support the Query API.
|
||||
|
||||
|
||||
## Related links
|
||||
- [Basic schema for a Dapr component]({{< ref component-schema >}})
|
||||
- Read [this guide]({{< ref "howto-get-save-state.md#step-2-save-and-retrieve-a-single-state" >}}) for instructions on configuring state store components
|
||||
- [State management building block]({{< ref state-management >}})
|
|
@ -0,0 +1,71 @@
|
|||
{{/* We cache this partial for bigger sites and set the active class client side. */}}
|
||||
{{ $sidebarCacheLimit := cond (isset .Site.Params.ui "sidebar_cache_limit") .Site.Params.ui.sidebar_cache_limit 2000 -}}
|
||||
{{ $shouldDelayActive := ge (len .Site.Pages) $sidebarCacheLimit -}}
|
||||
<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}">
|
||||
{{ if not .Site.Params.ui.sidebar_search_disable -}}
|
||||
<form class="td-sidebar__search d-flex align-items-center">
|
||||
{{ partial "search-input.html" . }}
|
||||
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars" type="button" data-toggle="collapse" data-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
|
||||
</button>
|
||||
</form>
|
||||
{{ else -}}
|
||||
<div id="content-mobile">
|
||||
<form class="td-sidebar__search d-flex align-items-center">
|
||||
{{ partial "search-input.html" . }}
|
||||
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars" type="button" data-toggle="collapse" data-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div id="content-desktop"></div>
|
||||
{{ end -}}
|
||||
<nav class="collapse td-sidebar-nav{{ if .Site.Params.ui.sidebar_menu_foldable }} foldable-nav{{ end }}" id="td-section-nav">
|
||||
{{ if (gt (len .Site.Home.Translations) 0) -}}
|
||||
<div class="nav-item dropdown d-block d-lg-none">
|
||||
{{ partial "navbar-lang-selector.html" . }}
|
||||
</div>
|
||||
{{ end -}}
|
||||
{{ $navRoot := cond (and (ne .Params.toc_root true) (eq .Site.Home.Type "docs")) .Site.Home .FirstSection -}}
|
||||
{{ $ulNr := 0 -}}
|
||||
{{ $ulShow := cond (isset .Site.Params.ui "ul_show") .Site.Params.ui.ul_show 1 -}}
|
||||
{{ $sidebarMenuTruncate := cond (isset .Site.Params.ui "sidebar_menu_truncate") .Site.Params.ui.sidebar_menu_truncate 50 -}}
|
||||
<ul class="td-sidebar-nav__section pr-md-3 ul-{{ $ulNr }}">
|
||||
{{ template "section-tree-nav-section" (dict "page" . "section" $navRoot "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" (add $ulShow 1)) }}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{{ define "section-tree-nav-section" -}}
|
||||
{{ $s := .section -}}
|
||||
{{ $p := .page -}}
|
||||
{{ $shouldDelayActive := .shouldDelayActive -}}
|
||||
{{ $sidebarMenuTruncate := .sidebarMenuTruncate -}}
|
||||
{{ $treeRoot := cond (eq .ulNr 0) true false -}}
|
||||
{{ $ulNr := .ulNr -}}
|
||||
{{ $ulShow := .ulShow -}}
|
||||
{{ $active := and (not $shouldDelayActive) (eq $s $p) -}}
|
||||
{{ $activePath := and (not $shouldDelayActive) ($p.IsDescendant $s) -}}
|
||||
{{ $show := cond (or (lt $ulNr $ulShow) $activePath (and (not $shouldDelayActive) (eq $s.Parent $p.Parent)) (and (not $shouldDelayActive) (eq $s.Parent $p)) (not $p.Site.Params.ui.sidebar_menu_compact) (and (not $shouldDelayActive) ($p.IsDescendant $s.Parent))) true false -}}
|
||||
{{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}}
|
||||
{{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}}
|
||||
{{ $pages := $pages_tmp | first $sidebarMenuTruncate -}}
|
||||
{{ $withChild := gt (len $pages) 0 -}}
|
||||
{{ $manualLink := cond (isset $s.Params "manuallink") $s.Params.manualLink ( cond (isset $s.Params "manuallinkrelref") (relref $s $s.Params.manualLinkRelref) $s.RelPermalink) -}}
|
||||
{{ $manualLinkTitle := cond (isset $s.Params "manuallinktitle") $s.Params.manualLinkTitle $s.Title -}}
|
||||
<li class="td-sidebar-nav__section-title td-sidebar-nav__section{{ if $withChild }} with-child{{ else }} without-child{{ end }}{{ if $activePath }} active-path{{ end }}{{ if (not (or $show $p.Site.Params.ui.sidebar_menu_foldable )) }} collapse{{ end }}" id="{{ $mid }}-li">
|
||||
{{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}}
|
||||
<input type="checkbox" id="{{ $mid }}-check"{{ if $activePath}} checked{{ end }}/>
|
||||
<label for="{{ $mid }}-check"><a href="{{ $manualLink }}"{{ if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end }}{{ with $s.Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }} class="align-left pl-0 {{ if $active}} active{{ end }} td-sidebar-link{{ if $s.IsPage }} td-sidebar-link__page{{ else }} td-sidebar-link__section{{ end }}{{ if $treeRoot }} tree-root{{ end }}" id="{{ $mid }}">{{ with $s.Params.Icon}}<i class="{{ . }}"></i>{{ end }}<span class="{{ if $active }}td-sidebar-nav-active-item{{ end }}">{{ $s.LinkTitle }}</span></a></label>
|
||||
{{ else -}}
|
||||
<a onclick="ga('send', 'event', 'SideBarLink', 'Clicked', '{{ $manualLinkTitle }}');" href="{{ $manualLink }}"{{ if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end }}{{ with $s.Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }} class="align-left pl-0{{ if $active}} active{{ end }} td-sidebar-link{{ if $s.IsPage }} td-sidebar-link__page{{ else }} td-sidebar-link__section{{ end }}{{ if $treeRoot }} tree-root{{ end }}" id="{{ $mid }}">{{ with $s.Params.Icon}}<i class="{{ . }}"></i>{{ end }}<span class="{{ if $active }}td-sidebar-nav-active-item{{ end }}">{{ $s.LinkTitle }}</span></a>
|
||||
{{- end }}
|
||||
{{- if $withChild }}
|
||||
{{- $ulNr := add $ulNr 1 }}
|
||||
<ul class="ul-{{ $ulNr }}{{ if (gt $ulNr 1)}} foldable{{end}}">
|
||||
{{ range $pages -}}
|
||||
{{ if (not (and (eq $s $p.Site.Home) (eq .Params.toc_root true))) -}}
|
||||
{{ template "section-tree-nav-section" (dict "page" $p "section" . "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" $ulShow) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
</li>
|
||||
{{- end }}
|
|
@ -10,7 +10,7 @@
|
|||
<!-- Generate the IDs for the <a> and the <div> elements -->
|
||||
{{- $tabid := printf "%s-%s-tab" $guid $entry | anchorize -}}
|
||||
{{- $entryid := printf "%s-%s" $guid $entry | anchorize -}}
|
||||
<a class="nav-link{{ if eq ($.Scratch.Get "first") true }} active{{ end }}"
|
||||
<a onclick="ga('send', 'event', 'Tabs', 'Clicked', '{{ $.Page.Title }} - {{ $entryid }}');" class="nav-link{{ if eq ($.Scratch.Get "first") true }} active{{ end }}"
|
||||
id="{{ $tabid }}" data-toggle="tab" href="#{{ $entryid }}" role="tab"
|
||||
aria-controls="{{ $entryid }}" aria-selected="{{ $.Scratch.Get "first" }}">
|
||||
{{ . }}
|
||||
|
@ -24,4 +24,4 @@
|
|||
<!-- Inner content - generated by codetab shortcode -->
|
||||
<div class="tab-content" id="{{- $guid -}}-content">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -71,7 +71,7 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: otel-collector
|
||||
image: otel/opentelemetry-collector-contrib-dev:latest
|
||||
image: otel/opentelemetry-collector-contrib:0.40.0
|
||||
command:
|
||||
- "/otelcontribcol"
|
||||
- "--config=/conf/otel-collector-config.yaml"
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit d60eaf1c0e3bb75af480eda34307926be9865570
|
||||
Subproject commit 2ffbb113e7b5186a96ee38426a2c08526e83b0e0
|
Loading…
Reference in New Issue