Update component information

This commit is contained in:
Aaron Crawfis 2020-12-16 10:05:23 -08:00
parent 01293049fd
commit 03083e1320
1 changed files with 35 additions and 18 deletions

View File

@ -6,28 +6,45 @@ weight: 100
description: "The basic schema for a Dapr component" description: "The basic schema for a Dapr component"
--- ---
Dapr defines and registers components using a [CustomResourceDefinition](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/). All components are defined as a CRD and can be applied to any hosting environment where Dapr is running, not just Kubernetes.
## Format
```yaml ```yaml
apiVersion: dapr.io/v1alpha1 apiVersion: dapr.io/v1alpha1
kind: Component kind: Component
metadata: metadata:
name: <COMPONENT-NAME> # Required. Example: prod-statestore. name: [COMPONENT-NAME]
namespace: <COMPONENT-NAMESPACE> # Optional. Example: app-ns namespace: [COMPONENT-NAMESPACE]
spec: spec:
type: <COMPONENT-TYPE> # Required. Example: state.redis type: [COMPONENT-TYPE]
version: v1 # Required version: v1
initTimeout: <TIMEOUT-DURATION> # Optional. Default: 30s initTimeout: [TIMEOUT-DURATION]
ignoreErrors: <BOOLEAN> # Optional. Default: false ignoreErrors: [BOOLEAN]
metadata: # Required. metadata:
- name: <METADATA-NAME> - name: [METADATA-NAME]
value: <METADATA-VALUE> value: [METADATA-VALUE]
``` ```
| Field | Details | ## Fields
| ------------- | ------------- |
| metadata.name | The name of the component | | Field | Required | Details | Example |
| metadata.namespace | The namespace for the component | |--------------------|:--------:|---------|---------|
| metadata | A key/value pair of component specific configuration | | apiVersion | Y | The version of the Dapr (and Kubernetes if applicable) API you are calling | `dapr.io/v1alpha1`
| spec.type | The type of the component | | kind | Y | The type of CRD. For components is must always be `Component` | `Component`
| spec.version | The version of the component | | **metadata** | - | **Information about the component registration** |
| spec.initTimeout | The timeout duration for the initialization of the component. durations examples: 10s, 10m, 1h | | metadata.name | Y | The name of the component | `prod-statestore`
| spec.ignoreErrors | Tells the Dapr sidecar to continue initialization of the component fails to load | | metadata.namespace | N | The namespace for the component for hosting environments with namespaces | `myapp-namespace`
| **spec** | - | **Detailed information on the component resource**
| spec.type | Y | The type of the component | `state.redis`
| spec.version | Y | The version of the component | `v1`
| spec.initTimeout | N | The timeout duration for the initialization of the component. Default is 30s | `5m`, `1h`, `20s`
| spec.ignoreErrors | N | Tells the Dapr sidecar to continue initialization if the component fails to load. Default is false | `false`
| **spec.metadata** | - | **A key/value pair of component specific configuration. See your component definition for fields**|
## Further reading
- [Supported state stores]({{< ref supported-state-stores >}})
- [Supported pub/sub brokers]({{< ref supported-pubsub >}})
- [Supported secret stores]({{< ref supported-secret-stores >}})
- [Supported bindings]({{< ref supported-bindings >}})
- [Set component scopes]({{< ref component-scopes.md >}})